- 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
Really, that's what incompetence is all about; not having that little bit of "self-check" software in your brain, that constantly asks yourself "am I doing this right? What are the cause of my problems? Is it me?"
I remember when I was at college (almost a decade ago), there was really incompentent jerk. It was our data structures class (i.e..... data structures in c++) and the stuff was hardly taxing; writting our own btree's, linked lists, stacks...that sort of thing.
The thing is, the guy just didn't get it. Our lecturer must have spent more time with him than anybody else in the class. And one day, he comes out with the most beautiful comment. He says;
"I don't get it! I'm the smartest guy in the class! They must be teaching this stuff wrong, because I don't understand it".
Umm...yeah. I promptly went back to writting my software rasterizer (told you the class was a breeze) pondering if I should threaten him with physical violence should he EVER talk to me again.
Admin
Nonsense. Sorry pal, but all you have is just a vague imagination of what your life might be with kids. I have 7 years of hands-on experience in that topic. And you are absolutely wrong if you diagnose me with "lack of hunger for knowledge". I read lots of books, magacines, articles on the web etc.
Again, you are wrong. Healthcare for my kids is not an issue, since I live in Austria. And while the consequences of failure are larger, so are the possible relative gains of taking a risk. Let me explain that in detail. Currently, here in Vienna, as an employee, I might have a net income of 2000-2500 EUR per month. Without kids, maybe even living together with a significant other who works fulltime too, this is enough money to live very well and put 1000 EUR aside every month. Where is the incentive to take a risk for those people?
On the other hand, for a family with two kids and a housewife, it's just enough to live, but you are always short on money. Taking the risk of beeing a freelancer - who makes 3000-4000 EUR per month, but with less security - gives me 1000 EUR more per month. Those 1000 EUR matter. If I started a real company, the risk would be even bigger, but in contrast to the childless guy, it's my only way to ever get a Porsche in my life.
Admin
Those people go to www.cs.mdx.ac.uk. "Don't have what it takes" is an unattainable goal for the vast majority of students there.
Admin
Hmmz, don't agree with all of that.
First, if the try{} is an Error, so is the catch{} block.... mark it red. (No catch without a try first).
And the getCount() method does not look ok to me. Since this is not an Interface but a Class, you need to implement a method body for it (and for the setCount too obviously). Also abstract is probably not what you want (allthough, with the entire class being abstract, you're screwed anyway).
The real WTF here is of course the interview commitee. How can you hire such a guy. Next time throw in a few tech questions (what's the difference between a class and an interface would have been a nice one here ;-) )
Admin
The Paula incident didn't make me worry about female programmers a single bit - everyone writes dumb code every now and then, and everyone is an utter newbie at one point.
Besides, Paula was SO much more competent than this programmer. Not only did the Brilliant Paula Bean compile, but it also did something.
Admin
I've considered that, but since it is not a new error, but the continuation of the "try"-error, I decided not to do that. But that's a matter of taste.
Wrong, wrong, wrong. An abstract class can of course have abstract methods. Abstract methods cannot have a body.
Admin
You simply can't have it both ways. Either you have time to lean everything you want, and therefore your hunger for knowledge is sated. Or you have a hunger for knowledge, which would result from not learning as much as you'd like.
You know your life better than I do. But I've known enough people at various stages in parenthood to know that not becoming more adverse to risks is very atypical - except for teenage parents. It could be that because of your social structure and what not being a freelancer really isn't that risky for you. Or perhaps you're a little less sure about starting a real company than you would be otherwise, I assume the consequences of such a venture failing are greater with children? Regardless, good luck on the Porsche!
Admin
Which 40%? Do I get to save my balls?
Admin
Not just pliers - waterpump pliers! Presumably for connecting up the coffe machine
Admin
Using this interpretation, I would be hungry with or without kids, no matter how much I learn, my hunger would not be sated. But what really matters is: If you are (say) a C# programmer when your kids arrive, that doesn't mean you have to be a C# programmer for the rest of your life.
You have to compare those people with childless people of the same age.
Are they (on average) more willing to take a risk?
But of course "risk" means a different thing with kids. For example, without kids , it would not be risky at all for me to buy a decent house. Because the 2K p.m. income I can always get as an employee are more than enough to pay the mortgage of 1.1K EUR and still live. With kids, buying the house is a risk.
For me personally, the consequences of a venture failing are the same - I'm broke. Of course it would affect my family too, but well, here in Austria the wellfare net is tight enough not to worry too much. So why haven't I started my big venture yet? Well, you know, the space inside a Porsche is a little tight for four persons ;-) Honestly, I don't feel ready for that adventure yet.
And there is one problem with having kids: starting a new venture is a task that requires many hours of work per week, much more than the normal job of an employee or freelancer (except those working in a startup, maybe).
It would be a problem for my family if I had to work 80 hours per week, for at least two years, to get the company running. Seems like my Porsche has to wait...
Admin
BS-ing a technical interview is easy
I don't think so. A good technical interview should include specific questions such as "explain the concept of pure virtual functions" or what exactly does the "explicit" keyword do. These things are not in C++ 101.
Of course coding tests are even better but this particular guy would have fallen if asked specific tricky Java questions.
Admin
Actually this guys puts it even better, what I was just trying to say :)
Admin
WTF kind of language has both an int and an Integer?
According to this you can't make a vector of int or use it as a key for a map!
Admin
I guess it's for speed reasons. Autoboxing/Unboxing partially cures this artificial separation.
Admin
hahahahahaha, ain't that a keeper :P
I mean, he only had 15 years of programming experience and my good, didn't he make a super duper job on that page ;)
Admin
Even better, if a method has a parameter of some primitive type (such as int), you can still invoke the method using java.lang.reflect.Method.invoke() but you won't find it using java.lang.Class.getMethod(). At least it used to be this way, I don't know if this automatic boxing and unboxing in Java 1.5 might take care of that particular problem.
Admin
This is not true. But, there is a little pitfall: You have to specify "Integer" in the parameterTypes array where you expect the "int".
Admin
Funny... when I interview for a job, it runs more along the lines of "tell me why I should work for you" and "prove to me that your organization isn't dysfunctional". So around the 2nd question I see my interviewers starting to sweat.
Admin
Nope, it still doesn't work with Java 1.5 either. Or did I do something blatantly wrong?
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect>del *.class</FONT>
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect>set PATH=C:\Program Files\Sun Microsystems\jdk1.5.0_04\bin;%PATH%</FONT>
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect>type DailyWtfReflect.java
import java.lang.reflect.Method;</FONT>
<FONT face="Courier New" size=2>public class DailyWtfReflect
{
public void TestMethod(int i)
{
System.out.println("Welcome to TestMethod()");
}
public static void main(String[] args)
{
try
{
DailyWtfReflect obj = new DailyWtfReflect();
Class cls = obj.getClass();
Integer i = new Integer(0);
Class[] params = new Class[1];
params[0] = i.getClass();
Method method = cls.getMethod("TestMethod", params);
}
catch(NoSuchMethodException x)
{
System.out.println("NoSuchMethodException: " + x.toString());
x.printStackTrace();
}
}
}</FONT>
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect>javac DailyWtfReflect.java</FONT>
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect>java DailyWtfReflect
NoSuchMethodException: java.lang.NoSuchMethodException: DailyWtfReflect.TestMethod(java.lang.Integer)
java.lang.NoSuchMethodException: DailyWtfReflect.TestMethod(java.lang.Integer)
at java.lang.Class.getMethod(Class.java:1581)
at DailyWtfReflect.main(DailyWtfReflect.java:18)</FONT>
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfReflect></FONT>
Admin
Uhhhhhh were we in the same class? A couple things you said rang some bells in my head lol. Was this at Duke by any chance?
Admin
No, AmmoQ was wrong:
<font face="Courier New" size="2">public class ReflectionTestCase extends junit.framework.TestCase {
public int pow (int x) {
return x * x;
}
public void testFindingT () throws Exception {
java.lang.reflect.Method pow = getClass ().getMethod ("pow", Integer.TYPE);
assertNotNull (pow);
assertEquals (4, pow.invoke (this, 2));
}
}</font>
You can also use <font face="Courier New" size="2">int.class</font>, but that's being frowned upon.
Admin
Not, I'm afraid not. That means there are TWO of these idiots in the wild. Qick! We must cull them before they breed!
Admin
You are unfortunately right and I am wrong, I must have confused it.
Anyway, here is the REAL solution: Use Integer.TYPE as parametertype for getMethod().
import java.lang.reflect.Method;
public class DailyWtfReflect
{
public void TestMethod(int i)
{
System.out.println("Welcome to TestMethod()");
}
public static void main(String[] args)
{
try
{
DailyWtfReflect obj = new DailyWtfReflect();
Class cls = DailyWtfReflect.class;
Integer i = Integer.getInteger(null,0);
Class[] params = new Class[1];
params[0] = Integer.TYPE;
Method method = cls.getMethod("TestMethod", params);
}
catch(NoSuchMethodException x)
{
System.out.println("NoSuchMethodException: " + x.toString());
x.printStackTrace();
}
}
}
Admin
Damn, you were faster than me :-((
Admin
> one can still be an "expert" and not know a great deal about "protected".
exactly.
in the absence of inheritance, private and protected are essentially equivalent - and in my experience, even simple inheritance is uncommon. so i'm happy when i see protected or private at all. it tells me the programmer was at least trying to show the rest of us which member vars are open for external manipulation and which are for internal state, instead of making us guess...
Get/Set functions? icing on the cake.
not using a member variable in a derived class with the same name as one in the base class ? priceless.
Admin
Universities and jobs set absolute standards to competence, but by large, competence is a relative concept. The guy who wrote text adventures as a kid but couldn't make it through the c++ data structures class is considered incompetent by the guys who code software rasterizers for fun, but at the same time the software rasterize whizzes are considered incompetent by the global illumination gurus, and so on.
Admin
I said: the photo of a vaguely puzzled-looking grey-haired programmer is kind of ageist, don't you think?
Richard Nixon said in response: If it had been a woman in the photo, do you think it would be sexist? Or if it had been a black in the photo, do you think it would be racist?
----
See, back there in the original article to which we're all replying, Alex mentioned that some women had previously complained that singling out the brillant Paula as 'one of the worst programmers' was a bit sexist.
So, by analogy, illustrating the present article about a crap programmer with a picture of an older guy should invite accusations of ageism from the grey-haired programmer community (of which community I am a member).
This was an attempt at a 'joke'. Maybe not a successful attempt, but an attempt nevertheless.
Admin
I do not understand how someone could be an expert in a OO language, and not understand 'protected'. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Protected and private would only be the same thing is the class was declared as sealed, many compilers will give you a warning if you have a protected member in a sealed class.<o:p></o:p>
Perhaps not in your work place, but I have worked in many industries from banking to currently the online services group of a major software house, inheritance has been very common-place through out all. A rough example in a bank I was with several months back as a freelancer. We had the concept of abstract Products and Schemes. The Scheme and Product classes have several classes derive from them which were the actual concrete schemes and products which could be brought. <o:p></o:p>
Coupled with polymorphism this becomes very handy when for example having to list all Schemes or Products, regardless of their actual concrete type. <o:p></o:p>
If we we're hiring even an ‘expert’ developer, as OO languages are our primary tool currently they would not get past the telephone interview if they could not accurately explain all off the main OO principles and give working examples. (Unless of course they were a DB dev, at which point they would be grilled on relational theory and algebra and asked to fully explain each and every normal form). Of course they would have to also display other traits such as problem solving, the correct aptitude, creative thinking and so on, though we are known for having one of the hardest interview processes, possibly with exception of Google. <o:p></o:p>
If they we’re coming in as a junior developer, then the above would be very different and we would be looking much more at their aptitude and ability to solve basic puzzles over actual technical skills. <o:p></o:p>
Admin
This is a test. For the next sixty (or thirty) seconds, this forum will conduct a test of the Programmer Comedy System. This is only a test.
If this had been an actual joke, you would have instinctively laughed due to the comical text that was presented.
This concludes this test of the Programmer Comedy System.
Admin
abstract methods CAN have a body, but it's not mandatory...
Admin
Oh, so the real WTF is that he never bothered to learn Basic!
Admin
Three points:
1. You clearly do not have kids, nor have you tried to have them.
2. I feel sorry for your partner.
3. You're doing it wrong.
Nothing personal. I just can't let a setup like that go unanswered.
Admin
Thanks, that's of course a lot easier than my WTF solution of calling <FONT face="Courier New" size=2>getMethod<FONT color=#ff0000>s</FONT>()</FONT> to get all of the methods, calling <FONT face="Courier New" size=2>toString()</FONT> on each of them in a <FONT face="Courier New" size=2>for</FONT> loop, and invoking the one that had <FONT face="Courier New" size=2>"TestMethod(int)"</FONT> in its description.
Admin
He's giving us all the finger if you look closely ;)
Admin
Of course, there can be quite lengthy sessions of interviews and negotiations before it gets to the practical exam stage.
Admin
Not in Java. Doesn't make sense anyway.
My java compilers (jikes and javac) do not compile the following source file:
public abstract class FooBar {
public abstract void foo();
public abstract void bar() { }
}
[erich@localhost erich]$ jikes FooBar.java
Found 1 semantic error compiling "FooBar.java":
3. public abstract void bar() { }
^----------------------------^
*** Semantic Error: The declaration of the abstract or native method, "void bar();", must not contain a method body.
[erich@localhost erich]$ javac FooBar.java
FooBar.java:3: abstract methods cannot have a body
public abstract void bar() { }
^
1 error
[erich@localhost erich]$
Admin
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfAbstract>javac DailyWtfAbstract.java
DailyWtfAbstract.java:3: abstract methods cannot have a body
public abstract void dummy()
^
1 error</FONT>
Admin
<FONT face="Courier New" size=2>D:\Projects\ExploreJava\DailyWtfAbstract>javac DailyWtfAbstract.java
DailyWtfAbstract.java:3: abstract methods cannot have a body
public abstract void dummy()
^
1 error</FONT>
I like how the compiler uses almost the exact same wording as the anonymous poster... except for the "cannot" part, of course.
Admin
I'll never be able to find the web page ever again, but one of the creators of C# stated that boxing/unboxing was probably the biggest mistake they made in the .NET Framework. There were other alternatives they had and they should have done.
Admin
Vb will cast the 1 to a string. That's my point. I'm pretty sure he did & 1 because he thought "the db field is a bit, not a string." This is from a query that ALWAYS needs to get only active records and that never changed. The "should we get active or inactive entries?" was never a valid concern. Only active ones are needed in the particular case in point. It may be valid vb, but it's not anything someone with a working brain would write. Maybe you didn't read the part where the guy doesn't know how to type (he copy and pasted a f'ing 0!!). We're talking about someone with zero problem solving skills, who didn't even know what a string delimiter is. This particular example is actually some of his best code. Other things I've run into would take more of an explanation, so I went with an easy to understand example.
Admin
Not just pliers - waterpump pliers!
You brits are so wacky ... those are channel lock pliers
Admin
I have 3 kids (5,3,2) and I still have time to flip through the newest stuff - pick out the stuff I find interesting and dig into the depth of that. I am currently digging through Ruby - my last stuff going back was PHP, Perl, and Java. Having also been bit by the agile movement I taught myself JUnit as well.
Is it more difficult now with kids? Sure, but my defination of self does not start and end as Father. Among other things am son, husband, father, friend, and self.
However, even while single I just do not have the personality to jump to a risky company on the off-chance I will strike it rich. I do not mind long hours when necessary, but I simply prefer working at companies with a good history as opposed to pop-up businesses with a single-threaded idea. I also enjoy working at companies with programming teams in the 3-6 range. The reason is that I thrive off of situations where ideas can churn, but things get too big and good ideas get lost to the more aggressive personalities.
But that is just me.
Admin
Admin
When you're a hammer, everything looks like a nail. (It's just soooo hard to accept that some will never be anything but a hammer.)
Admin
I don't buy #2 (except possibly in the short term -- new baby, marriage, divorce, etc). Perhaps if someone worked in an environment where the bar was really high. In my experience, such folks have plenty of fluff time to keep up to date -- they just happen to be #1ers using the #2 excuse.
Admin
Haskell has both. Issue is that Java has them for crappy reasons ("native types" vs objects) while Haskell has them for more logical/performance reasons (Int is a native/machine integer -- with all the issues that come with it, mostly overflow -- and Integer is an unbound integer akin to Java's BigNum -- with the performances issues associated), and the interfaces are exactly identical (i.e., they're mostly interchangeable)
Maybe because Java isn't the end of all things in OO, and some (arguably more) OO (than Java) languages don't have protected methods? See Smalltalk or Python for instance. Or Simula, and I'm not really sure about Common Lisp's CLOS.
On the other hand, I could say that I do not understand how someone could ge an expert in an OO language and not unrestand metaprogramming or properties, and yet no java won't teach you anything about them.
Admin
Sorry in advance for over-quoting.
I have 20 years of programming professionally, and longer programming unprofessionally (take that any way you like). While it's true that specific skills become dated or can only have been acquired relatively recently, anyone with a brain, a pulse, and basic aptitude should acquire skills over time that do not date, and which are sharpened by experience. Programming requires the ability to think in a certain way, and the more you do it, the more naturally it comes. You also acquire the ability to recognise certain kinds of problems by smell.Well, something like that.
Admin
Ok, prehapes I should rephrase that. Someone who claims to be an expert in Java / C# or C++ / vb.net (or any other language that allows hiding of members from everything other than derrives types.
Are they not one of the same reason, it is more peformant in Java to use one over the other just like you said it was in Haskel? (you will have to forgive me, I am not a Java programmer)
Admin
Given that the overhead of a Java object includes
- allocation time
- heap block overhead
- more work for the garbage collector
- a class pointer
- a mutex
- a condition variable
I don't really see what's so crappy about not using them for routine calculations. Java was made to be useful, not to be pure at any cost. Unlike Haskell, which maintains theoretical purity at the expense of being a dog for practical applications.Admin
In Java, protected variables are also visible to other classes in the same package.
To reiterate, here are Java's four variable scopes: private int someCount;
int someCount;
protected int someCount;
public int someCount;