- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
[quote user="airdrik"][quote user="Uncle Al"][quote user="Rawr"]
[/quote]No, no, no. Clearly, the right approach is:
[/quote] No, no, no. Clearly you are moving in the wrong direction. We want small, concise variable names:
[/quote]
If we're using concise variable names, surely we ought to pair them with verbose comments.
[/quote]
(Comment extrapolated from original function name, mostly.)
Admin
My COBOL final exam left me with 3 pencils worn down completely and a hand so cramped I couldn't beat off for a week.
Admin
Admin
Admin
You never learned to "soft-type" :P
Admin
COBOL's rubbish. Use FORTRAN instead. You know it makes sense.
Admin
Now, you kids need to get off not just my lawn, but my neighbour's lawn too.
Admin
You can use FORTRAN for business applications, but it's not really feasible to use COBOL for scientific applications. I've said enough.
Admin
If this isn't a featured comment I'm done with TDWTF.
Admin
I do agree that we should pair concise variable names with verbose comments, but our improvements must ensure that the new version is no more readable/usable than the original. I also like the reference to the other obfuscated setting.
[code]///
Admin
Are you a LISP programmer by chance?
Admin
Yep, that's perfect. Sod the unit tests, that's bound to compile - can you release it to production immediately, the customer's in the CEO's office waiting at a terminal.
Admin
Anyway, there's no chance of a comment with my name ever getting featured as Papadilililimous has a hard on for me for desecrating his comments page. I have a hard on for him too!
I wonder if there's some kind of job that I can do to change his feelings about me. I'm not just about flapping my gums, I can get my hands dirty if necessary!
Admin
No need: method names in VS are limited, to 250 Unicode characters.
Admin
I'm suddenly reminded about a WTF of a language - which one I can't remember just now - such that the compiler lets you define variables with as many characters as you like, but only actually takes any notice of the first 31.
So if you define two variables with names 100-odd characters long, only the last 50 of those being different, the compiler will treat these as the same variable, and not tell you what it's doing.
Although it may be kind and tell you that you've just tried to declare the same variable twice - I can't say.
Admin
The reference I have here says that's the case, but only for identifiers that don't have external linkage. For identifiers with external linkage, apparently only the first six characters are significant, and they're case insensitive. Isn't backwards compatibility wonderful?
Mind you, said reference also notes that "Most compilers and linkers are more generous than the standard". And it was published in 1996, so C99 might be better, I guess.
Admin
Admin
(perhaps that's why people talk about spoonfuls of Syntactic Sugar)
Admin
We have plenty of undocumented features in our code, but at least it compiles!!
Admin
I was thinking the same thing...Single Responsibility principle.
Admin
Admin
I think there's a bright future ahead of you as a system architect.
Admin
Might as well make the property generic too
Admin
data was a list of chars which was the received message. It would be something like '013[the message]'. GetRange() was used to get the 'substring' of the message length, and he proceeded to get the length of the substring and take that as the length of the message, rather than actually parsing the string. End result is only the first three characters of any message were ever seen.
The sad thing was that the original working code was replaced with this for some reason.
Admin
No, no. Nothing beats good old C convention. Easy to read and much shorter to type too: stngstrprcchngsstrprdctprcnupdtsprdctprcnupdtsprdctmdfdtmstmpbtdsntmdfyaprdctththsndfltprcnglrdy();
Admin
I create functions that are just as meaningfull
public bool foo { .... }
Admin
But then, when you only have 6K of program memory you don't want to take up much of it with variable names.
What on earth were you doing with the pencils?Also, I think the people posting commented versions of the code have in general forgotten that the comments should not describe the function correctly. Otherwise they'd be too useful. You need to guess what the function did two or three revisions ago and write the comments based on that.
Admin
You wore down 3 pencils wanking?!?
Admin
[quote user="Hatshepsut"][quote user="Z00n3$!$"]
You wore down 3 pencils wanking?!?
[/quote]
Who hasn't done something like this?
Admin
Arrg. Oh my fucking god. You are one fired programmer if you come near my department - you spelt the name of the word wrong. Have you any idea how difficult that makes maintenance? Everyone know's it's "supercallifraggalisticexpealadosuhs"!
Admin
what is this "documenting" that you speak of?
Admin
Admin
My representative line of the day. Describing the code quality of a web site I was asked to check:
'nuff said.
Admin
Is it just me or has that string broken the side of the browser, lapsing into freedom out of the confines of the text box?
Admin
The ANSI C committee tried very hard to not alienate any vendors. I can understand that, but sometimes you need to single out the runt for a vicious beating. It's for the good of all.
Admin
The function is incomplete. It should be:
public bool SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndUpdatesProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready { ready; get; set; go; }
Admin
This is supposed to be a highly-descriptive property name?
public bool SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndUpdatesProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready { get; set; }
It is not at all descriptive. Imagine an alien species that has no conception of "Store", "Price" and "Product". How are they supposed to understand this? The property name should at the very least include the Wikipedia articles for the above mentioned concepts. Furthermore not everyone speaks english. The property name must contain its own translation in at least 10 languages to be of any use at all. Not everyone can read. To be even minimally usueful it is obviously obvious that the property name must contain the base64 encoding of a video of a speaker explaining the property name.
Admin
Hmmm.. If this property is really implemented like it name says, then it has side effects which is not done...
Admin
Exactly. I like descriptive variables too though - I call a variable e.g. "DatabaseConnection" instead of "dbconn" - but one shouldn't exaggerate.
Admin
Admin
No no, that wasn't supposed to be the name of the word, it was supposed to be what the name of the word is called.
Wait, wrong story.
Admin
Admin
[quote user="Matt Westwood"][quote user="Cad Delworth"]
I'm suddenly reminded about a WTF of a language - which one I can't remember just now - such that the compiler lets you define variables with as many characters as you like, but only actually takes any notice of the first 31.
So if you define two variables with names 100-odd characters long, only the last 50 of those being different, the compiler will treat these as the same variable, and not tell you what it's doing.
Although it may be kind and tell you that you've just tried to declare the same variable twice - I can't say.[/quote]
That happenned on DOS and early Windows but it was not a language limitation but one of the linker. When C++ was invented with its name mangling scheme this limit was then lifted.
Early BASICs also had a 2 significant character limit, that was a PITA.
Admin
Admin
Admin
Very good
+100000000
Admin
Very Good
+infinity +1
Admin
Admin
Nope, happened to me too in my little "forced by IT to use IE7 world"
Admin
///