Monday, February 4, 2008

Programming Puzzlers

So, I'm going to try and do this as a weekly thing. Please do not post your answers in the comments, if you're really bugging for an answer, feel free to e-mail me.

So, without further adieu, the weekly column:

Programming Puzzlers!



There is a a well known interview question known as the 'FizzBuzz' Question. It asks for you to write a program with the following requirements:

Print 1 to 100 on separate lines to the console, unless
1. The number is divisible by 3, then print "Fizz"
2. The number is divisible by 5, then print "Buzz"
3. The number is divisible by both 3 and 5, then print "FizzBuzz"

This is a very simple question that, apparently, a lot of interviewees fail (find a new career, smart guy). My question is not can you program it; my question is, can you program it only using one line?

And, no, removing the whitespace from your program does not count as one line! Keep in mind this is just a puzzle, something to think about, a way to figure out how to abuse language features. If you ever think coding the way I'm asking you to right now is a good idea, punch yourself in a jaw, twice.

Tuesday, January 22, 2008

It starts

So, you've found my blog. After many months of contemplating starting a programming blog, I've finally pulled the trigger.

Here I will be expressing my thoughts and views on programming in todays enterprise world and I'm sure I'll drop a tutorial or how-to in leading edge technology post every once and awhile.

Also, I'm not phenomenal at spelling and grammar. I am going to try and keep these posts reviewed by people who are good at those sorts of things. This is a short coming of mine, and I am aware of it, you do not need to tell me again! If you feel the need to point out that I spelled something wrong, or I missed a coma (<-- GET IT!), or used the wrong... blah blah blah, don't.

Now lets talk about the name. No, I do not have bipolar disorder (though the variance in my posts may make you think I do). It's named after the 'record label' I released my old band's CD on. It's a math reference. Polar... GET IT? If you don't, learn math, or go READ! (I've done the leg work for you, don't be lazy).

DISCLAIMER: You will find posts here to be somewhat extremely elitist, this is because I am smarter than you. If you cannot take my posts with a grain of salt, do not read them. Do not flame on this blog. If you disagree with the post, feel free to comment with your thoughts, but please, please, please, write a draft, have someone peer review it, re-write the draft, get another peer review and THEN post it.

DISCLAIMER TO THE DISCLAIMER: No, I don't think I'm smarter than you. Read the disclaimer.