- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Wait, did he just copy past that into every file?
I wouldn’t be surprised if the logs take up more time than the actually application if they are in every file.
Also FRIST
Admin
you just got fristed
Admin
I liked how he gave a nickname to runtime, runny.
Admin
He should've called freeWilly() instead.
Admin
I wonder what response the culprit gave to the question "How much performance improvement did you measure?"
Admin
I don't need to measure things. I code by feel.
Admin
So, did you call newhire.freeJob()?
Admin
runny.toTheHills() && runny.forYourLives()
And about my daughter, runny.cold()
Admin
Quoted for excellence.
Admin
Admin
That's exactly why you need source control. People who used to have their commit reverted tend to understand or leave.
Admin
Surely newHire.release()
Admin
Or, using the wonderful function from 2013-06-18th WTF:
changeClass($newHire, $exEmployee);
Admin
You forgot runny.forestRunny()
Admin
my->cup(runny.over);
Admin
You clearly don't read very well. Read the first line slowly to yourself a few times. Maybe it will sink in.
Admin
We're sexing employees now? Isn't that harassment?
Admin
Somehow newhire.freeJob()always returns a null.
Admin
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.
Admin
As an old woman who was eavesdropping, I take offence at that.
Admin
Why do people still try to manage their own memory when they have a gc? This baffles me. Assuming the runtime is well written (which at this point I'd give to both java and .Net) the gc is going to know a lot more about memory usage than you do in all but very rare occasions. Ram is there to be used. The gc will free memory when it needs to or when the system is relatively quiet and it won't effect performance. Why worry about that last few MB (which for 99% of systems will be ram that isn't otherwise being used anyways) in exchange for forcing a performance everywhere? I don't get it.
Admin
Not in the industry that came up with the expert sex change
Admin
I got some free memory once. I nabbed it from the machine of a colleague 2 desks over while he was on vacation. He never noticed.
PS: I do like my runtimes a bit runny, too.
Admin
This is exactly how my boss works; he finds a function that sounds by name like it might do what he wants, then uses it liberally without actually reading the documentation, or testing that it actually is doing anything useful.
Then when he finds out it actually isn't working (much further down the line) he rants about how the standard library is buggy :(((
Admin
That's it! Fire everyone involved! You too ma'am.
Admin
RTFM?
Admin
Oh, that site just threw me off completely! And I'd already come up with my new name... Pat!
Admin
Wow a real story. That's new.
Admin
Admin
I have to say, I like how he commented each instance with "//performace". It's kind of like putting flame stickers on your bike. Of course it's faster. It has flames on it.
Admin
Certainly newHire.gc()
Admin
The sad part is that even if he had gotten the name of the method (which is “gc” – hard to remember, right?) right it still wouldn’t have done what he wanted. In Java you can only allocate so much memory that you get an OutOfMemoryError at which point a garbage collection is guaranteed to have occured.
Admin
Stupid Java and their crappy method names. I blame Java and not the new hire! Seriously though, that was a pretty amusing WTF.
Admin
At least two. I'd steer clear of Ashton Kutcher though....
Admin
And when he caught a cold (exception?), he had a runny.Nose()
Admin
Ever come across developers who throw everything into a singleton.
"Garbage collection just doesn't work in Java. I dereferenced the cache but its still in memory."
"Is it hanging off a singleton?"
"I dereferenced it"
"Did you clear the static instance?"
"I dereferenced it."
"The referenced to the singleton or the instance?"
"But java should take care of it."
Managed languages can do a lot of things but it can't cope with morons.
Admin
Admin
Or in defensive programming:
try { changeClass($newHire, $exEmployee); } catch(ManagersNephewException) { changeClass($self, $exEmployee); }
Admin
For the time being, the only thing it'd do would be returning false :P
Admin
Admin
Actually the developer has succeeded in failing, because every call to freeMemory() will allocate an 8-byte long (asting memory), which will then be populated by the JVM (wasting CPU cycles), and will finally be discarded.
Of course I would expect the JRE to detect those method calls as no-ops and exclude them when JITting the code, but still.
Finally, I hope whoever hired this "developer" was punched into red mist for their ignorance. HTF do you hire someone who doesn't understand how garbage collection and managed runtimes work?
Admin
Doesn't give an excuse to be blind to memory usage.
Once had a program look like it's leaking all over.
Realized someone was keeping track of records in a map which items were never removed from.
1 gig of memory later...
Admin
HAhahahahahahahaa!
Admin
TRWTF is that you can't do using(var bob = new Hire()) { bob.Dispose(); }
Admin
The changes are being pushed to source control. Many organizations have a commit-then-review process. Trust that someone you have given access to do the right thing, and revert if necessary. Some places have new hires deploy on day one.
Admin
Right - your job as the developer is to free up objects that you no longer need, not to tell the machine how to dispose of them.
Fortunately, the implementation is free to ignore this call, at least in java:
So in a sane implementation, this is like the "door close" button in the elevator: it's there so the impatient will have something to fiddle with, it doesn't actually do anything under normal circumstances.
Admin
writeTrace failure?
Obviously some of the file may have been omitted, but is this homegrown logging?
Log.writeTrace("Txns built");
For some reason I expect either a log level as argument or that the method name reflect the log level. First Google results for writeTrace are not in java or major logging libs. Could be worth investigating.
Admin
theAmountOfMemoryWhichIsCurrentlyAvailableForUse { return runny.freememory }
Fixed.
Admin
Admin
On the elevators at the office building where I work, there's no "close door" button, but if you push a floor button (even one that's already lit) and 1) the door is fully open and 2) there's no one standing in the doorway, it actually will cause the door to close immediately instead of waiting several seconds.