• gnasher729 (unregistered) in reply to Dim
    Dim:
    That's exactly why you need source control. People who used to have their commit reverted tend to understand or leave.

    That's why you have code reviews. If you have code reviews in place, something like this is never permitted to be checked in in the first place.

  • c (unregistered) in reply to ochrist

    Unfortunately the function newhir.freeJob() returns the amount of free jobs...

  • gnasher729 (unregistered) in reply to TimC
    TimC:
    And yet every piece of unportable bloated crap I end up running that causes my workstation to bog to a crawl turns out to be Java. For what should be a simple TK widget interfacing with the server. Just how does Java end up being so slow on modern hardware? Why is that? Could it be because the system isn't actually as smart as its authors thinks it is? Or does Sun/Oracle just want to sell more hardware to throw at the problem that should be fixed by a few hundred lines of TK? Or does Java just attract crap developers that are so abstracted from reality and who have no idea what the bare metal is doing underneath?
    As another point, Apple has just deprecated garbage collection in MacOS X. And has switched one of the biggest applications developers use all the time (Xcode) from garbage collection to automatic reference counting, apparently for substantial performance gains.

    One advantage is that objects are deallocated at precise times (exactly when the last use goes away), so you can rely on this for releasing non-object resources.

  • Sethur (unregistered) in reply to Matteo

    Any IDE that isn't shit will also be able to show you the documentation (or at least the signature and a one-line summary) of what the method does as you're typing it, so unless you turn that off or just don't read it because 'you already know everything', you should notice that it doesn't do what you thought it did. It's not the IDE that's the problem any more than emacs would be, it's the 'beingtoo lazy to read the easily accessible documentation' part that's the issue in both cases.

  • noone (unregistered) in reply to faoileag
    faoileag:
    Or, using the wonderful function from 2013-06-18th WTF:

    changeClass($newHire, $exEmployee);

    the true power of this function is hidden the way you use it. let's not forget it can turn a person into a rabbit which has the abilities of a rocket and explore new planets where it can then create a new project.

  • trtrwtf (unregistered) in reply to TimC

    [quote user="TimC"] [/quote]

    WFM in .au too. But then again, you do have to know when pressing the button will make a difference - no use pressing it while the door is still opening, because the microcontroller is still busy opening the door and will ignore you. [/quote]

    Let me guess - works best if you wait until the door is just about to close, right?

  • trtrwtf (unregistered) in reply to Sethur
    Sethur:
    Any IDE that isn't shit will also be able to show you the documentation (or at least the signature and a one-line summary) of what the method does as you're typing it, so unless you turn that off or just don't read it because 'you already know everything', you should notice that it doesn't do what you thought it did. It's not the IDE that's the problem any more than emacs would be, it's the 'beingtoo lazy to read the easily accessible documentation' part that's the issue in both cases.

    Any programmer that isn't shit knows the classes they're using, because they take the time to read the documentation before they start writing code, and don't just import something that sounds likely and start pounding on the keys like a monkey hoping some Shakespeare will come out.

    If you ignore the documentation before you start writing, why wouldn't you continue to do so while you're writing? I mean, an idiot stays stupid all day long, don't they?

  • (cs) in reply to fq3 a5y
    fq3 a5y:
    Some Damn Yank:
    paullik:
    Isn't new hires' code supposed to be peer reviewd before commiting it? They get to push whatever changes they want?

    I think the WTF here is at a higher level, altough a new hire that cannot read a paragraph of documentation is bad enough.

    I'm guessing he discovered and used this "technique" at school, and brought this "experience" with him to his new job. So TRWTF is his professor(s) who let him get away with it in class.
    hoiw many of us actually read documentation? At some stage he's obviously come across freeMemory and has assumed (understandably given Java's naming convention which perhaps suggests it should be something like getFreeMemory or countFreeMemory) it free's memory. Yeah, I know RTFM when you're not sure about something - easy to say, but I'll lay a pretty big bet that most if not all people on this site have at some stage made assumptions about what stuff does without looking it up.

    Without searching, what would people expect the following German words to mean? Gift, Objektiv, Artist, Kriminale, gross, herb

    Assumption is the mother of all fuckups.

    You forgot Die.

  • slavic (unregistered) in reply to ochrist

    newHire = null;

    is all that is needed.

  • Terr (unregistered) in reply to PRMan
    WebBrowser web = new WebBrowser(); // Not using this web = _browser;

    7 senior developers couldn't find the performance bug.

    Given that it's two lines in a codebase of unspecified size, I wouldn't necessarily blame them for missing it on visual inspection, but I would blame them for not using a profiler...

  • Piki (unregistered) in reply to Kuli

    I like my willy running free.

  • Alexandros (unregistered)

    TRWTF is not GCing the runny variable.

  • (cs) in reply to Dennis
    Dennis:
    faoileag:
    Or, using the wonderful function from 2013-06-18th WTF:

    changeClass($newHire, $exEmployee);

    Or in defensive programming:

    try { changeClass($newHire, $exEmployee); } catch(ManagersNephewException Fred) { changeClass($self, $exEmployee); }

    FTFY

  • (cs) in reply to Aron
    Aron:
    TRWTF is that you can't do using(var bob = new Hire()) { bob.Dispose(); }

    TRWTF is that's redundant.

  • (cs) in reply to Singleton
    Singleton:
    Runtime runny = Runtime.getRuntime();
    See, that line shows the problem with OOP. The developer wanted to have an object that represents the current runtime. So they call Runtime.getRuntime() and that returns the runtime, which is of type Runtime. You have to name your variables silly things like "my_thing" or "thingie" instead of "thing" because otherwise you'd get
    Runtime runtime = Runtime.getRuntime();

    In what way does Runtime.getRuntime() make sense? Do you enter a house to find the house? Why have a class that represents something of which there is only one instance (i.e. is not a class)? And why do you have to call a function to get it? Next thing you'll be calling

    int four = 2.getInteger() + 2.getInteger();
    var current_runtime = RunTime.GetCurrentRuntime();
    

    You'd see something more like that in C# .NET

  • (cs)

    Hello Hello Hello

  • Carmella (unregistered)

    261

Leave a comment on “Running for Free Memory”

Log In or post as a guest

Replying to comment #:

« Return to Article