Avatar

I'm not sure what I am (Destiny)

by kidtsunami @, Atlanta, GA, Tuesday, December 13, 2016, 15:44 (3144 days ago) @ dogcow
edited by kidtsunami, Tuesday, December 13, 2016, 16:03

-->|if (output != null)
-->|{
-->|-->|output.append("account_id").append('\t')xxxxxxx// comment about account_id
-->|-->|xxxxxx.append("submission_id").append('\t')xxxx// comment about submission_id
-->|-->|xxxxxx.append("payment_method").append('\t');xx// comment about payment_method
-->|}


You never have to worry about downloading a file and opening it up in an editor and having it looks like awful nonsense. Considering that almost any text editor or IDE one would use for coding allows you to set Tab Space by filetype, workspace, user, or application wide, it can be super consistent.


Though honestly, it's whatever your team decides, I'm a Clean Coder and that's the law I live by.


The wonderful thing about using tabs for indenting and spaces for aligning (or making code pretty) is that it doesn't matter what editor you open it up in, it will look pretty and match your preferred indent size (as long as you are using a fixed width font, variable width font users are just wrong, and they deserve to look at ugly, slightly misaligned code all day long).

My example opened in an editor that has tabs set to 6-spaces wide:
---->|if (output != null)
---->|{
---->|---->|output.append("account_id").append('\t')xxxxxxx// comment about account_id
---->|---->|xxxxxx.append("submission_id").append('\t')xxxx// comment about submission_id
---->|---->|xxxxxx.append("payment_method").append('\t');xx// comment about payment_method
---->|}

But yes, above all stick to your team's coding standards, please!


Edit: are you a python guy? I suspect you may be...

Considering only professional coding (not including internships):

8 years of .NET before becoming a consultant and now 4 years of Salesforce, Python, .NET, Javascript (mostly a typescript junkie)

I'm not a fan of space sensitive languages, and prefer 4 space styling. But yeah, as always stick to your team's coding standards, which are hopefully heavily based on some existing language styling guide.


Complete thread:

 RSS Feed of thread