- 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
Admin
You're kidding, right?
Admin
The funny thing is that you're probably right. My theory is that developers who obsess over the visual appearance of their code usually do so because the code is lousy. Without any way to sanely organize existing spaghetti code, the only option they know of is to make it look pretty.
That might be what happened with Trent.
Admin
I thought that Easter Island was proven to be the first binary computer.
Each statue represented a one bit. A blank in the formation was a 0 bit.
The entire island died of starvation while the head programmer was trying to debug his first program.
Interestingly enough, the program was finally rewritten by some guy named Conway who called it Life.
P.S. The Easter island bug was in the sparse array logic.
Admin
Admin
ftfy
Admin
You get Variants in VB6 for all but the last variable in this case as well. The "auto-resolution" of type (whatever you want to call it) didn't start until .net.
Admin
He is suggesting that refactoring is a good idea. And don't call him shirley.
Admin
That's a big negative on the VB6 interpreting those declarations like C.
Dim i, j As Long Debug.Print VarType(i), VarType(j)
Output: 0 3
0 = Empty (null), something a Long in VB6 cannot be 3 = Long Integer
Admin
Admin
Admin
I like to do this with my makefiles. It makes waiting for the code to compile on a larger project much more bearable.
Admin
I disagree. Well-written code is visually pretty and badly written code is very difficult to make it look pretty.
Admin
What I did suggest, however, is that an obsessive programmer working on badly written code will try to make it visually prettier as a futile attempt to "improve" the code.
But it seems you weren't disagreeing with the overall theory, rather the assumption that poorly-written code can "look pretty". If you still disagree with that, then I submit today's article as evidence.
Admin
It all makes sense, now.
Admin
I prefer Haiku compliance in mass variable declarations! (and in HTML)
Admin
Nice poem, comrade.
Admin
Might be beautiful, but maintainability: VOID
Admin
OK i get it, the more global variable you have, the prettier the code gets !
What an incredible breakthrough in software design !
Admin
Well written code is no more visaully pretty than a Pollack is.
Admin
Admin
That's because 'VB.Net' is NOT VB. It's a damaged C# kludge.
In BASIC, all the declarations are self contained, not line delimited.
Admin
I'd recommand download and using Access 2003 developer extension if his company has access to MSDN subscription.
It was helpful when I was handling an Access 2000 project years ago...
Admin
It's a longneck beer bottle.
Admin
It's a long neck beer bottle.
Admin
the real WTF is that in VBA (unlike VB proper), the last variable is the only one that gets assigned the variable type passed. For instance, in this line: Public PrmID, ImptID As Long
only ImptID is cast as a Long. PrmID is cast as the default -- a memory clogging 'Object' type.
Admin
To confirm what others are saying... in the BASIC variants I've used extensively (QBasic, VB3, VB6... luckily I managed to drop the whole thing before .net), the line
is the same as and ends up like:But really, I'm tempted to become a VB consultant so I can scatter random people's code with
and see how many people can figure it out... Did you know that, according to the VB.net docs, that syntax isn't even deprecated? Neither is On Error Resume Next... they just "recommend" doing something sane with Try/Catch.Admin
If you look at these lines from a larger distance you can almost see a christmas tree!
Admin
Some people should count their blessings... I had to sort out an Access/VBA "app" once that was "written" by a lady who apparently didn't know about variables. Everything was done with big, nasty one-liners, or queries. I wish when I quit that job I didn't ceremonially trash every trace of it from my home system - at the time I didn't know about TDWTF - it would've surely got featured.
Admin
In fact it's a Rorschachtest for code monkeys.
Admin
Ah, the flow of a software project.
Admin
Admin
This wasn't written by a programmer. It was a manager in disguise:
As a manager, you'll interrupt at random, read the first and last page, and then you know what to do. In here: The first character and the last word of line 18-25
Public FFF, NCF1, BB1, B1A As Currency Public InvldMet, FER, AS1 As Currency Public RevUpPct, RvUpPost As Currency Public EscA, EscB, InvaldT As Currency Public RSDFee, FedFee, R5Fee As Currency Public StripTot, StripTotalPct As Currency Public ValPrt, PretextVar, G1, R1 As Currency Public PartAff12, affixedMost, GRat1 As Currency
Translated: Fire her please, and you'll get a lot of money
Admin
Admin
Please do everyone else a favour and start arranging variables alphabetically. It's the one true way.
Admin
FTFY
Admin
Admin
Please! Seek psychiatric help NOW!
Admin
Obviously you're not a married man, or you'd be able to sympathize.
Admin
No, I'm serious. There is a benefit: increased comprehension and maintainability. The restructuring is a precursor to overhauling the code. Once you have made the code more understandable, then you can start improving it.
I'm a business owner as well as a programmer. You don't just throw code away because your predecessor didn't do things your way. In the real World, you can't always afford to start from scratch.
Since I started writing code in 1965, it seems to have worked out OK so far. (No, I don't do COBOL and FORTRAN anymore, just C++, C#, PHP).
Admin
Reminds me of this: http://www.geeksaresexy.net/2009/09/01/a-hidden-gem-in-html/
Admin
Wonder if this was the intent, or just what I see in it:
http://www.nationalgeographic.com/history/ancient/images/sw/easter-island-head-289121-sw.jpg
Admin
Don't tell me you are not sorting your variable declarations alphabetically and by length.
Admin
That isn't to say that cleaning code up is never necessary; I just think it should be on an as-needed basis. If you're faced with fixing a bug or adding a feature, refactoring (or just rewriting) the relevant portion of code as needed can be helpful to fix/add the bug/feature. But a project with the sole purpose of restructuring code to do what it already does seems like madness to me.
True, you don't just throw it away; you archive it. And if you already have working code with a working design, even if it is poorly-written, you're not technically starting from scratch.I understand your point; it's not always an affordable solution. I would suggest though that spending your time on a "fun project" like refactoring could be just as expensive. How would you know beforehand which might be more costly?
True, YMMV. I can really only comment based on the experiences/observations of myself and others with whom I've discussed refactoring.Admin
Uhhh... Why not just scrap it and write it better. Like in another language?
Admin
Admin
... but what does it mean...?!
Whhooooooo!
Oh my goood. All the way across the code. sob tubular bells in the background
Ahhhh! Aooh!
Admin
Admin
I really hope you're kidding. This is not a target for refactoring. This is a target for re-write. In a real language like C#.
Admin