Advertisement

What should you send a company that requests code samples?

Started by April 03, 2008 06:04 AM
12 comments, last by Vectorg 16 years, 7 months ago
Quote: Original post by Halma
What I'm saying is, if the company sees your code and it looks clean, how can they know that you're not a sloppy programmer that just managed to clean up one project?

Because everyone has there own opinions on what constitutes "clean" code, and will go to varying degrees of effort to achieve it. A sloppy programmer who uses gotos copiously and tidies it up before sending it off is likely to still end up with code containing convoluted logic, just without the gotos. At the other end of the scale, a good programmer might overlook or forget about a goto added as a quick hack, but the rest of the code would probably show that it's not the usual practice.
Thanks for the input, everyone.

BTW, I'm not that "bad" a programmer, and I don't write terribly sloppy code. I just don't have a lot of comments, and I use an occasional goto. (Occasional means maybe once every couple thousand lines of code.)
Advertisement
Still too often. I don't think I've ever used goto in C++ in over 10 years, including 5 years as a professional programmer. I don't say it should never be used, but I haven't needed it in games, software 3D engines or client-server applications :)
A goto is fine as long as it isn't used to loop upward, just downward, and only a small distance. I'd hire you. You'd be my go-to guy.

Commented code is okay, but some of the hardest code to read is the NeHe code in which many lines are commented like the following:

height=1; // Making Height Equal One

Don't rig your code to be phony, and don't lie on your resume. They'll eventually find out the truth about both.

This topic is closed to new replies.

Advertisement