Why Can't Programmers.. Program?

Why can half of the people here not seem to understand the specs of the prog. Remember its only to test dumb people :stuck_out_tongue:

Chris:
My productivity question lies elsewhere. Can you work for 1 day without a mouse? Try it and see the horror on the users’ faces. Practice it and see the increase in productivity.

Working without a mouse is a very unrealistic requirement. Unless your workplace is really out in the sticks, there is no real reason to go without a mouse for more than an hour.

I couldn’t write down the matrix required for rotating a point in 3D space let alone solve the sine, cosine or other formulas that are plugged into that matrix. But I have written my own 3D game engine. I
can’t show you on paper how to compute the distance between two latitude and longitude points, but I write map software for a package delivery company.

But how can that be? This is not trivial programming but according to the author of the article, I don’t know how to program because I can’t add in hex or solve a bitwise boolean operation in my head. I
argue that a good Software Engineer doesn’t need to know how to solve these problems on a piece of paper. THAT IS WHAT COMPUTERS ARE FOR!

As a Software Engineer, problem solving skills are 80% of software engineering. The syntax of programming and programming well is the difference between a good programmer and a great programmer.

I don’t need to know the mathematics for rotating a point in 3D space. But as a Software Engineer, I do need to know how to find that formula, how to implement it in code and where to use it.

I was passed over for a job because I couldn’t “Write a function to compute the moving average of a stock price.” Heck, I didn’t even know what a “moving average” was. But when I got home I sat down and 20 minutes later I had a nifty little recursive function that answered the question. Why couldn’t I do that in the interview? Because in the interview I didn’t have the resources I would normally have while on the job. A good Software Engineer knows how to use those resources to solve programming problems.

I can’t add in hex. And I really don’t care…

Does that make me a bad programmer?

FWIW, I tried the sample code above using the XOR and OR and it didn’t work for a=3 and b=5.

That use of the binary OR leads me to believe that it’ll only work for powers of 2. (I.e., using | as a substitute for addition will only work as long as they don’t both have the same bits lit up, as 3 and 5 do – both use the first bit.)

I just tested with a=4 and b=16 and it worked. (Compiling with g++)

Is there a version of this that works with numbers that aren’t powers of 2?

I think the problem is that you are hiring college graduates. Hire the natural self-taught talent! Having a CompSci college degree only means that they wasted 4 years (or more) of their lives. Whereas the self-taught programmers were busy writing software during those 4 years. And, why not test the interviewees on something more pragmatic, like create a business object that handles the CRUDs for s simple 3 or 4 property entity (or test them on something else that would be common for your company to write).

I find there are a lot of people with the ability to memorize code and functions, but without the logical side to put it together. So if you ask what a certain does in PHP for instance, they’ll be able to give you the definition. So in their mind the “know programming” but they don’t know how to put the pieces together.

Long live recreational QBasic programming!

FOR i = 1 TO 100
q = 0
p = 0
IF i / 3 = INT(i / 3) THEN
IF i / 5 = INT(i / 5) THEN
PRINT "FizzBuzz"
q = 1
END IF
IF q = 0 THEN PRINT "Fizz"
p = 1
END IF
IF i / 5 = INT(i / 5) THEN
IF p = 0 THEN PRINT "Buzz"
p = 1
END IF
IF p = 0 THEN PRINT i
NEXT i

***This is the stuff that real programming is made of!

[RANT]
I hate it when I see people learning Visual Basic. It’s just so wrong. When I see people trying to figure out to throw an exception, I just shiver! It’s like they miss the whole point of programming in the first place. The point of programming, FYI, is to make a function or group of functions which does something useful.

In my spare time I have created a few QBasic programs which do things like estimate the sine of a value from an infinite sum of square wave, calculate the power in the sine wave harmonics of a square wave, map points in 3d space to points in 2d space (like a graphics card), rotate a four-dimensional object, etc. I’ve also made (well mostly attempted to make) a few neural nets. This is all useful (or at least the type of stuff that could be useful). Making arrays defining functions are all useful things for everything I have done.

I don’t see why exceptions are useful. They are just one of those unimportant, un-needed things that “programmers” learn about.

I personally like to handle every possibility personally in my programs and use deep thought to figure out how to map a particular set of inputs to the desired set of outputs. The VB programmers I know just don’t seem to be that involved in what they are doing. They use VB like they would use Excel. Do you know what I’m saying?
[/RANT]

For all of you self righteous geeks that started your FizzBuzz solutions at 0, your fired (or should I say, not hired) because you don’t know how to follow instructions.

As for most of the others, the same! Your grammer and writing skills suck!

There is a lot more to programming than some clever implementation in a dozen different languages. How many of you really spent 30 minutes on your solution but claimed 4!

Michael, that is creative thinking. You’re hired! (but if you ever do that in production code, I’ll cut your balls off!)

For the people that said the XOR trick would only work for integers… thats not entirely true…

