- 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
var aLeapYears = new Array(1900,1904,1908,1912,1916,...
Bzzzzt!
Good, because he/she/it would likely have screwed up again at 2100.
I literally :facepalm:ed at this one.
Admin
You would think this article would get proofread after 10 years, but no:
Filed under: Classic mistakes, Nothing to see here
Admin
I'm not convinced that's necessarily any better..
Admin
That word was in the original copy.
Hmmm, now I wonder if our insert / delete markers can be used in quotes instead of just bold...
EDIT: There, fixed.
Admin
And ten years later,
is still going strong. Little too much spiked eggnog, Santa?
Admin
Yep, know what you mean.. :smile:
But who can blame a hell-desk guy for assuming that rewriting a complete application in a completely new language can not possibly create any bugs.....
But I would suggest that hell-desk guy to switch to flipping burgers, less WTF's that way, but then again, this site would be more boring.
Admin
Oh, I can go one better ... project proposal earlier this year: "We will avoid this technical risk [excessive test/bug-fixing workload] by producing multiple prototype applications in different languages". Yes, actually thinking that developing the project multiple times in different ways would be easier than testing and debugging it properly ...
Admin
http://dilbert.com/strip/1994-10-17
Admin
Thanks for ruining burgers for me. In the future I'll always imagine my burgers being flipped by such a guy, and then I'd rather starve or eat them raw.
Admin
Well My job here is done as I have now done my part to improve world health by preventing you from getting cardiovascular problems in the future :grinning:
Admin
Wait a second... the padding one doesn't actually zero-pad.
Admin
FYI, that's called N-version programming, and it was debunked pretty thoroughly back in the eighties. People make the exact same mistakes, regardless of which language or framework they are using.
Admin
I do the second to last one sometimes. If the code that can fail and the prior code that prevents it from failing are too far apart to not fit on the same screen, my brain gets nervous and goes into "can't be too cautious" mode.
Admin
If the mistakes are characteristic of the problem domain, yes. If the mistakes are characteristic of the programming language, no. Unless the different languages used to make the versions are similar. (For example, Ruby and Python have pretty similar semantic models on some levels, and will attract some similar language-induced problems. You'd get different ones with OCaml.)
There's no assurance that producing lots of versions will give you a bug-free version. Not unless one of those versions happens to be done with the aid of a superb test suite…
Admin
This totally happened in our team. Just couldn't pin down the source of that bloody error. Only that the coder in question put in "F**ing Sht" AND the message then popped up in production with several users. We got a very loud and insistent phone call from quality management. :laughing:
Admin
It adds 0 to the front. What more can you want?
The real wtf-ness is, of course, the
part. Under what circumstances will i then be less than 10, 100 or 1000 ... or greater than 10000, 100000 et cetera? (And just how many further powers of 10 were snipped?) The implication is that this is a copy-and-paste function that occurs repeatedly in the code, for differing ranges of i each time. The wtfs multiply...
Admin
Well, but it looks (unless I'm misreading it) like besides the goof you noted, it only ever adds a single zero, no matter what magnitude the input is. Not what I typically think of as "padding".
Edit: Actually, I take that back. As written it looks like it adds as many zeroes to the front as the value of the input.
Admin
I looked for the 2000 error...and totally missed this one. :facepalm:
:rofl:
Absent the last step, no less.
Admin
Ok, exact same mistakes was a bit of a hyperbole, but my understanding is that Knight & Leveson showed that there was a statistically significant correlation in the errors that were made, regardless of language or methodology. Its not that nvp has no effect at all, its just that the bang for buck is a lot lower than you get with proper design and testing. Especially if the spec itself could have errors in it.
@jas88, maybe you could still salvage this. Tell them you think its a great idea, and that they should take it one level further by having one team design each unit, and have some process call that unit with a variety of inputs and record the outputs, then get the next team to implement the same unit, and check that it has the same outputs for all inputs. Et Voilà, your company just invented unit testing.
Admin
@Buddy: "one team" ... "next team" ... that would rather require the project to have a non-trivial number of developers, wouldn't it? Having a design and some sort of spec would be nice too. (At my last count it had 3 people, none more than 20% FTE.)
So far, the goal is to track sensor input from a building .. and somehow use that to feed back into CAD systems. (Yes, plural.) They'd forgotten to mention that aspect in the funding bid though...
Last time I was thinking about their aims, I was comparing it to the idea of a manned mission to the sun: not just impossible, but certifiably insane to contemplate in any way.
Admin
Nah, you just do it at night.
[image]Admin
Now 'scuse me while I decide whether or not to do something about
Admin
Admin
Did nobody tell that guy about different window sizes, different font sizes, and the benefits of ACNEScript?
To the last one:
TWTF here is that the ifs aren't nested. It would be far more effective to write
The Night Of The Space-Walking Dead, I suppose?
Admin
<center>
<center>Filed under: [I think DC sanitizes those away, sadly](#tag)</center>
Admin
Files are shared resources, and it's pretty easy to run into concurrency issues. So you check if the file exists again... and cross your fingers and hope it doesn't get renamed or deleted in between
and
Or you just throw in an
On Error Resume Next
and be done with it...Admin
Especially for local files, because the idea of file locks is patented, afaik. Network files are not so much of a problem, for network connections are 100% reliable, as we learned from one of our clients*.
* indirectly - they asked why the heck we'd rather use a local copy of a 5 KB file instead of just Doing It Right™, that is, using a web service.
Admin
Was. Probably by IBM in the 1960s.
Admin
I believe nowadays you can even rename based on a file descriptor, using "/proc/self/fd/%d" as the source.
Admin
Now do it in Visual Basic...
Admin
Now do it in Brainfuck. Or BIT (hard version: without running out of disk space).
Admin
Why? The original code fragment was written in Visual Basic, which is a programming language that real people actually use to do real work, quite often, like it or not.
Admin
But not real often on the platform that the solution that you replied to was presented for.<!-- I think I assembled that sentence correctly…? -->
Admin
I never did much windows programming, so I have no idea if something like that exists on windows. If it does, it's probably in .net and hence in VB.
I'd also initially failed to identify the snippet as VB, because back when I used VB having all keywords in all-caps was still mandatory.
Admin
But the original code was VB.
[image]AFAIK it was never mandatory that they be all caps, although the editor might have automatically changed them to all caps as you typed.
Anyway, that fragment of code doesn't use curly braces, used
'
for comments, andIf
...Then
...Else
...End If
syntax... combined, that is pretty indicative of VB (Fortran hasEND IF
, but uses!
for comments and I don't think it supportsThrow
either).Admin
But VB.NET has curly braces! https://msdn.microsoft.com/en-us/library/bb385125.aspx https://msdn.microsoft.com/en-us/library/dd293617.aspx
Admin
"It" meaning the code fragment from the article, which doesn't use curly braces at all.
Anyway, I meant doesn't use curly braces to offset code blocks. So the code obviously was not C, Java, etc.
Admin
Support : I'm telling you, nothing changed!!! The only difference between the old version and the new version is that the old version was in COBOL, and the new one is in C!!! "did you make any changes to your system? NO! i got a new computer, but i didn't change anything!"