?

Log in

No account? Create an account
Trevor Stone's Journal
Those who can, do. The rest hyperlink.
Lack of Standards Coming Out of School? 
11th-Sep-2008 03:25 pm
java logo
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.
Comments 
11th-Sep-2008 09:48 pm (UTC)
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?
11th-Sep-2008 10:34 pm (UTC)
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...
11th-Sep-2008 10:39 pm (UTC)
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...'"
12th-Sep-2008 12:07 am (UTC)
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.
12th-Sep-2008 12:10 am (UTC)
I have higher standards for computer science students because 75% of computing is understanding directions.
12th-Sep-2008 05:57 pm (UTC)
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.
12th-Sep-2008 06:00 pm (UTC)
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.
12th-Sep-2008 06:01 pm (UTC)
Whoops, that was me. Didn't notice I was logged out (speaking of not paying attention...) :)
15th-Sep-2008 01:01 pm (UTC)
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.
This page was loaded Oct 15th 2018, 10:36 pm GMT.