- 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 this clbuttic article has pages of spam in it from over the years that hasn't been cleared out, marring its simple glory.
Admin
That's what SHE said!
Admin
You want to see wailing and gnashing of teeth, Java programmers trying to work on embedded C. Especially ones that have become dependent on unit testing to wipe their butts.
Admin
Perhaps naming it as TAG_FORWARD_DEFINE_INTERFACE would have been more appropriate.
Admin
I just tested this in VS10 SP1 - Go To Def worked fine. Also, this really not that weird - the names are terrible (WTF does "TAG_" mean? That it's a macro? The ALL_YELLING_CAPS tells you that.) but it's practically the standard COM macros DEFINE_INTERFACE() and STDMETHOD() - usefull to make it as easy to do things the same way throughout. Also, semi-enforcing a standard naming for getter/setters is kind of nice. I would prefer something like this though:
#define interface struct ... #define DEFINE_PTR(iname) typedef std::shared_ptr<iname> iname##Ptr; #define DEFINE_CREATE(iname) iname##Ptr Create##iname()
interface IFoo : IBase { METHOD_(int, Foo(int a, int b)) GET_(int, Bar) GETSET_(int, Baz) };
DEFINE_PTR(IFoo); DEFINE_CREATE(IFoo);
The protected dtor is pretty useless, I've found.
Admin
What (in IT terms) is a generative language?
Admin
Why? Is their IQ too high to reach?
Admin
The proprocessor is the root of all evil (right next to premature optimisation).
That's why they don't have one in D, or C#.
Admin
I know from complaints from ISE developers that the preprocessor makes parsing C/C++ to implement things like code completion and on the fly syntax checking vastly harder than it has to be.
You can add header files to that as well. They're cruft from another era. I've seen a few old projects where programmer didn't use header files, instead they used #ifdef's to determine whether a source file was being included or compiled. They you can do that says it's not that hard of a problem to solve.
Admin
Admin
On a more serious note, this reminds me quite a lot of Component Object Model (COM)'s syntax to declare COM interfaces for C as well as C++...
You know, the DECLARE_INTERFACE and such... At least in this case it has an utility: The ability to use the same code in both languages.
Admin
ORLY? http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.71).aspx
Admin
This particular horror has at least one virtue: it can be erased with one pass in the IDE. Just write a script to extract these lines into their own #included files, run the preprocessor on those, then reincorporate them into the source files. Oh, then remove the macro definitions. A very satisfying day's work, I'd say.
Admin
Admin
No we only know each other online.
Admin
Admin
Yup, they're different: One allows you to build useful, usable enterprise-quality systems that do have slight ideosyncracies (e.g. not looking quite native on all platforms), but will run on any OS. The other requires you to install a Java VM. Any one will do, right, it's portable? But not that one. Actually, just this one. It'll run anywhere that VM's available though. Provided that's windows. Still doesn't look native, despite only running on one OS. Or support any of the futuristic built-in OS features like selecting items from combos/lists by typing and so forces you to use up/down to navigate.
</rant>Disclaimer: this is based mostly on experience of a Java-based source-control system.
Admin
Wow, this reminds me a lot of grade 2...
So this is what the comments are reduced to if there isn't a new article at 9:00AM? Don't get me wrong, boog and Nagesh both have a lot of stuff that you can make fun of, but this is just, wierd.
Admin
If you have a problem with premature optimisation, have a quiet word with your pharmacist, they usually stock something that can help you with this.
Admin
Admin
Admin
Admin
Admin
Admin
In case your not aware: After yesterday's incident i have passed. Again.
It has become quite addictive and disrupts my regular work for THE DAILY WTF.
So please kids: Don't try this at home!
Admin
Wow, it's like a system I'm working on where instead of just using the jQuery functions, we've re-defined all of the jQuery methods as "application library" functions specific to our application.
Thus, instead of just using $("#foo") we use appLib.findElement("foo"), which under the covers is defined as
appLib.findElement = function ( name ) { return $("#"+name").get(1) };
I can't help but notice that even if that's what I wanted, $("#foo").get(1) is less characters and more expressive than appLib.findElement("foo")
Because it's better to use non-standard ways of writing code that are longer to type than forcing your developers to learn an industry standard.
Admin
The one redeeming thing about this WTF is that it should be possible to purge it from the codebase in less than an hour with a few good regular expressions.
Dan.
Admin
Not really... I have few customers in California but I work far from there
Admin
if you're trying to be funny, i find that insult.
Admin
Because Lisp macros are so similar to C/C++ macros, eh?
Admin
OMG
I felt the Fear when i saw this one. OMFG.
Admin
I went for a week's training in PLC programming and never had to do it. Thank heaven. :)
Now I'm learning HTML and PHP. After years of C++, just throwing variables wherever I feel like in PHP seems really weird.
Admin
Nagesh n boog pls try catch your domestic exceptions indoors and keep it there.
Admin
Corollary: Once enough people start using one of these languages, the language will expand until it does suck.
Admin
C++ For Dummies was the first programming book I ever read. It's awful. Still brings back bad memories. C++ Without Fear, OTOH, was my second programming book. That one was good.
Admin
Admin
I don't think PHP is a bad language. It's great for small, simple, quick-and-dirty web pages. The problem comes when people try to use it to build large, complex applications.
A bicycle is a perfectly good means of transportation. It's cheap, easy to operate, easy to maintain, and relatively safe to trust to small children. Now if someone came along and decided that he needs a way to transport 100 people across the ocean, so hey, a bicycle is a good means of transportation!, let's weld 100 bicycles together, then, let's see, overinflate the tires until there's enough air in them so that this thing will float, then, etc. Such insane use of a bicycle would not make bicycles stupid, it would just make the person who tried to use them that way stupid.
Actually, I think that applies to a lot of the tools we have in IT today. When I worked for the military, some higher up noticed that the web is a great tool. So he made a rule that ALL new applications must be web based, and all existing applications must be converted to web applications. This resulted in such useful projects as building a web-based tool to simulate a network-shared hard drive. After millions of dollars of effort, we got a tool that gave us screens that looked a lot like an ordinary Windows directory display -- except that it had less effective security, lesser functionality (for example, you couldn't run a program by double-clicking it), was slower, and less reliable.* But it had the big advantage that it was web-based, and as we all know, web-based is better!
Admin
Admin
When someone first learns a new language, he tries to think in his old comfortable language. Then tries to warp the new language to the structure of the old language. If you let him get away with it, he will never learn the new language, let alone think in it, or design good code in it. I was on a project where all the JOVIAL programmers were using C++ for the first time, and the manager developed his own C++ coding standards that basically said: You aren't allowed to write any code that does anything different than what JOVIAL does. (However, these JOVIAL experts were used to using every possible arcane feature of JOVIAL you could possibly imagine).
Admin
This is not working on my end. No errors, No output.
Admin
Precisely this. PHP is a culture of abandoned and completely inconsistent interfaces in the STANDARD LIBRARY. It is the php.net search feature which enables the language to catch on, and then which further perpetuates often poorly written user functions shared in the comments of each function.
You know your language sucks balls when you have a function called mysql_escape_string and mysql_real_escape_string. Then there's the inconsistent naming which forces checking the manual every time you use a not-so-commonly used standard function:
stream_get_line readline disk_free_space diskfreespace is_object isset mcal_day_of_week jddayofweek set_error_handler setlocale
Admin
The language isn't good even on a small scale. I've had a few years working with it before jumping into the games industry.
It isn't that you cannot write clean and readable code in the language, it's just that the language fights you tooth and nail every step of the way and makes it very easy for new programmers to create balls of mud.
Admin
CodeSOD posts usually give me a good laugh.... but in this particular case it made me extremely sad :-(
Admin
#define END ;}
Since Pascal doesn't require the last statement in a block to end with a semicolon ;-)
Admin
frowns What does Passover have to do with any of this? I mean, it is getting near to that time of y...
...
Oh. Never mind!
Admin
This is one of the reasons I hate c++... #define . Absolutely annoying !