Wasted space
-
David Skelly wrote:
He holds on to the old idea that a line of source code must never be more than 80 characters long. Why not?
Oh, for the good old days, patiently inscribing COBOL statements on to 80 little boxes on an A3 size coding sheet, and just gazing at its perfect symmetry!
Richard MacCutchan wrote:
Oh, for the good old days, patiently inscribing COBOL statements on to 80 little boxes on an A3 size coding sheet
...So the punch girls could mistake 'O' and '0', '1' and 'I', and just about any other letter for just about any other letter... ...Then the operators could drop the stack of cards, but run it anyway... I had one card set returned with bits of a salad sandwich in it!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
David Skelly wrote:
He holds on to the old idea that a line of source code must never be more than 80 characters long. Why not?
Oh, for the good old days, patiently inscribing COBOL statements on to 80 little boxes on an A3 size coding sheet, and just gazing at its perfect symmetry!
I started my career writing RPG and we had the same coding sheets that you could fill out by hand. IBM also produced templates that were designed to overlay a 24x80 screen to make sure everything lined up and was in the correct column. (By which I mean actual physical templates made of cardboard.)
-
David Skelly wrote:
He holds on to the old idea that a line of source code must never be more than 80 characters long. Why not?
While displays are certainly capable of displaying more than 80 characters, there are trade-offs between maximum column width, font size, and window width. If a program is mostly written using lines that happen to be 60-80 characters long, except for a few lines that are 240 characters long, then one must either tolerate having some lines which cannot be viewed in their entirety, or else widen one's windows or shrink the font, leaving most of the right 2/3 of the window blank, so the longest lines will fit. If different team members have different displays, it would seem entirely reasonable to have policies regarding preferred line width limits, recognizing that there are and should be some exceptions (e.g. if many lines of code are going to slightly exceed the desired width limit, it may be better to have them all be slightly too wide than to have every line split in two). BTW, I've sometimes wished for a programming language environment that could embed formatting marks in code so that code would wrap sensibly in the editor when necessary, regardless of screen width; such marks would have to be invisible to a compiler. Once upon a time I played around with MS-Word, but that was well over a decade ago and I never really used it.
supercat9 wrote:
If a program is mostly written using lines that happen to be 60-80 characters long
I'm guessing that you haven't used Java generics very much.
-
Richard MacCutchan wrote:
Oh, for the good old days, patiently inscribing COBOL statements on to 80 little boxes on an A3 size coding sheet
...So the punch girls could mistake 'O' and '0', '1' and 'I', and just about any other letter for just about any other letter... ...Then the operators could drop the stack of cards, but run it anyway... I had one card set returned with bits of a salad sandwich in it!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
OriginalGriff wrote:
So the punch girls could mistake 'O' and '0', '1' and 'I', and just about any other letter for just about any other letter
Good excuse to ask her out for a drink ;)
OriginalGriff wrote:
Then the operators could drop the stack of cards, but run it anyway
Yeah, we had power when I was an op.
OriginalGriff wrote:
I had one card set returned with bits of a salad sandwich in it!
Probably went through the sorter first. :laugh: :laugh:
-
I think wasting space would be right at the bottom of my list of priorities. Much more important would be clarity, execution speed etc. If you really want to save space, write your source code using a smaller font.
JustAStupidGurl
-
I think wasting space would be right at the bottom of my list of priorities. Much more important would be clarity, execution speed etc. If you really want to save space, write your source code using a smaller font.
JustAStupidGurl
Nah, for real space savings you also want a propotional, kerned font, and only use thin letters and numbers! ;)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
I don't know why you are being flamed. I like your answer.
SS => Qualified in Submarines "We sleep soundly in our beds because rough men stand ready in the night to visit violence on those who would do us harm". Winston Churchill "Real programmers can write FORTRAN in any language". Unknown
-
I am familiar with the ternary. I have never liked and probably never will. I find it insufficiently readable. Also, I would like to think my opinion is not due to stupidity.
Are you familiar with the words obviate, relegate and denigrate? Many people aren't, but that doesn't mean that they shouldn't be used in common english language. By using words that have more meaning in them, we are able to shorten (use concision) our sentences while still conveying the same meaning. I think the same thing applies in writing software. By using appropriate structures and controls we are able to shorten the code while still conveying the same meaning both to the compiler and the reader. Please don't think that I am denigrating your code reading skills, I am just saying that sometimes extraneous words can be obviated.:cool:
SS => Qualified in Submarines "We sleep soundly in our beds because rough men stand ready in the night to visit violence on those who would do us harm". Winston Churchill "Real programmers can write FORTRAN in any language". Unknown
-
value ? "y" : "n"
personally I don't really like this structure. (unreadable)
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveI suspose you also believe lambda expressions shouldn't be used either? They are even harder to read but shorten the amount of written code by huge degrees. I wrote my first one today. Granted it's quite simple but its effective. return ModifiedKeys.First(kvp => kvp.Value == id).Key; Just to help you out, ModifiedKeys is a Dictionary. This line returns the first key in my dictionary who's value matches id.
-
May not be a horror, but what a waste of space
private void appendBooleanField( boolean value, boolean lastField )
{
if ( value )
{
appendField( "y", lastField );
}
else
{
appendField( "n", lastField );
}
}Why couldn't they replace the whole function with
appendField(value ? "y" : "n", lastField);
That reduces the line count by 10 (not counting the 7 lines of comment for the function), and removes the overhead of a function call. And, the example above is repeated over and over in the code.
SS => Qualified in Submarines "We sleep soundly in our beds because rough men stand ready in the night to visit violence on those who would do us harm". Winston Churchill "Real programmers can write FORTRAN in any language". Unknown
Actually, I've always hated that inline if syntax. In fact, my version of that routine would be even longer:
private void appendBooleanField( boolean value, boolean lastField )
{
strind field;if ( value ) { field = "y"; } else { field = "n"; } appendField( field, lastField );
}