- 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
It has unfortunately been all too common with compiler bugs like that, so I won't say that a defensive programming action is a WTF. The only WTF is the compiler that required that kind of programming once.
And since code like that doesn't do anything neither harmful nor harmless it's not a priority to clean it out.
I'm even wondering why this made the WTF blog.
Admin
Admin
Short IF ... THEN form leaks stack. And VB doesn't report overflow, when it caused by "nested" operators or parentnesses. So, when you put ELSE, you will "close" several IFs up. To avoid this bug, every IF must have ENDIF (compiler will check stack overflow before ENDIF)
Admin
Ohh, skipping the End If! What would they do if they were progamming in Python to prevent the program exection from "skipping the lack of indentation in following line"? Sheesh.
Admin
Presumably there would be no possible workaround if the Python interpreter had a bug like this, so they'd just not use Python.
Admin
I'd say 99.99% of the uptime. I mean time. I've been way behind and tried to cut corners in testing and figuring these things out, and almost always had to revisit the situation due to bug reports coming in just after the publishment.
Admin
I've seen the VS 2005 debugger skip over End If, if End If is the last line in a method. The code is otherwise executing fine (as well as an "End If" statement can be executed), it's just a flaw in the debugger. This guy was probably watching the debugger and thought that the line of code was being "skipped".
Admin
I guess you didn't know there is syntax highlighting in vi / vim - here's the first google result for an example
http://www.cyberciti.biz/faq/turn-on-or-off-color-syntax-highlighting-in-vi-or-vim/
I have done plenty of coding in vim with syntax highlighting :)
Or maybe it was SO LONG AGO that you were using a vt100 with a monochrome display, and using "screen" to shift between your vi and debugger "windows" ? ;-)
captcha: "dolor", suitable comment on going back to vi + debugger after using an ide!
Admin
Once upon a time I ran into a very similarly weird bug in the VMS C compiler.
I had an extra semicolon between declarations.
The next FOR loop in the program had the semicolon as it's block. The block following was executed just once.
University assignment. I Did work it: after submitting the (not working, with a complaint) assignment.
Admin
I prefer to style my comments like this:
Admin
On the subject of syntax colouring:
I'm sure I'm not the only one to have experienced the following, when coding in an IDE featuring auto syntax colouring:
Someone loudly and repeatedly proclaiming that I was "not a real programmer" because I was "wasting time colouring in the letters." o_o
Admin
Syntax highlight FTW?
Admin
should result in a syntax error (Else without If).
As far as the syntax of single-line statements is concerned, Else always applies to the nearest If. For instance:
These are logically different, and should be parsed as follows:
The single-line version is supposed to be restricted to a single line, and should always end at the end of it. The next line should under no circumstances be parsed as a continuation of it unless the line continuation operator is used to specifically indicate that it should.