Make a decision already



  • Just found this, with each of the different declarations of theItem made about 2 weeks apart:

      class TheClass<T> {
    private T theItem;
    public TheClass(T t) { setItem(t); }
    public T getItem() { return theItem; }
    public void setItem(T t) { theItem = t; }
    // ...
    }
    // ...
    //private TheClass<Integer> theItem = new TheClass<Integer>();
    //private TheClass<Long> theItem = new TheClass<Long>();
    //private TheClass<Double> theItem = new TheClass<Double>();
    private TheClass<String> theItem = new TheClass<String>();


  • @snoofle said:

    Just found this, with each of the different declarations of theItem made about 2 weeks apart:

      class TheClass<T> {
    private T theItem;
    public TheClass(T t) { setItem(t); }
    public T getItem() { return theItem; }
    public void setItem(T t) { theItem = t; }
    // ...
    }
    // ...
    //private TheClass<Integer> theItem = new TheClass<Integer>();
    //private TheClass<Long> theItem = new TheClass<Long>();
    //private TheClass<Double> theItem = new TheClass<Double>();
    private TheClass<String> theItem = new TheClass<String>();

    The last person got it right. Strings are much easier to work with as arbitrary width numeric values.



  • This would not have been an issue at my company. We default everything to strings.


  • Considered Harmful

    Have to love comments for code history. Who needs fancy schmancy source control anyway?

    Actually, I see it a lot around here. Developers don't seem to trust the revision history and think the code will be "lost" somehow.



  • @joe.edwards said:

    Developers don't seem to trust the revision history and think the code will be "lost" somehow.

    Maybe they use git. Ziing!



  • // Fuck it, I'm off with stupid String because generics are too hard.



  • @blakeyrat said:

    @joe.edwards said:
    Developers don't seem to trust the revision history and think the code will be "lost" somehow.

    Maybe they use git. Ziing!

    git out



  • Just wow...

    How many 8's of uptime do they guarantee?



  • @that really other guy said:

    Just wow...

    How many 8's of uptime do they guarantee?

     

    I heard they offer nine fives.



  • @drurowin said:

    @that really other guy said:

    Just wow...

    How many 8's of uptime do they guarantee?

     

    I heard they offer nine fives.

    Oh, it's five nines, just with a lot of ambiguity over where the decimal goes.



  • @morbiuswilters said:

    @drurowin said:

    @that really other guy said:

    Just wow...

    How many 8's of uptime do they guarantee?

     

    I heard they offer nine fives.

    Oh, it's five nines, just with a lot of ambiguity over where the decimal goes.


    No there isn't

    It's a 5.55555555% uptime guarantee.


  • Discourse touched me in a no-no place

    @OhNoDevelopment said:

    This would not have been an issue at my company. We default everything to strings.
    Of course. You can put XML inside YAML inside JSON inside a string. Easy!



  •  Is "TheClass" really named "TheClass" or did you change it for not giving out sensitive information?

    Also, why is this "container" generic? It looks like it was only used to wrap a standard datatype in a class. If that is the case you could just  ensure "type safety" via the constructor... Drawback:; you would have to change getters and setters (every two weeks), but you'd gain some clarity. Well... maybe I do not understand this code's full purpose but it looks like it was a feasibility study from some young padawan.

     



  • @zelmak said:

    The last person got it right. Strings are much easier to work with as arbitrary width numeric values.
     

    I much prefer an array of bits. Then it can be used for arbitrary length anythings, and efficiently packed as a bonus.

     


Log in to reply