|
|
|
| Non-WTF Job: Junior .NET Developer at West Monroe Partners (Chicago, IL) |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |
Re: It Had Too Many Functions
2007-12-05 08:12
•
by
Paddington Bear
(unregistered)
|
|
I find my car has a radio, cd player and air conditioning, so it's much slower.
Walking is a much simpler operation and much more efficient. Can you help me walk at 70mph please? |
|
Uughh. I think I just died and went to hell
|
Re: It Had Too Many Functions
2007-12-05 08:15
•
by
Paddington Bear
(unregistered)
|
|
...and the real WTF is that it still says: 1 comments.
It is true, one does, but I don't think that's how it's intended. |
|
"Your brain has too many synapses. Mine just has three. It's more efficient."
Fail. CAPTCHA: ewww (my first reaction to the vict-- I mean, featured employee) |
|
O.M.G.
Even assuming that he HAD to write his own version of something that was already available, that is the worst implementation I've ever seen, including the stuff my students used to turn in! |
|
For those amount of values in an array, you can use Duff's device.
But looking at some code and thinking it has too many functions, without understanding the code and know when it is loaded..... Yeah, WTF? I don't know that library myself, but I do look into code to see if it is overkill or not. Default implementations do not simply mean fast. Sometimes you don't need the whole library. - Unomi - |
Re: It Had Too Many Functions
2007-12-05 08:22
•
by
TheophileEscargot
(unregistered)
|
|
I've seen similar things before, like a programmer with years of experience not knowing that there's anything faster than Bubble Sort.
I think this is a good counterexample to the people who say that CS degrees are pointless since most of the content is never used. Self-taught programmers can often have big gaps in their knowledge like this, since they've never had to learn boring stuff like data structures. And since it's an unknown unknown, they're not aware that they're missing anything. |
|
How... did... my god.. I don't understand what these people do to be landed in these jobs.
|
|
Well, it's not even a hashtable, or even a map. It maps a key to multiple values, but the only way to access suceeding ones is to remove the previous ones... The guy obviously doesn't understand that array resizing involves creating a new array and copying the items (assumption about C#), and it looks like he didn't even look up what a hashtable is. ...I'm honestly surprised he could write working code with as little knowledge as this shows...
|
|
To paraphrase an old Saturday Night Live sketch: "It's not what you know. It's what you _think_ you know!"
Captcha = "darwin" How appropriate!!! |
|
I think James should get rid of at least one function. Three functions is not compact enough (five seconds).
|
Re: It Had Too Many Functions
2007-12-05 08:31
•
by
Ch0
(unregistered)
|
That's the thing. How can an idiot get a job when I can't? Who do they apply to? But then, would I really want to work for the sort of person who'd happily employ an idiot alongside me? |
Re: It Had Too Many Functions
2007-12-05 08:31
•
by
Gamen
(unregistered)
|
Whoops, sorry, you can't ever access the succeeding values. Missed the loop in the remove code. ...So he knows there can be multiple values mapped to a single key... Forget it. |
|
I dont see the problem. As it stands his implementation of hashtable *is* faster, although not because it has just 3 functions, but because there are far fewer layers of inheritance involved.
|
|
Something like:
/** * @param add if true, add the value with the specified key, otherwise remove the key * @param value if add = true, add this value to the specified key, may be null otherwise. */ public void addOrRemove(Object key, Object value, boolean add) { .. } |
|
A HashTable with what, O(n^2) removal time? Briliant!
|
|
I wait with a sense of trepidation for the first ’This is not a WTF’ WTF comment
|
Hello, obvious troll. I wonder how many will take your bait. |
|
*THUMP* *THUMP* *THUMP*
What's that you ask? It's my head landing on my desk. |
Re: It Had Too Many Functions
2007-12-05 08:46
•
by
Rene
(unregistered)
|
|
It's called sarcasm.
|
Re: It Had Too Many Functions
2007-12-05 08:46
•
by
Claxon
(unregistered)
|
Hey stop that! No dissing of Bubble sorting, without them we'd have to put some effort into optimizations when we need to show justification for a pay rise. CAPTCHA: muhahaha - Yes, just what I was thinking... |
Re: It Had Too Many Functions
2007-12-05 08:50
•
by
vP
(unregistered)
|
|
Wait until you see his version of skiplist!
|
Re: It Had Too Many Functions
2007-12-05 08:57
•
by
Devek
(unregistered)
|
|
I don't know C#.. but one of the things that has troubled me in the past about "high" level languages(like Java) is that it requires an immense amount of knowledge to be able to do anything correctly while attracting novice programmers left and right.
Just normal C is easier to program in because you know what your C code is doing for the most part. Novice programmers should start there. To write good Java code you have to not only know what your code is doing, but how everything your code is doing is implemented. Perfect example of novices using a "high" level language when they don't know enough about coding is Gentoo's portage system. Python is the worst offender when it comes to luring in novices to do something they have no business doing. |
|
I'm not saying you have to KNOW and USE hash tables to be a good programmer... but it sure seems that way.
|
Re: It Had Too Many Functions
2007-12-05 09:06
•
by
täheke
(unregistered)
|
Your function has too many parameters. It should be /** * Adding comments takes too much time */ public Object[] DoStuff(Object[] params) { .. } |
Re: It Had Too Many Functions
2007-12-05 09:07
•
by
Thorsten
(unregistered)
|
|
What's wrong with Portage?
|
Wow! This comment struck a nerve with me. I apologize if I go into a lengthy speech about this. I have run into quite a few people that I graduated from College with who were MUCH better programmers than I was but none of them could find work, while I have had few problems finding development jobs from the day I got my diploma. While I wouldn't classify myself as an "idiot", there is something to be said for having the ability to market yourself that can make you more "hirable" than someone with a broader skillset. Now that I have had the opportunity to be involved in a few hiring decisions, I have seen one major trend in these highly-skilled newly graduated developers that make them undesirable. The biggest problem is ARROGANCE. No one wants to hire somebody into an entry-level position who thinks they already know everything. The personality of a new employee is just as important as their skill set. I think every seasoned programmer has experienced a junior developer with some bizarre misconceptions about basic concepts (My personal favorite is "The only difference between inner joins and outer joins is that inner joins are faster"). The ones that turn into good developers are the ones that are open-minded and willing to learn. |
Re: It Had Too Many Functions
2007-12-05 09:08
•
by
krupa
(unregistered)
|
How do you figure that? The whole point of OOP is that you don't need to know or care how a class is implemented. |
Re: It Had Too Many Functions
2007-12-05 09:09
•
by
Derek
(unregistered)
|
|
But seriously, where's the WTF in this? Looks fine to me.
(Just implemented a very similar hash table in Ruby, pretty damn efficient over the 3 items in my test case.) |
Re: It Had Too Many Functions
2007-12-05 09:10
•
by
Devek
(unregistered)
|
Check the python source for it :P I'll submit a few WTFs based on it next week when I get time. |
|
he should use HashMap, Hashtable is slower because its synchronized :P
just messing with you |
Wait, still to much public Object[] do(o[] p) Actually.. why not just public object do(o p) Since an array of objects is just an object anyway? |
|
Wow. Even as just a makeshift quick-and-dirty indexed table class this is real bad. I find myself among the ranks of those who fail to fathom how people like this find jobs and keep them for more than a week or two.
|
Re: It Had Too Many Functions
2007-12-05 09:20
•
by
Martin
(unregistered)
|
It's only faster at implementation time. |
Re: It Had Too Many Functions
2007-12-05 09:25
•
by
QuinnFazigu
|
Did the article say James was self-taught? If we're going by anecdotal evidence, every WTF I've seen perpetrated by a current employee has been from a college-educated person. The best programmers in our department are self-taught. |
Re: It Had Too Many Functions
2007-12-05 09:26
•
by
Ben Blok
(unregistered)
|
I do not really agree on this mainly because C has the huuge overhead of learning memory management. C makes shooting yourself in the foot really easy. |
Re: It Had Too Many Functions
2007-12-05 09:28
•
by
Karl von L.
(unregistered)
|
God, I *hope* you're joking. This so-called "hash table" doesn't even use any, um, hashing. |
|
If this wtf is real, than that is simply amazing! The guy sort of knows what a hashtable is and how it works, yet he thinks that fastness has to to with numberofmethodness.. As we say in my country (Norway): IDIOT!
Captcha: wigwam --> worst glam rock band ever http://youtube.com/watch?v=0XIyCKgA8z8 |
Re: It Had Too Many Functions
2007-12-05 09:29
•
by
Anonymouse
(unregistered)
|
|
Easy improvements:
- Resize the array in larger steps so resizing happens less often (an array can have unused elements you know) - Resize in even larger steps or not at all when removing items from the array. - When removing an element from the Array, rather than copying the rest into place, move the trailing element to the position of the one you just took out. Order of elements is arbitrary anyway. - If the number of GetItem calls far outweighs calls to AddItem and RemoveItem (as is often the case), keep the array sorted and index by binary search. or even better, - Use the HashTable class the platform provides |
Re: It Had Too Many Functions
2007-12-05 09:30
•
by
Devek
(unregistered)
|
At the end of the day.. your code is going to do things like access disk and memory which are resources that are more precious than cpu cycles on modern hardware. I was reviewing some code for an unnamed company that was writing a server in Java for their game. They wanted to be able to update parts of the logic quickly and on the fly so they decided to use Jython which was fine and all but it was SLOW. The threads would call Jython and tell it to run a script with certain parameters. They even tried a test where they just did basic exec() calls on Jython that did nothing but return and the speed was the same so it wasn't the scripts causing the slow down. To fix the speed problem I simply created worker threads that were implemented in Jython that looked into a queue to grab work to do. Even though it was much more complicated, had more threads, and had more code at the end, it was 1000x faster. If you don't know how the classes involved are implemented, you won't know why the code went from running 1,000 scripts a second to 100,000 a second on my core 2 desktop. :P If all you knew was Java and knew nothing about how it and its classes worked you would swear the previous implementation would of been faster. |
Re: It Had Too Many Functions
2007-12-05 09:33
•
by
German B
(unregistered)
|
Better yet: public void do() Passing stuff in and out is inefficient. Globals are the way to go. This should be a pattern. |
Could you plz email me teh codes. |
Re: It Had Too Many Functions
2007-12-05 09:34
•
by
Fuji
(unregistered)
|
Always implement a bubble sort first. Then you can be the hero for really speeding things up in version 2.0 |
Re: It Had Too Many Functions
2007-12-05 09:40
•
by
Devek
(unregistered)
|
If you can't write C without shooting yourself in the foot over and over you will not be able to write good code in any language. There isn't a language that has built in stupidity protection. |
Re: It Had Too Many Functions
2007-12-05 09:47
•
by
Jackal von ÖRF
|
At least in Java. The real WTF is that people still use and teach the use of java.util.Hashtable and java.util.Vector (or even worse, java.util.Stack) instead of the newer alternatives and interfaces. It would be better for Sun to deprecate those classes. |
|
It's not a hash table, but I'll call it a hash table anyway. Then, when it's too slow, it must be because hash tables are too slow. Or something.
|
Re: It Had Too Many Functions
2007-12-05 09:51
•
by
jimjim
(unregistered)
|
|
I don't see why hash-tables would have a lot of inheritance involved, its a basic container On the other hand, custom implementation will not have built-in/platforms optimizations As hash-tables is a structure used very, compilers often replace them with a very fast implementation |
Re: It Had Too Many Functions
2007-12-05 09:51
•
by
anti-cynic
(unregistered)
|
|
Better yet, screw functions:
{ } |
Screw code!, machine code all the way baby... |
Re: It Had Too Many Functions
2007-12-05 09:57
•
by
K
(unregistered)
|
|
Better yet, how about
int main(){ //...code goes here } Anybody that's ever used JavaScript knows how costly function calls are, and every good technical manager knows that encapsulation just confuses new developers because then they have to look into the class to see what it's doing. Better to write everything in one function. That's why VBScript is better, because you don't have weird conventions like "int main()" - you can just write code in any old text file, put "<%@Page Language="VB"%>" (much easier to remember, and informative!) at the top and be done. (Sadly, this was the state of the code at my workplace when I came on a few years ago.) |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Next » |