flwyd: (java logo)
[personal profile] flwyd
I created a fairly simple programming exercise for job candidates. It's not trivial, but it's not super hard. Someone who's written programs before and can figure out the solution should be able to write the program in two hours or less. The problem description says "Your program should read from standard input (stdin) and write to standard output (stdout). Sample input and output are available."

I'm rather dismayed by the number of submissions which don't read from standard input or output. The most common violation is using a hard-coded path like C:\input.txt (tip: I'm not running Windows, I don't have a C: drive; even if I did, I wouldn't have the sample input there). Other violations include requiring filenames on the command line (not terrible), prompting for all values interactively in such a way that I can't just run cat input.txt | program, and one submission in PL/SQL that hard-coded the sample input as a bunch of INSERT statements. Tip: I put "use stdin and stdout" in the instructions so that you didn't have to bother with all the file opening and closing details. Also, do they not teach students to run their programs before submitting them? Running a submission on input bundled with the problem shouldn't throw an error before producing any output. Maybe students don't know how to use a command line environment any more and I/O redirection is a foreign concept.

Do today's computer science students really not know what standard input and output are? Do they really have assignments that say "Read this file from C:\Homework\Problem1?" My hope was to create an evaluation script that ran several files through submitted programs and report a correct answer rate. But when correct programs are little more likely to read from stdin, I can't even write a script capable of getting an answer.

Punks.

Date: 2008-09-11 09:48 pm (UTC)
From: [identity profile] altamira16.livejournal.com
From my attempts at taking a computer science class, a lot of problems are toys. They are asked to interact with classes that have been built by the instructor or to use them to build larger classes. Were these people really CS majors?

Date: 2008-09-11 10:34 pm (UTC)
From: [identity profile] mackys.livejournal.com
You'll may have better luck if you tell them that the file is coming in on System.in and to send their output to System.out.

Now, if they say, "What's System.in?"... well...

Date: 2008-09-11 10:39 pm (UTC)
From: [identity profile] flwyd.livejournal.com
Applicants are allowed to use any programming language they choose, but I suppose I could enumerate some common terms.

"We invoke god of standard input, who has been called of old 'stdin,' 'STDIN,' "System.in,' and 'Console.ReadLine...'"

Date: 2008-09-12 12:07 am (UTC)
From: [identity profile] clarsa.livejournal.com
I'm doing a project for a Christmas present for my mom. I had a bunch of t-shirts made up, and I'm sending them out to family and friends to get them to take pics in the t-shirts and send them to me to make a slide-show.

So to my fam and friends I write: Please send me your t-shirt sizes and mailing address.

Almost every single one of the responses left out one or the other. Including my aunt's, and she's a high school English teacher.

Maybe it's not a programming error. Maybe it's a "READ THE DIRECTIONS!" error. My experience is that, when people have trouble finding the answer, 90% of the time it's because they didn't pay proper attention to the question.

Date: 2008-09-12 12:10 am (UTC)
From: [identity profile] flwyd.livejournal.com
I have higher standards for computer science students because 75% of computing is understanding directions.

Date: 2008-09-12 05:57 pm (UTC)
From: (Anonymous)
I'm no programmer, but couldn't your assignment be completed with one or two lines of Perl? With that fish-face thing? (<>)? Or am I thinking of something totally different?

And yes, I'm guessing with all the cutesy little GUIs out there for programming, a good chunk of the students have no idea what some of the most basic concepts mean. stdin and stdout ignorance are just the tip of the don't-know-don't-get iceberg.

Date: 2008-09-12 06:00 pm (UTC)
From: [identity profile] flwyd.livejournal.com
Yes, the "fish-face thing" in Perl makes it trivial to read lines of standard input. The program is more than just two lines in perl; it involves building and navigating a graph with some constraints. But I designed the problem so that you could do all the I/O in two lines of Perl because text file I/O is the sort of thing that should be idiomatic.

Date: 2008-09-12 06:01 pm (UTC)
From: [identity profile] murasaki-suki.livejournal.com
Whoops, that was me. Didn't notice I was logged out (speaking of not paying attention...) :)

Date: 2008-09-15 01:01 pm (UTC)
From: [identity profile] billingb.livejournal.com
I think at least part of the problem has to be Windows. When I have come across developers who did school using Windows they tend to be much much less comfortable with any interaction outside the program. That is not really an excuses but I think it does cause a problem.

I guess this is my own issue with how people are prepared but I am very surprised how many software developers don't know how to use their computer. They are not comfortable with things like piping input from program to program. At Xilinx I had a fellow developer ask me how I was doing a lot of tasks. Most of them boiled down to using ps, grep and other common unix tools and piping them together. I was blown away that he didn't know how to do any of this.
December 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2025

Most Popular Tags

Expand Cut Tags

No cut tags
Page generated Monday, January 5th, 2026 09:45 am
Powered by Dreamwidth Studios