• (cs) in reply to boog
    boog:
    Vacaloca:
    Or Java is too enterprisey for concise entries in a blog post.
    Bullshit.

    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.

  • (cs) in reply to Nagesh
    Nagesh:
    Rajendra Kumar:
    snoofle:
    #define TAG_EXP(a,b) ((a) **(b))

    Dear Colleague,

    I am needing of the header file to include to overload double pointer indirection operation to perform exponent calculation. Can you send this plz?

    Sinceerely, Your friend, Rajendra Kumar

    Your stick is getting old.

    That's what SHE said!

  • Gibbon1 (unregistered) in reply to delta534
    delta534:
    This smells of java programmers trying to program in C++.

    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.

  • Amadeus Schubelgruber (unregistered) in reply to Steve The Cynic

    Perhaps naming it as TAG_FORWARD_DEFINE_INTERFACE would have been more appropriate.

  • Simon Buchan (unregistered)

    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.

  • Jim Blurry (unregistered) in reply to Stephen Cleary
    Stephen Cleary:
    An Old Hacker:
    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.

    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...

    What (in IT terms) is a generative language?

  • IQ141 (unregistered) in reply to ih8u
    ih8u:
    EatenByAGrue:
    Sobriquet:
    No, languages like PHP and VB really do suck. People consistently write shit in them because they lend themselves to copypasta programming.

    ... 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 ...

    That's the ... problem, I guess. I mean, maybe these languages have a place.

    It's nice to know that there are languages that, for the most part, attract all the coding flies. Sure, programmers sometimes use them too, but the "hey I need help in PHP/VB" post (usually) tells us we're dealing with someone who CAN'T count to his IQ.

    The other way to tell is when they insert lolcat speak in their posts.

    Why? Is their IQ too high to reach?

  • iMalc (unregistered)

    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#.

  • Gibbon1 (unregistered) in reply to iMalc
    iMalc:
    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#.

    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.

  • r3zn1k (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    #define TAG_ELEVEN 13 // 11 // SG: as per defect #43562
    :D
  • Medinoc (unregistered)

    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.

  • English Man (unregistered) in reply to iMalc
    iMalc:
    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#.

    ORLY? http://msdn.microsoft.com/en-us/library/ed8yd1ha(v=vs.71).aspx

  • Beta (unregistered)

    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.

  • trwtf (unregistered) in reply to Beta
    Beta:
    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.
    You should try decorating, you'd enjoy watching the paint dry.
  • (cs) in reply to нагеш
    нагеш:
    Nagesh:
    boog:
    Nagesh:
    In our shop 8 out of 10 project use some java. 1 use Powerbuilder / D2K / VB 6 etc and 1 use .NET language.

    We like to hire people who have all round vision.

    Who cares?

    booger, If you don't care, stop saying it loudly. It disturb my flow of thoughts. As is trying to translate all these symbols and letter is playing short-circuit with my brain cells.

    Why do you call him booger? Are you both dating or something?

    No we only know each other online.

  • Could it be love? (unregistered) in reply to Nagesh
    Nagesh:
    нагеш:
    Nagesh:
    boog:
    Nagesh:
    In our shop 8 out of 10 project use some java. 1 use Powerbuilder / D2K / VB 6 etc and 1 use .NET language.

    We like to hire people who have all round vision.

    Who cares?

    booger, If you don't care, stop saying it loudly. It disturb my flow of thoughts. As is trying to translate all these symbols and letter is playing short-circuit with my brain cells.

    Why do you call him booger? Are you both dating or something?

    No we only know each other online.

    I do believe I detected a hint of sadness in that reply. Don't worry Nagesh, I'm sure you'll meet your boogie-woogie one day.

  • foo (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    And now you're going to try to tell me that Java and JavaScript are two different things? Pa-LEASE!

    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.

  • C-Octothorpe (unregistered) in reply to Could it be love?
    Could it be love?:
    Nagesh:
    нагеш:
    Nagesh:
    boog:
    Nagesh:
    In our shop 8 out of 10 project use some java. 1 use Powerbuilder / D2K / VB 6 etc and 1 use .NET language.

    We like to hire people who have all round vision.

    Who cares?

    booger, If you don't care, stop saying it loudly. It disturb my flow of thoughts. As is trying to translate all these symbols and letter is playing short-circuit with my brain cells.

    Why do you call him booger? Are you both dating or something?

    No we only know each other online.

    I do believe I detected a hint of sadness in that reply. Don't worry Nagesh, I'm sure you'll meet your boogie-woogie one day.

    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.

  • foo (unregistered) in reply to iMalc
    iMalc:
    The proprocessor is the root of all evil (right next to premature optimisation).

    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.

  • boog (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    So this is what the comments are reduced to if there isn't a new article at 9:00AM?
    Yes, it is. Don't blame us: blame the maintainers of this dump. I'm pretty sure I strangle the penguin every day that theirs not an article on time.
  • (cs) in reply to нагеш
    нагеш:
    Nagesh:
    boog:
    Who cares?

    booger, If you don't care, stop saying it loudly.

    Why do you call him booger? Are you both dating or something?
    No, I never date trolls.

  • foo (unregistered) in reply to boog
    boog:
    I'm pretty sure I strangle the penguin every day
    Do you have a problem with premature optimisation too
  • (cs) in reply to Nagesh
    Nagesh:
    нагеш:
    Nagesh:
    booger, If you don't care, stop saying it loudly.
    Why do you call him booger? Are you both dating or something?

    No we only know each other online.

    Who are you again?

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    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?

    Correct. Comments are typically around grade 3, but with no article they reduce to grade 2.

  • Alex Papadimoulis (unregistered)

    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!

  • Adam Ness (unregistered) in reply to Steve The Cynic

    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.

  • (cs)

    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.

  • Nick (unregistered) in reply to Nagesh
    Any chance, that you work at my client location in Califirona?

    Not really... I have few customers in California but I work far from there

  • (cs) in reply to Could it be love?
    Could it be love?:
    Nagesh:
    нагеш:
    Nagesh:
    boog:
    Nagesh:
    In our shop 8 out of 10 project use some java. 1 use Powerbuilder / D2K / VB 6 etc and 1 use .NET language.

    We like to hire people who have all round vision.

    Who cares?

    booger, If you don't care, stop saying it loudly. It disturb my flow of thoughts. As is trying to translate all these symbols and letter is playing short-circuit with my brain cells.

    Why do you call him booger? Are you both dating or something?

    No we only know each other online.

    I do believe I detected a hint of sadness in that reply. Don't worry Nagesh, I'm sure you'll meet your boogie-woogie one day.

    if you're trying to be funny, i find that insult.

  • Lithper (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    Shh! Careful saying something like that! There might be Lispers around!

    Because Lisp macros are so similar to C/C++ macros, eh?

  • e john (unregistered)

    OMG

    I felt the Fear when i saw this one. OMFG.

  • The Great Lobachevsky (unregistered) in reply to m

    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.

  • (cs) in reply to Nagesh

    Nagesh n boog pls try catch your domestic exceptions indoors and keep it there.

  • Jeremy Friesner (unregistered) in reply to An Old Hacker
    An Old Hacker:
    Yes, the only languages that don't suck are the ones no one uses.

    Corollary: Once enough people start using one of these languages, the language will expand until it does suck.

  • Skilldrick (unregistered)

    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.

  • Jordan (unregistered)
    g++ -E
    anyone?
  • Jay (unregistered)

    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!

    • At one meeting a big boss said that they were planning a series of exercises to simulate failures of various systems and we were supposed to figure out how to get them back up and how to work around the problems in the interim. One of the systems that they were going to simulate the failure of was the web-simulated network drive. So I said, "We don't need to simulate that. We conduct that exercise every day." Everyone in the room laughed. Everyone knew that the system was useless except upper management.
  • Anonymous (unregistered) in reply to Jay
    Jay:
    I don't think PHP is a bad language. It's great for small, simple, quick-and-dirty web pages.
    Agreed 100%, after all that was the exact purpose of the language ("Personal Home Page" - says it all). Unfortunately, the fact that it doesn't adequately scale beyond "personal" seems to be entirely lost on those people that try to apply it to complex applications.
  • neveralull (unregistered)

    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).

  • anonymous (unregistered) in reply to Oxyd

    This is not working on my end. No errors, No output.

    Oxyd:
    Consistent and fairly simple syntax for classes and members, you say?
    #include <iostream>
    
    void typedef fun() const;
    volatile typedef int const var;
    
    const struct {
      fun f;
      var v;
    } typedef foo;
    
    void foo::f() const {
      std::cout << v << '\n';
    }
    
    int main() {
      foo f = { 42 };
      f.f();
    }

    Look, ma, no macros!

  • Michael Hamilton (unregistered) in reply to EatenByAGrue
    EatenByAGrue:
    Sobriquet:
    No, languages like PHP and VB really do suck. People consistently write shit in them because they lend themselves to copypasta programming.

    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.

    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

  • Michael Hamilton (unregistered) in reply to Anonymous

    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.

  • Daniele Muscetta (unregistered)

    CodeSOD posts usually give me a good laugh.... but in this particular case it made me extremely sad :-(

  • Neil (unregistered) in reply to JohnO
    JohnO:
    Or a Pascal programmer transitioning to C but can't quite let go

    #define BEGIN { #define END }

    Needs to be

    #define END ;}

    Since Pascal doesn't require the last statement in a block to end with a semicolon ;-)

  • Gordon Schumacher (unregistered) in reply to Jellineck

    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!

  • Anonymous (unregistered)

    This is one of the reasons I hate c++... #define . Absolutely annoying !

Leave a comment on “TAG++”

Log In or post as a guest

Replying to comment #:

« Return to Article