- 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
TRWTF is that everything defined in the meta-class is public, right?
Admin
And this is why so many people hate C++. Because some idiot shoots himself in the foot.
Admin
#define SHOOT_SELF_IN_FOOT(cout << "C++";)
Admin
You need to define an easy-to-read version of cout, << and "C++"
Admin
I particularly like the way that TAG_DEFINE_INTERFACE declares a class without defining it.
This is the result of someone trying to find a clever way to prevent people from creating mixed interface/implementation classes. That is, accidentally (or otherwise) adding a non-purevirtual function, or, godforbid, a variable to an interface class.
The intelligent way (note that there is a big difference between intelligent and clever!) is called a code review, but to be effective it requires people to be intelligent about how they review things. In the absence of that, the sole virtue of this is that it makes it more obvious to a reviewer that you have broken the rules of the game - a "correctly" defined interface consists entirely of TAG_... macro invokations (and some comments, I'd hope).
The correct solution, of course, is to hire better quality developers, but that will never catch on.
Admin
Admin
Consistent and fairly simple syntax for classes and members, you say?
Look, ma, no macros!
Admin
Reminds me of how the Microsoft Foundation Classes implemented message handling declarations... ;-)
Admin
You're talking about VC++, which though like C++ is also different from C++.
Admin
Who wouldn't want to write code like this?
Admin
TRWTF is not knowing how to run a preprocessor so that it only processes a certain subset of defined macros.
Oh wait. "Visual Studio". Of course "David Kaye" wouldn't know how to do that.
Admin
Not really. This is why so many people hate idiots claiming to be programmers and having absolutely no clue what they are doing
Admin
it reminds me of working for Cap/Sema Group in the 80's - they had a set of C macros called SPO (structured programming option) that tried to turn C into fortran something like this:
etc etc.
Admin
Or a Pascal programmer transitioning to C but can't quite let go
#define BEGIN { #define END }
Admin
Admin
C++ has simple syntax for classes, huh?
Hard to troll a site when the editors beat you to it.
But since the original designers decided to #define a meta-language in C++, and then use that meta-language to represent all of the key classes, his knowledge hardly came in handy.
Too bad his knowledge didn't include commenting out other includes and running his source through the preprocessor to strip out the stupid TAG_ stuff.
Admin
That WTF can be fixed with sed easily if you have it and know how to use it. Or a multi-line replace field in a search replace dialog box, if there is such a thing...
Admin
Any chance, that you work at my client location in Califirona?
Admin
Admin
No, languages like PHP and VB really do suck. People consistently write shit in them because they lend themselves to copypasta programming. If it weren't for those languages, the mass of those idiots wouldn't be programming at all.
The systems languages like Java and C++ require a certain amount of discipline to use, so while there are bad programmers, there are an order of magnitude fewer than with VB and PHP.
Even when I do see a C++ programmer shoot himself in the foot, I can at least see, "oh, this guy was trying to do that, too bad it didn't work." In a typical VB WTF, there's absolutely no thought process whatsoever, because that's the language you choose when you just want to throw code together and bash away until it sort of works.
Admin
But on-topic, C++ is an excellent example of what you were basically saying - that good langages can still be subverted by crap developers. Its main failing is giving the developer too much freedom but I don't see that as a bad thing, even if it does encourage the sort of rubbish in today's WTF.
Admin
A poor tool always blames its users.
If you believe in bad code, then believe in bad architecture. If you believe in bad architecture, believe in bad languages, which, after all, are high-level specifications for compilers, interpreters, or whatnot.
The map from how often a language gets uses verses how often it gets dumped on is ANYTHING but linear. Some languages really do suck more than others.
What are "language smells"? How about... Trying to wrap one view of the world (say, OO) around another (say, procedural). This is a major problem for C++, java, and python. How about... Making a language so flexible that you practically force people to be cutesy, like perl? How about... Trying to address radically different problem spaces with a single solution, like php?
Yes, the only languages that don't suck are the ones no one uses. That doesn't mean that the bad decision process which overflows the rest of human experience suddenly stops when people try to design a programming language.
Admin
Hey, you leave His Noodlyness out of this!
But seriously, PHP sucks for a lot of reasons, but one of the many reasons it sucks is because most of the community that's built up around it is one of web designers who think they're developers, not programmers who happen to write web applications. As a result, there are a lot of PHP folks out there who simply have no clue what makes code bad, only that it works and allows their site to look cook.
A great web designer is a great thing to have, but they need to be designing websites, not developing code, and definitely not designing a language.
Admin
Here's where I think there's something to be said for polyglot: use languages designed for a single purpose which follow standard conventions to solve specific problems. What I see too much of these days is J2EE-mindedness where we will try to build one system that will do EVERYTHING. Someone takes an open-source project for viewing pictures and try to integrate text-messaging into it.
Now I know that polyglot comes with its own set of WTFs, one of which is evident here in that people try to take the language and make it do something they've always done in another language and make it work the same way.
Admin
As someone who works with MFC, COM and ATL on a daily basis (I didn't say I enjoyed it), this seems fairly tame. Message maps, STDMETHODs and other preprocessor goodness really confuse the hell out of step-into debugging...
Admin
Christ on a bike man, that must have hurt pulling numbers like that out of your ass...
OR, it's that the level of most java devs is so low that one shitty programmer can't tell that another shitty programmers code is, well, shit.
Admin
How do you define a class in C++ again? Keyword "class", the class name, and a left curly-brace you say? Then you end with a right curly-brace and a semicolon? I'll never remember that. I'll just use the #defined meta-language. It's like writing code in a spoken language.
Yep, good old BEGIN_TAG_INTERFACE and END_TAG_INTERFACE, etc.; there's no way I can mess up using them.
Admin
Admin
Or Java is too enterprisey for concise entries in a blog post. Nobody wants to read a 1500 line WTF.
Admin
I agree with Java, but not C++ and Python. Both C++ and Python have good support for procedural solutions; they both strive to be multi-paradign languages. Python also has good support for functional solutions (and C++ is in the process of getting more functional support).
As an old C++ programmer (who has done a lot of OO, procedural, and generative), I must say the C# language annoys me greatly. Entirely OO with a bit of procedural and functional support, and no generative support at all...
Admin
pastifarian slip?
Admin
Fact #1: I love to program in C++.
Fact #2: I hate when other people program in C++.
Admin
I think the hiring of better, quality programmers (or employees in general) is usually purely by accident. I could be wrong.
Admin
TRWTF is that I'd have to actually hand code the class if I inherited from more than two other classes ;-)
Admin
Admin
Admin
QED by induction.
Admin
Way to get trolled, "The Corrector".
Admin
Of course generative support (macros) is a language smell in-and-of itself: It is an attempt to fix flaws in the language by allowing you to create rules for rewriting your code before compiling. If the language needs it then there is something wrong with the language. A couple of the big WTF's I've seen around Python were when I found that someone had implemented goto for python (April fool's joke, thankfully), and when someone implemented a preprocessor for it. If you think you need it, you are wrong and need to go back and study the language some more.
Admin
And...
Admin
"Oh my God!" </HankHill>
Admin
"VB doesn't intrinsically suck. Not VB.net at least. "
Please stop attempting to conflate VB and VB.net. They are two entirely different languages.
The biggest problem I've seen in this industry is people thinking that the only difference between VB and VB.net is ".net". The end result is always mountains of WTF.
Your comment is equivalent to saying "Paschal doesn't intrinsically suck. Not Fortran at least."
Admin
This smells of java programmers trying to program in C++.
Admin
And now you're going to try to tell me that Java and JavaScript are two different things? Pa-LEASE!
Admin
Don't get me wrong, they both suck donkey balls thanks to the crappy syntax, but they are worlds apart.
Admin
Nothing that some regexps can't fix?
Admin
Preprocessor #define statements! The cornerstone of every Java program.
Admin
Why stop there?
#define TAG_ADD(a,b) ((a) + (b)) #define TAG_SUB(a,b) ((a) - (b)) #define TAG_MUL(a,b) ((a) * (b)) #define TAG_DIV(a,b) ((a) / (b)) #define TAG_EXP(a,b) ((a) **(b)) #define TAG_TRUE 0 #define TAG_FALSE 1 #define TAG_FNF() FILE_NOT_FOUND // etc
Admin
Admin
#define TAG_ONE 1 #define TAG_TWO 2
...
#define TAG_TEN 10 #define TAG_ELEVEN 13 // 11 // SG: as per defect #43562