It MUST be done!



  •   private void comeHellOrHighWaterThisMUSTbeDoneOrFatalErrorsWillAbound() {
    /*
    Do All sorts of stuff
    */
    }

    ...and it's called all over the place.



  •  With that name ?

     And is there anything to make it is done ? Like, a loop that do it 10 time in a row, to be very sure ?



  • @snoofle said:

      private void comeHellOrHighWaterThisMUSTbeDoneOrFatalErrorsWillAbound() {
    /*
    Do All sorts of stuff
    */
    }

    ...and it's called all over the place.

    With so much stress on the fact it must be done, you would think the author would have:

    • Called it something you're less likely to hate typing in, and
    • Actually provide a hint as to WHY it must be done...


  • @DumbByAssociation: with auto complete, it's no big deal to type the name: comeHel is enough in this case. it's called in 326 places in the project. What I find amazing is that the entire body of it is commented out. With no explanation as to why. I simply pointed it out as a failing to the team for whom I was doing the audit. Let them track it down.

     


  • Winner of the 2016 Presidential Election

    @snoofle said:

    it's called in 326 places in the project.

    And it's private. That that's even possible makes me shudder.



  • @snoofle said:

    @DumbByAssociation: with auto complete, it's no big deal to type the name: comeHel is enough in this case. it's called in 326 places in the project. What I find amazing is that the entire body of it is commented out. With no explanation as to why. I simply pointed it out as a failing to the team for whom I was doing the audit. Let them track it down.

     

    Ouch. I believed there was actual code inside and the comment block were only an ellipsis.

    Don't you cry at night sometime, overloaded by the dread generated by the application you are working on ?

     



  • Wow. A comment that increases runtime. I never thought I'd see the day...



  • @Ben L. said:

    Wow. A comment that increases runtime. I never thought I'd see the day...
    What?



  • @joe.edwards said:

    @snoofle said:

    it's called in 326 places in the project.

    And it's private. That that's even possible makes me shudder.

    Yeah, that'd be my error transcribing it. It was public. Sorry.


  • @TheLazyHase said:

    Don't you cry at night sometime, overloaded by the dread generated by the application you are working on ?
    No, but I did once jump up in the middle of the night yelling something about "you can't do it that way..." - my wife thought I had lost my mind.

     



  • @Sutherlands said:

    @Ben L. said:
    Wow. A comment that increases runtime. I never thought I'd see the day...
    What?

    If Ben L is right, Java must have a shitty optimizer.



  • @snoofle said:

    I simply pointed it out as a failing to the team for whom I was doing the audit. Let them track it down.
     

    I approve.

    Perhaps it began life as a sanity-check interface and never got implemented.



  • @blakeyrat said:

    @Sutherlands said:
    @Ben L. said:
    Wow. A comment that increases runtime. I never thought I'd see the day...
    What?

    If Ben L is right, Java must have a shitty optimizer.

     

    Rule #1 of Java: Java has a shitty everything. (Not in the least the fucked-to-high-hell auto-update component...)



  • @blakeyrat said:

    @Sutherlands said:
    @Ben L. said:
    Wow. A comment that increases runtime. I never thought I'd see the day...
    What?

    If Ben L is right, Java must have a shitty optimizer.

    I think Ben refers to the fact that calling the routine carries a cost, and no compiler is going to optimize away a call to a public function in another class.



  • comeHel is enough in this case


    If "comeHe" is not enough, does that mean that there is also function that starts with "comeHeaven"?



  • @Ragnax said:

    @blakeyrat said:

    @Sutherlands said:
    @Ben L. said:
    Wow. A comment that increases runtime. I never thought I'd see the day...
    What?

    If Ben L is right, Java must have a shitty optimizer.

     

    Rule #1 of Java: Java has a shitty everything. (Not in the least the fucked-to-high-hell auto-update component...)

    It might be better to not be 100% ignorant about things you make assertions about, in case someone confuses your authoritativeness with knowledge.



  • @TGV said:

    I think Ben refers to the fact that calling the routine carries a cost, and no compiler is going to optimize away a call to a public function in another class.

    An EMPTY ONE? Bullshit. Even I do not believe Java is THAT awful.

    If the other class was in a .dll then yeah. Maybe.


  • Winner of the 2016 Presidential Election

    @blakeyrat said:

    If the other class was in a .dll then yeah. Maybe.

    As I understand it, in Java, each class gets compiled into a separate assembly (a .class file).



  • @joe.edwards said:

    @blakeyrat said:
    If the other class was in a .dll then yeah. Maybe.

    As I understand it, in Java, each class gets compiled into a separate assembly (a .class file).

    But surely all decent java virtual machines do some kind of JIT compiling of the byte code into native machine code in which case it should be possible to detect and remove calls to empty functions...

  • Winner of the 2016 Presidential Election

    More importantly, I'd like to know in which scenarios calling an empty method would present real performance concerns... and if your needs are so real-time, maybe Java isn't the best choice?


  • Discourse touched me in a no-no place

    @joe.edwards said:

    As I understand it, in Java, each class gets compiled into a separate assembly (a .class file).
    No. Or yes, each class becomes a separate .class file but that's not the same as an assembly. The closest analogy to an assembly would be a JAR, which may contain classes from many packages. Furthermore, the JIT compiler (which works after the code is loaded) can optimize out calls to empty methods entirely (provided it can prove that those method calls are always empty) during native code generation since it knows that the method really is empty.

    If you're going to dump on Java, stick to bitching about the awful auto-update code and terrible browser plugin. Those are both deserving of it…


  • Winner of the 2016 Presidential Election

    @dkf said:

    @joe.edwards said:
    As I understand it, in Java, each class gets compiled into a separate assembly (a .class file).
    No. Or yes, each class becomes a separate .class file but that's not the same as an assembly. The closest analogy to an assembly would be a JAR, which may contain classes from many packages.

    You could theoretically unzip that JAR, and drop in a .class file that has meat where the old one had a stub. (Don't ask me why, but I bet someone who was too "clever" for their own good does patches this way.)

    @dkf said:
    Furthermore, the JIT compiler (which works after the code is loaded) can optimize out calls to empty methods entirely (provided it can prove that those method calls are always empty) during native code generation since it knows that the method really is empty.

    I would hope so; the bytecode can't optimize away this instruction because of the reason stated above, but a good JIT can. Of course, nothing Oracle produces strikes me as a quality product so I wouldn't assume that.



  • @joe.edwards said:

    I would hope so; the bytecode can't optimize away this instruction because of the reason stated above, but a good JIT can. Of course, nothing Oracle produces strikes me as a quality product so I wouldn't assume that.

    No, the JIT compiler is pretty good, especially if it has some time to warm up, which is one reason why it works well in server applications.



  • @English Man said:

    It might be better to not be 100% ignorant about things you make assertions about, in case someone confuses your authoritativeness with knowledge.

    Name a significant feature it does better than its competitors and didn't 'borrow' off of them only to botch the implementation, as was the case with, e.g.,  generics from C#.





  • How about you save us all 52 minutes and give us the cliff notes?

    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.
    That's funny. The team I work in do exactly that; make a usable desktop application using the JVM.



  • @blakeyrat said:

    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.

    Holy shit! Are you saying there's some virtual machine out there capable of building usable desktop applications? Or is this just you using your poor communication skills to admit your sociopathy?



  • @dkf said:

    That's funny. The team I work in do exactly that; make a usable desktop application using the JVM.

    Lies. No such thing exists.


  • Winner of the 2016 Presidential Election

    @boomzilla said:

    @blakeyrat said:
    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.

    Holy shit! Are you saying there's some virtual machine out there capable of building usable desktop applications?

    The best programs on the market today were created by rogue AIs.



  • @joe.edwards said:

    @boomzilla said:
    @blakeyrat said:
    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.

    Holy shit! Are you saying there's some virtual machine out there capable of building usable desktop applications?

    The best programs on the market today were created by rouge AIs.

    AI STATE LAWS



  • @joe.edwards said:

    @boomzilla said:
    @blakeyrat said:
    Oh BTW, I don't give a shit what kind of absolutely amazing things the JVM can do as long as it can't do the one thing I actually care about: build a usable desktop application.

    Holy shit! Are you saying there's some virtual machine out there capable of building usable desktop applications?

    The best programs on the market today were created by rogue AIs.

     

    Don't upset them. Skynet sees all, you know.

     


  • Discourse touched me in a no-no place

    @blakeyrat said:

    Lies. No such thing exists.
    You can't handle the truth!


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.