It will work for characters as a single character in memory is really an integer in most languages. For strings you just have to break it down into a character array and use a loop (do/while looking for the null character ‘\0’ at the end of the character array.

Also because of this, if you do actual memory swaps using this method it should be possible to do any other datatype/structure/object though you have to be using a language that will allow you to directly manage the memory.

And for the people that don’t know the XOR trick (and can’t look things up on Google…)
http://en.wikipedia.org/wiki/XOR_swap_algorithm

Oh, by the way, the max of one million was just for benchmarking purposes. Yes, we were comparing implementations…

A recent job I applied for across the country (at the bequest of a friend who later was let go) involved a website with a programming test of ten or so questions of small to moderate difficulty. Most of them said ‘in your choice of programming languages’.

Well, since the friend was the test author, and one of the graders, I decided I’d do what it said, and use an obscure language that, pretty much, he was probably the only one to ever have seen; the embedded language in most TinyMUSH-derived games.

I was rejected out of hand because I didn’t use one of the languages they had expected…or (probably more likely) understood. That was good enough for ME to know that I didn’t want to be there. :slight_smile:

Anyhow…just to add to the list: FizzBuzz in that language, a couple minutes of work, working the first time, with the (stated) assumption that each number’s output will be on a separate line.

@create FizzBuzz
C-FIZZBUZZ FizzBuzz=$fizzbuzz:@dolist lnum(1,100)=@switch/first 0=mod(##,15),@emit FizzBuzz,mod(##,3),@emit Fizz,mod(##,5),@emit Buzz,@emit ##

Programmers cannot program … because interviewers can’t interview.

I think it’s a matter of how easy it seems for a pretender to pass vs the chance to get caught. And obviously people think that it easy to pass an interview even it is not the right job for them (assuming they have a clue that they cannot fulfill the position). I just guess the passed in the past!
And what about the quality of testimonials from previous jobs?

Some of the problem has to do with college. A great many schools are selective because there is only a very limited type of student that the teachers will be able to educate. Most schools are ordeals of initiation, especially for undergrads, rather then places of learning. This is especially true for professions like medicine and law, where the real acquisition of knowledge starts at the post-graduate level.

I’ve had the Reverse Dumb-Ass Test Death Kick done to me. I took a course in number theory, went in to take the test, and had softball questions lobbed at me; better yet, I knew the answers to the questions!

Unfortunately, I wrote the numeral ‘1’ with a serif on the bottom, and the professor insisted I wrote a ‘2’. Telling him I wrote a ‘1’ did not change his mind.

Shortly after this experience, I decided that most universities are a waste of time, and decided to go learn things on my own.

To Toepopper,

Your interview question to swap the value of two variables with out using a temp variable is technically impossible. Just because you don’t declare a temp variable, the operation a=a+b, uses a temp variable created on the fly. The operation b=a-b, uses a temp variable created on the fly. And the operation a=a-b, uses a temp variable created on the fly. In fact technically three temporary variables are created to perform these three operations…you just didn’t declare them.

Hmmm,
All this makes me wonder: “Why can’t I find a decent programming job?” I can add in hex, and I thought up ways to write the fizzBuzz application in a plethora of different languages/methods.

And it makes me sad to think that this is the state that programming is in, and we wonder why we have software that doesn’t work.

[sigh]

Spencer asked “Does anyone have a link to more programming exercises that I could do?”.

Check out www.projecteuler.net - The problems posted there require short programs but most also require a lot of thought. Depending on the language you use, you might have to borrow or write your own large integer class.

I think interview testing can be useful for both the employer and candidate. As a candidate for a job, I always give the following test to the employer. It is very simple:

What do the following acronyms stand for and if you get that far then give me a one-liner describing each:

SRP, OCP, DIP, LSP, ISP

If one or more of the technical people at the potential employer knows what these acronyms stand for and, even better, they know what they mean then I will consider working for them.

Never let the interviewer ask all of the hard questions.

You all have it wrong, the answer is simply:

System.out.println(“the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.”);

duh…

I welcomed Jeff’s mention of FizzBuzz. As a novice (and I mean brand-spanking new) programmer being given a “challenge” like that is fun. Currently, I’m in college taking some programming courses. We’re learning C# and ASP.NET. So I wrote my own little solution to FizzBuzz in C# via ASP.NET. Even though Jeff’s remarks about developers “feverishly posting solutions” is funny, I rather liked seeing how others did it. I realize that with every problem there is more than one way to do it. What really got me confused was trying to figure out what language each poster was using.
Does anyone have a link to more programming exercises I could do? The exercises from the book aren’t “real” enough. They ask me to create snippets of code that do something that really isn’t useful, but it does test to see if I learned the topic from that chapter. I’d rather make something semi-useful rather than "Create a page in ASP.NET that displays a pop-up message when you click the button."
Thank you in advance.

DarkChucky - that won’t work. The situation where it’s a multiple of 3 AND 5 will fall into the first part of the if and never make it to the i%5==0 i%3==0 line. That check needs to be first.