• Tzafrir Cohen (unregistered)

    So, why not just go and replace all of those macros? Simple sed -i (or perl -ip, or whatever tool you like).

  • Mike (unregistered)

    Don't use macros in C++. Don't use the OFFSET_OF() trick. Don't try to beat the compiler's ability to inline. Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things. C++ code can be almost as clean as Java or C# tend to be if you don't litter your code with crap.

  • C-Octothorpe (unregistered) in reply to Tzafrir Cohen
    Tzafrir Cohen:
    So, why not just go and replace all of those macros? Simple sed -i (or perl -ip, or whatever tool you like).

    I don't think he was posting to TDWTF to get tips on how to resolve said ball of yarn. I believe he was attempting to illustrate the misjuided attempt of his predecessor(s) at a design pattern (of which my personal fave is the foreach-switch pattern).

    I'm sure a CTRL-A, SHIFT-DELETE at the root application folder would also suffice, but then again this may be a little extreme.

  • Rajendra Kumar (unregistered) in reply to snoofle
    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

  • C-Octothorpe (unregistered) in reply to Rajendra Kumar
    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

    Wow, Nagesh's boss is posting here too...

  • (cs) in reply to Jellineck
    Jellineck:
    Your comment is equivalent to saying "Paschal doesn't intrinsically suck. Not Fortran at least."

    Paschal: adj. Having to do with the Jewish festival of Passover. (Maybe you meant "Pascal"?)

  • (cs) in reply to airdrik
    airdrik:
    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.

    Shh! Careful saying something like that! There might be Lispers around!

  • OldCoder (unregistered) in reply to Mike
    Mike:
    Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things. C++ code can be almost as clean as Java or C# tend to be if you don't litter your code with crap.
    Except that sometimes you need the same source (== the logic) compiled for more than one platform, whether that be 32bit/64bit or different processors (or whatever). For that you absolutely need to use #if and #ifdef blocks.
  • Not a lisper, honest. (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    airdrik:
    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.

    Shh! Careful saying something like that! There might be Lispers around!

    On a related note, Haskell has a semi-macro language in the form of template-haskell, but it's a bit closer to reflection than a macro in that it's fully typed and must pass type checking at compile time relative to the rest of the code. The compile process basically goes Template-Haskell + Haskell to Haskell to Object to Linked Binary. The nice thing is that if it passes the first step it's pretty much guaranteed to pass the second one. The idea behind TH isn't to fix any particular shortcoming of the language, but to allow you to eliminate as much boilerplate code as possible by encapsulating it all inside of functions that get evaluated at compile time.

  • (cs) in reply to Mike
    Mike:
    Don't use macros in C++. Don't try to beat the compiler's ability to inline. Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things.

    Macros can be good. Although I would like to get rid of them other ways, here's a pattern I keep hitting: suppose you have a polymorphic data type (say, a string from an XML file) that needed to be processed by a templated function (templated by its type). Assume for a second that getting the type as an enum is easy. The best way I can figure out how to call the appropriate function is with a switch. Since the same logic appears with the same enum type in different places (with different function calls), macroing that switch seems to be the best solution.

    Please tell me I've been doing it wrong, and I will gladly refactor my code.

    Sometimes, just sometimes, I know better than the compiler when it comes to inlining.

    #if/#ifdefs can be useful for a few features (how else do you handle cross-platform issues when it's a 3 line change in a larger class?) Or turning off sections of the code as a debugging technique. Or maybe you're familiar with the #ifdef _DEBUG used for asserts?

  • (cs) in reply to Mike
    Mike:
    Don't use macros in C++. Don't try to beat the compiler's ability to inline. Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things.

    Macros can be good. Although I would like to get rid of them other ways, here's a pattern I keep hitting: suppose you have a polymorphic data type (say, a string from an XML file) that needed to be processed by a templated function (templated by its type). Assume for a second that getting the type as an enum is easy. The best way I can figure out how to call the appropriate function is with a switch. Since the same logic appears with the same enum type in different places (with different function calls), macroing that switch seems to be the best solution.

    Please tell me I've been doing it wrong, and I will gladly refactor my code.

    Sometimes, just sometimes, I know better than the compiler when it comes to inlining.

    #if/#ifdefs can be useful for a few features (how else do you handle cross-platform issues when it's a 3 line change in a larger class?) Or turning off sections of the code as a debugging technique. Or maybe you're familiar with the #ifdef _DEBUG used for asserts?

  • (cs) in reply to Jules Winnfield

    No, it was the fact that they were trying to implement java interfaces through macros.

  • (cs) in reply to Vacaloca
    Vacaloca:
    Anonymous:
    Sudo:
    Anonymous Coward:
    And this is why so many people hate C++. Because some idiot shoots himself in the foot.
    It's why any language can be considered a WTF really.... how many times here have we heard "TRWTF is php/VB/Java" etc.? The root cause is always the same - bad programmers, not bad languages.
    Funny, though, recurrence follows a bell curve distribution...with VB at the apex and Java near the bottom. This is especially important, seeing at Java makes up 75% of software development being done today but less than 10% of the wtfs.

    Or Java is too enterprisey for concise entries in a blog post. Nobody wants to read a 1500 line WTF.

    This.

  • ih8u (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.

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

  • C-Octothorpe (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.

    Who can't count to 10?

    kthkbai

  • (cs) in reply to Mason Wheeler
    Mason Wheeler:
    airdrik:
    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.

    Shh! Careful saying something like that! There might be Lispers around!

    I didn't think we had any smug Lisp weenies here.

  • frits (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    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.

    Who hasn't counted to 10?

    kthxbai

    FTFY Man, you really screwed that up.

  • (cs) in reply to Not a lisper, honest.
    Not a lisper:
    Mason Wheeler:
    airdrik:
    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.

    Shh! Careful saying something like that! There might be Lispers around!

    On a related note, Haskell has a semi-macro language in the form of template-haskell, but it's a bit closer to reflection than a macro in that it's fully typed and must pass type checking at compile time relative to the rest of the code. The compile process basically goes Template-Haskell + Haskell to Haskell to Object to Linked Binary. The nice thing is that if it passes the first step it's pretty much guaranteed to pass the second one. The idea behind TH isn't to fix any particular shortcoming of the language, but to allow you to eliminate as much boilerplate code as possible by encapsulating it all inside of functions that get evaluated at compile time.

    If you have to type boilerplate code at all, then the language has failed you. This particular weakness - found in most languages (except maybe Lisp) - is called "lack of expressiveness".

  • (cs) in reply to Capt. Obvious

    What about using an abstract factory so that you only need one switch?

  • (cs) in reply to Vacaloca
    Vacaloca:
    Or Java is too enterprisey for concise entries in a blog post.
    Bullshit.
  • C-Octothorpe (unregistered) in reply to frits
    frits:
    C-Octothorpe:
    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.

    Who hasn't counted to 10?

    kthxbai

    FTFY Man, you really screwed that up.

    Wow, I guess I need to focus on what matters and really brush up on my lolcat speak...

    I think I'll just leave the (un?)intentional buffoonery to the fictitious frits.

  • (cs) in reply to hoodaticus
    hoodaticus:
    If you have to type boilerplate code at all, then the language has failed you. This particular weakness - found in most languages (except maybe Lisp) - is called "lack of expressiveness".

    Define "have to type" in this context. I write in Delphi, and I can get the IDE to fill in most of the boilerplate automatically for me. Does that count?

    FWIW I don't consider having code with a familiar, predictable structure ("boilerplate") a failing of the language; I see it as a readability aid. If every single expression in your program is unique, as the Cult of Paul Graham seems to believe is the ideal state of source code, how are you supposed to be able to become familiar with it, seeing as how the human brain is first and foremost a pattern-matching engine?

    Considered in conjunction with the fact that the great majority of coding time for any serious program these days is spent in maintenance and not in initial development, and it's hard to escape the conclusion that an exceptionally high degree of "expressiveness" (again, as defined by Paul Graham) is, objectively speaking, a negative language feature, not a positive one.

  • Hater (unregistered)

    All programming languages are garbage. Deal with it.

  • (cs) in reply to Hater
    Hater:
    All programming languages are garbage. Deal with it.
    Well said.
  • Design Pattern (unregistered) in reply to frits
    frits:
    C-Octothorpe:
    kthxbai
    FTFY Man, you really screwed that up.
    Just for the notice: The correct LOLCODE keyword is KTHXBYE:
    HAI
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!"
    KTHXBYE
    
  • frits' deadpan face (unregistered) in reply to Design Pattern
    Design Pattern:
    frits:
    C-Octothorpe:
    kthxbai
    FTFY Man, you really screwed that up.
    Just for the notice: The correct LOLCODE keyword is KTHXBYE:
    HAI
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!"
    KTHXBYE
    

    Oh yeah, LOLCODE. Hilarious.

  • Optimus Dime (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    hoodaticus:
    If you have to type boilerplate code at all, then the language has failed you. This particular weakness - found in most languages (except maybe Lisp) - is called "lack of expressiveness".

    Define "have to type" in this context. I write in Delphi, and I can get the IDE to fill in most of the boilerplate automatically for me. Does that count?

    FWIW I don't consider having code with a familiar, predictable structure ("boilerplate") a failing of the language; I see it as a readability aid. If every single expression in your program is unique, as the Cult of Paul Graham seems to believe is the ideal state of source code, how are you supposed to be able to become familiar with it, seeing as how the human brain is first and foremost a pattern-matching engine?

    Considered in conjunction with the fact that the great majority of coding time for any serious program these days is spent in maintenance and not in initial development, and it's hard to escape the conclusion that an exceptionally high degree of "expressiveness" (again, as defined by Paul Graham) is, objectively speaking, a negative language feature, not a positive one.

    Also, does repeating the ( and ) character count as boilerplate?

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

    I don't know if no-code counts as a code-related WTF...

    Sitting around doing nothing other than watching pr0n for 6 months is (technically) a WTF however this can be achieved on any platform or language.

  • airdrik (unregistered) in reply to Optimus Dime
    Optimus Dime:
    Mason Wheeler:
    hoodaticus:
    If you have to type boilerplate code at all, then the language has failed you. This particular weakness - found in most languages (except maybe Lisp) - is called "lack of expressiveness".

    Define "have to type" in this context. I write in Delphi, and I can get the IDE to fill in most of the boilerplate automatically for me. Does that count?

    FWIW I don't consider having code with a familiar, predictable structure ("boilerplate") a failing of the language; I see it as a readability aid. If every single expression in your program is unique, as the Cult of Paul Graham seems to believe is the ideal state of source code, how are you supposed to be able to become familiar with it, seeing as how the human brain is first and foremost a pattern-matching engine?

    Considered in conjunction with the fact that the great majority of coding time for any serious program these days is spent in maintenance and not in initial development, and it's hard to escape the conclusion that an exceptionally high degree of "expressiveness" (again, as defined by Paul Graham) is, objectively speaking, a negative language feature, not a positive one.

    Also, does repeating the ( and ) character count as boilerplate?

    I think that if you are repeating lines statements, that's one thing (call this method with these parameters to set up the database connection and get back a connection object). If you have have to copy-paste more than a couple of lines then it is probably boilerplate which can be refactored.

    If you are thinking something along the lines of: I should put this in a macro so I don't have to do all of this stuff every time; that's a sign that a refactor is due (and no, adding a macro is not the answer)

  • (cs)

    Looks like code written by a Pascal or Delphi developer...

    Anyone else here play Space Empires V? The scripting language looks like some horrible bastardization of Pascal... I don't remember the exact syntax but it looks something like this:

    deffunc addten params xyzzy: integer endparams vars retval: long endvars returns long begin set retval := call Sys_Exec_Gratuitously_Long_Function_Name_Which_Converts_Integers_To_Reals_In_SPAAAAAAACE xyzzy return retval call Do_Other_Stuff_After_We_Return_Yes_This_Is_Possible_OMG end enddeffunc

  • (cs) in reply to ekolis
    ekolis:
    Looks like code written by a Pascal or Delphi developer...

    Anyone else here play Space Empires V? The scripting language looks like some horrible bastardization of Pascal... I don't remember the exact syntax but it looks something like this:

    deffunc addten
    params
     xyzzy: integer
    endparams
    vars
     retval: long
    endvars
    returns long
    begin
     set retval := call Sys_Exec_Gratuitously_Long_Function_Name_Which_Converts_Integers_To_Reals_In_SPAAAAAAACE xyzzy
     return retval
     call Do_Other_Stuff_After_We_Return_Yes_This_Is_Possible_OMG
    end
    enddeffunc

    Ouch! Looks like someone trying to copy Pascal but they were more comfortable with BASIC. Or... something.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Anonymous:
    Sudo:
    Anonymous Coward:
    And this is why so many people hate C++. Because some idiot shoots himself in the foot.
    It's why any language can be considered a WTF really.... how many times here have we heard "TRWTF is php/VB/Java" etc.? The root cause is always the same - bad programmers, not bad languages.
    Funny, though, recurrence follows a bell curve distribution...with VB at the apex and Java near the bottom. This is especially important, seeing at Java makes up 75% of software development being done today but less than 10% of the wtfs.

    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.

    He may be right. 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.

  • (cs) in reply to Rajendra Kumar
    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. You are doing that since calendar code you ask many many ages ago.

  • C-Octothorpe (unregistered) in reply to Nagesh
    Nagesh:
    C-Octothorpe:
    Anonymous:
    Sudo:
    Anonymous Coward:
    And this is why so many people hate C++. Because some idiot shoots himself in the foot.
    It's why any language can be considered a WTF really.... how many times here have we heard "TRWTF is php/VB/Java" etc.? The root cause is always the same - bad programmers, not bad languages.
    Funny, though, recurrence follows a bell curve distribution...with VB at the apex and Java near the bottom. This is especially important, seeing at Java makes up 75% of software development being done today but less than 10% of the wtfs.

    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.

    He may be right. 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.

    Speechless... Just, speechless...

  • drusi (unregistered)

    David Kaye is one of the best names I've seen on this site, yeeees.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    boog:
    Vacaloca:
    Or Java is too enterprisey for concise entries in a blog post.
    Bullshit.
    I don't know if no-code counts as a code-related WTF...
    Garsh! You may be right!

    If only my post was meant to indicate that, contrary to Vacaloca's theory, there have been many code-related Java WTFs on this site, concise or otherwise.

    Of course, each of these WTFs was due to the programmer being a total halfwit, and not failings of the language. But I don't suppose anyone can look past the real reason that crap code exists when they have the chance to bash languages that they personally don't like.

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

  • (cs) in reply to boog
    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.

  • NutDriverLefty (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    Anonymous Coward:
    And this is why so many people hate C++. Because some idiot shoots himself in the foot.
    No, it is because in the process he manages to shoot us in the foot as well.

    Stroustrop said it best: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."

  • UR MOM'S FISHTANK (unregistered) 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. You are doing that since calendar code you ask many many ages ago.

    This coming from a fake indian who isn't funny at all, and reuses 10 year old trolling techniques. Your schtick was old before you were even old enough for grade school.

  • (cs)

    I don't get it. Why do people treat what language you (primarily/exclusively) use like it's some religious trait worthy of a declaration of war? Are we not all telling some machine to do something?

    The people who think web development isn't serious programming are just trolling out the wazoo. They're probably kernel developers, which, as we all known, is very serious. Indeed, kernel developers aren't allowed to even look at code written in a language besides C or assembly lest they be tainted by the sin of OO or functional programming like some 50-year old nun whose hand touches the cashier's while buying lamp oil at the market.

    After all, if you've never committed an accepted patch to the linux kernel, errrrrrr, have your changes merged to the trunk of the kernel's git repo, you're not a real developer. So why bother talking about the differences between languages if you're not even a real developer?

  • (cs) in reply to Power Troll
    Power Troll:
    I don't get it. Why do people treat what language you (primarily/exclusively) use like it's some religious trait worthy of a declaration of war? Are we not all telling some machine to do something?

    The people who think web development isn't serious programming are just trolling out the wazoo. They're probably kernel developers, which, as we all known, is very serious. Indeed, kernel developers aren't allowed to even look at code written in a language besides C or assembly lest they be tainted by the sin of OO or functional programming like some 50-year old nun whose hand touches the cashier's while buying lamp oil at the market.

    After all, if you've never committed an accepted patch to the linux kernel, errrrrrr, have your changes merged to the trunk of the kernel's git repo, you're not a real developer. So why bother talking about the differences between languages if you're not even a real developer?

    It's just a bunch of babies who think programming is hard.

  • нагеш (unregistered) in reply to 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?

  • SomeYoungGuy (unregistered) in reply to boog
    boog:
    Hater:
    All programming languages are garbage. Deal with it.
    Well said.

    Here here!

  • Fred (unregistered) in reply to Sobriquet
    Sobriquet:
    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.
    I thought there was a language designed specifically for that purpose, which is why it was named... bash.
  • Simon (unregistered) in reply to delta534
    delta534:
    This smells of java programmers trying to program in C++.

    Not especially. You're right, the macros seem to be trying for something like a Java interface, but the whole macro thing would be completely alien to any Java programmer. No preprocessor directives in that language, and the syntax used is totally alien.

  • English Man (unregistered) in reply to Mike
    Mike:
    Don't use macros in C++. Don't use the OFFSET_OF() trick. Don't try to beat the compiler's ability to inline. Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things. C++ code can be almost as clean as Java or C# tend to be if you don't litter your code with crap.
    The preprocessor is PART OF C++. Used properly it is powerful and makes code cleaner. Making your C++ code look like Java doesn't mean it's the best way to do it in C++. Not to mention cross-platform code and such things require #ifdef blocks
  • (cs) in reply to English Man
    English Man:
    Mike:
    Don't use macros in C++. Don't use the OFFSET_OF() trick. Don't try to beat the compiler's ability to inline. Don't sprinkle your code with #ifs and #ifdefs. Learn the ways to avoid these things. C++ code can be almost as clean as Java or C# tend to be if you don't litter your code with crap.
    The preprocessor is PART OF C++. Used properly it is powerful and makes code cleaner. Making your C++ code look like Java doesn't mean it's the best way to do it in C++. Not to mention cross-platform code and such things require #ifdef blocks
    You don't need to worry about cross-platform when you have the java virtual machine, oh wait ...
  • m (unregistered) in reply to ekolis
    ekolis:
    deffunc addten params xyzzy: integer endparams vars retval: long endvars returns long begin set retval := call Sys_Exec_Gratuitously_Long_Function_Name_Which_Converts_Integers_To_Reals_In_SPAAAAAAACE xyzzy return retval call Do_Other_Stuff_After_We_Return_Yes_This_Is_Possible_OMG end enddeffunc
    this looks like a IEC 61131-3 IL function—until “begin”. The rest looks like paradise, if you thought about IL before.
  • (cs) in reply to EatenByAGrue
    EatenByAGrue:
    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.
    To me, PHP sucks because its standard library sucks. There is no rhyme no reason for function names, functionality (or lack thereof), or order of arguments. Standard library for OCaml sucks just a bit less, unfortunately for this nice language.

Leave a comment on “TAG++”

Log In or post as a guest

Replying to comment #:

« Return to Article