Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   "White space" (http://www.chiefdelphi.com/forums/showthread.php?t=75948)

cooldude8181 17-03-2009 23:20

"White space"
 
Who uses white space???

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

virtuald 17-03-2009 23:23

Re: "White space"
 
Why wouldn't you use white space?

Joe Ross 17-03-2009 23:31

Re: "White space"
 
I use it so I can read my code.

R.C. 17-03-2009 23:33

Re: "White space"
 
Quote:

Originally Posted by virtuald (Post 837606)
Why wouldn't you use white space?

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

virtuald 17-03-2009 23:36

Re: "White space"
 
Quote:

Originally Posted by rc_cola1323 (Post 837610)
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.

ChuckDickerson 17-03-2009 23:47

Re: "White space"
 
Quote:

Originally Posted by virtuald (Post 837606)
Why wouldn't you use 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.


:p

R.C. 17-03-2009 23:52

Re: "White space"
 
Quote:

Originally Posted by virtuald (Post 837613)
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.

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).

EricVanWyk 18-03-2009 00:02

Re: "White space"
 
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.

Cow Bell Solo 18-03-2009 02:16

Re: "White space"
 
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.

swamp_child 18-03-2009 07:38

Re: "White space"
 
Quote:

Originally Posted by DeepWater (Post 837617)
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.


:p

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

Bongle 18-03-2009 07:47

Re: "White space"
 
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.

The Lucas 18-03-2009 09:21

Re: "White space"
 
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

Mr. Freeman 18-03-2009 13:35

Re: "White space"
 
Quote:

Originally Posted by virtuald (Post 837613)
I know that some people don't use whitespace

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

billbo911 18-03-2009 14:06

Re: "White space"
 
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.

basicxman 18-03-2009 14:18

Re: "White space"
 
Quote:

Originally Posted by DeepWater (Post 837617)
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.


:p

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


All times are GMT -5. The time now is 02:25.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi