"White space"

Who uses white space???

(if you don’t know what that is, it is like making your programs easy to read)

Why wouldn’t you use white space?

I use it so I can read my code.

You would be surprised, some people just don’t like to organize their code after its written.

I know that some people don’t use whitespace, I’m just questioning why one would want to do so (ie, it seems like the OP is trying to make a case for not using whitespace). As Joe pointed out, using whitespace makes your code easier for you (and everyone else) to read.

Generally, the argument is for how much whitespace is enough, and usually boils down to personal opinion. Personally, I like white space.

It adds too much weight to the robot. Each space = ~0.0001327 oz. Tabs are either 4 or 8 times that depending on your editor settings. Count up all the white space in your code sometime and calculate how much weight it adds.

:stuck_out_tongue:

Oh, don’t get me wrong I totally agree with you. But some people are lazy and tend not to use whitespace. Using whitspace makes code easier to read and it allows for easy editing. Comments are another big issue that some people do not use (cough our programmer sometimes).

Did anyone else think of the programming language whitespace?

After writing a bit in Python, I more fully appreciate proper formatting for code. Programming is codified communication, with the machine and with the human. I don’t over kill on it in other languages, but I do try to maintain some semblance of order, even if I’m just writing a short script to check my calculations.

I like to use white space, especially since I’m not the only one working or reading the code. Also my dad is a software engineer, and he has shared with me when he looks at code that a group is working on and they don’t comment or orginize their code. Especially when others have to understand and read the code.

for the same reason we usually don’t use comments.

I love whitespace! If the OP is trying to argue against it, he’s in for a surprise if he ever gets a programming job. Even if you can read non-whitespaced code, nobody else can.

Some kids I’ve mentored in the past didn’t use tabs at all, and it was painful to look at. It was impossible to tell, at a glance, when functions started, the scope of loops, etc. It was all either memorization or bracket-counting.

This year I found the majority of compilation errors that I helped my students fix were due to mismatched braces (usually with inconsistent indention). Whitespace is good, especially if you want quick help.

Helpful Windriver tip: Select your code and press Ctrl-I to auto indent your code

There are people that write their programs on a single line?

I use it as much as possible.
I tend to follow the statement I believe Alan Anderson made: “Software is documentation that compiles into code”. I my have mis-quoted that, but you get the idea.

I sincerely hope you’re joking. Extra code doesn’t add any weight.

Right. It’s the other way around. The erased state of flash memory is a logic one, so adding code actually removes bits. :stuck_out_tongue:

Bah, the weight savings of a few electrons in flash are nothing. We added a few vandegraph generators to the bot to remove some real electrons!

And you wonder why we are getting static charge build up this year.

:rolleyes:

I love white space. I do stuff like this:

function(
        int     parameter 1 , //comment
        int     parameter 2 , //comment
...
        word    parameter20 ) //more comment

Unfortunately the other programmers would do stuff like:

function(int parameter1,int parameter2, ... word parameter20)

All on one line. And when I space it out they complain! It’s horrible!

Ahhh, but the process of writing a “zero” is done by injecting electrons into the float gate. So a programmed device has the mass of these electrons (which is of course negligible).