- 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
break;
Admin
How else would you name a type that represents al kinds of breaks: Column-break, Page-break, section-break.
Admin
If you're stupid enough to willingly use Delphi 7 (a 10-year-old language/IDE) in 2013, you deserve whatever shit you get.
tl;dr Oliver T. is a fucking dumbass.
Admin
The TRWTF is Word OLE Automation. It's a long time since I used it, coincidentally controlled by Delphi, but it was buggy to the point of being unusable. After three months of trying to make it work, I gave up and generated RTF documents instead.
Admin
Break is just a glorified GOTO and therefore evil™.
Admin
Hurrah!
I used to understand OLE and now I find I don't !!!
I'm cured !!!!
Hurrah !!!
Admin
(You are aware that Dijkstra would not have considered the break control flow construct to be evil? Or are you just one of the legions of parrots who don't understand why he wrote that particular letter and use it as an excuse to commit great harm?)
Admin
The language itself is not being broken here because Break is not even part of the Delphi language. It's merely a procedure defined in Delphi's System unit.
If you were to fully qualify all the calls to Break by changing them to "System.Break", the compiler would ultimately complain about the identifier "Break" being redefined at the point of declaration of the original Break procedure in the System unit. It all depends on the order of unit compilation.
It's still a WTF, but none that breaks a language.
Admin
You have to give the original developer a break ... he's just used up his last one!
Admin
I don't know anything about Delphi. What is the issue there?
The programmer wanted to use this procedure: http://www.delphibasics.co.uk/RTL.asp?Name=Break but the linker found this interface instead: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.break_members%28v=office.14%29.aspx Is that correct? Doesn't Delphi have something like packages or namespaces to deal with such issues?
Admin
The WTF is a missing semicolon? Lame.
Admin
I can't imagine any legit reason to use Delphi in this day and age over say .NET or even Java. Maybe when you couldn't be sure of people having .NET installed but nowadays it's standard on every computer.
Admin
So... A DLL overrides a language feature/protected word. Isn't there any way to qualify things?
(I know nothing when it comes to Delphi)
Captcha: dolor - Many a consultant were given top dolor and high praise for their part in ensuring job security for most IT people.
Admin
Admin
I have worked for a company that still (November 2013) uses Delphi 5 for it's main products (huge ass ERP). A project to build a new version of it' products using Java is ongoing for more than 6 years, and is seriously just around the corner.
Admin
Wait. Is Delphi case-sensitive?
Admin
breaking bad.
Admin
So flowing through all your case statements is good? Going through every element in your 100000 element array after finding your match at item 2 is good?
Admin
Delphi is a Pascal dialect. "Break" is not a standard Pascal keyword (neither ISO 7185 nor 10206). "Goto" is. To remain compatible, apparently Delphi does not implement "break" as a keyword, either.
Admin
Admin
Admin
Snoofle! You're back! Please go away again.
Admin
Though this is 1000 gimes better than anything you have ever written...
Admin
Well trolled. Got at least a few bites out of that obvious one!
Admin
Break and break are the same thing?
Case insensitive keywords are TRWTF.
Admin
Admin
And the rewrite will be done when Oliver T says it's done.
Admin
I lol'd!
Admin
Delphi is based on Borland's Object Pascal, which in turn is based on Pascal, as indicated above. The old WTF alluded to above is that Pascal procedure (function returning void) and function calls are written without () if the procedure/function has no formal parameters.
In C, C++, Java, C#, etc.:
In Pascal, Object Pascal, Delphi:The second WTF is that these lines of code are exactly equivalent in Pascal-like languages because they are not case-sensitive:
The third WTF is that the call to (apparently) system.break (procedure), also more 1337ly called sYstEm.bReAk (not case sensitive, remember?), somehow got mapped to a reference to the interface named Break.
The fourth WTF is calling an interface Break.
That's enough for me.
Admin
Not sure if you're joking or serious. Just in case that you are serious: the elegant solution would be to update the loops condition with "and element not found".
Why is this more elegant? Because if you don't use breaks, you have the guarantee that the negation of the condition holds. The code documents itself.
while(n < 50 and !eltFound) { //code without breaks } //guaranteed that (n >= 50 or eltFound)
Alternatively:
while(n < 50) { //code with breaks } //either n >= 50, or a break was called somewhere in the code that happens to be thousands of lines, because I'm making a point
Admin
Admin
Admin
[Cue "Yeaaaaaaaa!"]
Admin
Case sensitive keywords are TRWTF.
Admin
Optional parentheses are considered a useful feature in more than one language. Consider Person.Name() vs. Person.Name -- Being able to omit the parentheses in the latter form makes code less cluttered and easier on the eye. To the client, Name looks just like a public field of Person, it might be a field OR a method, and it can be seamlessly refactored from public field to accessor method without breaking client code. I'd call that a feature.
Not a WTF at all, it's just legacy. Borland (and successors) have always done a great job at maintaining backwards compatibility. Modern Delphi is still remarkably consistent despite having accumulated a ton of modern language features in a comparably sane way over the years. Case sensitivity is nice to have, but wasn't considered crucial back in the days.
Well, that's the point, as long as you don't understand the "somehow" in "somehow got mapped", how could you possibly judge? In Delphi, this depends on the order of compilation of units. Even if you had qualified all calls to Break as System.Break, the compiler would eventually have complained about your attempt to redefine the identifier "break" at some point. So yes, "somehow", in it's first linear pass, the compiler got confused about how to resolve a symbol. Never happens to any other compiler that gets fed ambiguous code, huh?
Well, it's still the only WTF here.
Admin
no IBreak-puns yet?
Admin
As a non-programmer (but an IT guy!) I don't get the hate for case insensitivity. What's the case for func() and Func() being different functions?
Admin
I don't think it's standard on every computer. Unix? MacOS? AIX? Solaris?
Admin
Admin
I would imagine that the case insensitivity was even thought to be a feature of the language since it's harder to implement than case sensitivity. That's how times change.
Admin
That's like deciding to lose weight by replacing your all-pizza diet with an all-calzone diet.
Admin
Case-sensitivity is the difference between searching your codebase for five minutes and searching it for three weeks.
Admin
Admin
Even VB has case sensitive keywords. It's just the IDE that corrects it for you, and if you don't use an editor that does, the compiler will do it as well.
Admin
If your loop is procedurally doing 1000s of lines of code, then you need to break up that code into method calls.
Admin
Wow -- a whole page of comments yet I'm the first to suggest that using Word is TRWTF?
Or maybe Word belongs to the sub-level of WTFs that's so horrible as to be beyond mention.
Admin
Working within constraints and requirements is part of the job.
If you can't manage that, then you're really just a hobbyist programmer, and not a professional.
Admin
Yep, company I was working for 3 years ago had a few legacy products (and their internal ERP system) in Delphi 5. Delphi is still used and is not a wtf at all. Plus the code I've seen in Delphi (and examples online) all seem to be much higher quality than the other possibilities (cough vb6 cough).
They were in the process of DLLizing the delphi stuff and calling it from .Net since .Net devs are easy to find and Delphi not so much (though it's such an easy language to learn and the ide is pretty usable despite its age). I don't ever remember running into any namespace issues with 3rd party code. I did run into issues with buggy 3rd party libraries, but that's par for the course.
I wouldn't choose to use Delphi if I were starting something, but definitely no point in scrapping something just because it's in delphi. The one downside was setting up a dev environment from scratch was time consuming (couple days iirc). Luckily the place I had to use it had images of working environments with all the 3rd party tools they used.
Admin
Or blow up on you. I crashed the compiler many times by qualifying things with System. (Ported code that had name conflicts.)
Admin