• (cs)

    Safe until String changes...

  • (cs) in reply to Maurits
    Maurits:
    Safe until String changes...

    Then you put a wrapper round that.

    (Implementation is left as an exercise for the reader.)

  • (unregistered)

    I guess its an object oriented approch for number to string conversion.

  • (unregistered)

    Well that looks like java sort of, except for the horrible naming conventions that any experiance java programmer would balk at... however, It can't be java, as you can't call a method (toString() in this case) on a primitive value.

    Now what kind of dumb-ass language adds methods to primitives?
    Really.. I want to know!

  • (cs) in reply to

    "Now what kind of dumb-ass language adds methods to primitives? Really.. I want to know!"

    A proper OO language. One in which everything is an object.

    For example, the language Ruby doesn't actually have a for() loop construct in the grammar. Instead, it uses a method:

    1.upto(3) { ... loop body here ... }

    Here, the number 1 executes an iteration method upto(), and for each iteration in turn, executes the code between the braces.

    You can design your own methods to do your own iteration and attach them to the primitives, so you could, for instance, do a variation of that that started each iteration of the loop body in a different thread.

    Compared to such languages, Java could be considered dumbass, since although all methods may be object methods, not all values are objects, which leads to the boxing/unboxing hassles, and also to methods that end up being attached to other types to overcome this lack.)

    (C++, being what it is, is not, and could never be, a pure OO language. And it's the better for that, though there are things that are easy in Ruby that are a real pain in C++. There's no perfect language yet, and there probably never will be one.)

  • (unregistered) in reply to Maurits

    Safe until IntWrapper itself changes...

    Maybe this guy should simply add additional wrapper classes. So his doctor can eventually write "Stack overflow" on his death certificate...

  • (cs)

    Pedantically, the implementation is always changing; it's the API that's important.

    I don't believe I've ever seen the p_ prefix before. What is it? Prefix? Postfix? PimplyWallflower?

  • (cs) in reply to foxyshadis
    foxyshadis:
    Pedantically, the implementation is always changing; it's the API that's important.

    I don't believe I've ever seen the p_ prefix before. What is it? Prefix? Postfix? PimplyWallflower?

    I'm guessing 'parameter'. Looks like the author has a bad case of Hungarian notation.

  • (unregistered) in reply to foxyshadis

    foxyshadis:
    I don't believe I've ever seen the p_ prefix before. What is it? Prefix? Postfix? PimplyWallflower?

    I have growing suspicion that it's the same guy I inherited my current project from. It's code full of WTF's like that and almost each of them uses irritating <FONT face="Courier New">p_</FONT> prefix for parameters!.

  • (cs) in reply to foxyshadis

    foxyshadis:

    I don't believe I've ever seen the p_ prefix before. What is it? Prefix? Postfix? PimplyWallflower?

     

    The p_ is for pedantic [:P]

  • (unregistered)

    I hate to burst y'alls WTF bubble, but they could have had a valid reason to make this class in ONE and only one circumstance. If they had to convert integers to strings many times over, and they were the same few integers. This class would be a simple way to cache that conversion.

    But then one would have to ask what the higher-level WTF is that necessitates all those string conversions in time-critical code.

  • (unregistered) in reply to
    :
    Well that looks like java sort of, except for the horrible naming conventions that any experiance java programmer would balk at... however, It *can't* be java, as you can't call a method (toString() in this case) on a primitive value.

    Now what kind of dumb-ass language adds methods to primitives?
    Really.. I want to know!

    It's probably C#

  • (unregistered)

    I think the programmer of this class forgot to use his StringWrapper in this class...

    If the implementation of String changes then he will have to go through every wrapper classes to adapt to the new changes to the String class...

  • DonaldK (unregistered) in reply to Bellinghman
    Bellinghman:
    I'm guessing 'parameter'. Looks like the author has a bad case of Hungarian notation.

    Yup, it's gotta be parameter.

    You get m_ also for MEMBER variables...

    Blegggg.

    CAPTCHA: incassum ... incase someone wonders...

Leave a comment on “Wrapping up the IntWrapper”

Log In or post as a guest

Replying to comment #:

« Return to Article