News for hackers. Stuff that matters.
Re:Job Description as runnable python UnitTest by mahmud on Friday September 03, 2010 @07:10AM (#1659175)
Heh, job teasers are getting simpler and simpler. I remember in the late 90s they were "compile with GNU/Sun/SGI/HP toolchain, call the phone number that gets printed when you build on a big/small-endian machine".

The early ones were funky C compiler weirdnesses that exploited word size, endianness, binary format and other machine quirks. This one is practically readable.

Re:Job Description as runnable python UnitTest by ciupicri on Friday September 03, 2010 @08:05AM (#1659274)

    print "2. Fork out this code, suggest improvements and submit those" [L141]
So fork the code and suggest something funkier.

[L141] http://github.com/praekelt/careers/blob/master/software_engi...

Re:Job Description as runnable python UnitTest by craigts on Friday September 03, 2010 @09:03AM (#1659396)
print("2. Fork out this code, suggest improvements and submit those")

There fixed it for you :)

Re:Job Description as runnable python UnitTest by ciupicri on Friday September 03, 2010 @09:22AM (#1659446)
They might be using RHEL (Red Hat Enterprise Linux) which comes with Python 2.4 and in 2.4 you can't use print as a function.

LE: python 2.5 -> 2.4 (bconway was right)

Re:Job Description as runnable python UnitTest by bconway on Friday September 03, 2010 @09:38AM (#1659489)
Two corrections:

A.) RHEL 5.x (by default) comes with Python 2.4, not 2.5.

B.) Yes you can. It is required in 3.x, though.

Re:Job Description as runnable python UnitTest by kingkilr on Friday September 03, 2010 @10:31AM (#1659669)
Well you can't use it as a function. You can however combine the parsing of the "print" keyword, and the "(" and ")" taking precedence around the string to form KEYWORD STRING that looks a hell of a lot like a function call though.
Re:Job Description as runnable python UnitTest by koenigdavidmj on Friday September 03, 2010 @04:19PM (#1660981)
Actually, print(one single argument) works the same in both Python 2 and 3.
Re:Job Description as runnable python UnitTest by ciupicri on Friday September 03, 2010 @04:35PM (#1661053)
Do you mean as in x = (x) = ((x)) = ...? In this case you're right, although it's still not a function.
Re:Job Description as runnable python UnitTest by smn on Friday September 03, 2010 @07:14AM (#1659189)
true, blame Python :)
Re:Job Description as runnable python UnitTest by njharman on Friday September 03, 2010 @11:05AM (#1659794)
1) I'm annoyed I can't enjoy looking at clouds (which I really do) and pass their test.

2) I'm annoyed by companies who think working for them is some great gift to me. Various wordings in this test exuded that attitude.

Re:Job Description as runnable python UnitTest by smn on Friday September 03, 2010 @11:21AM (#1659847)
2 - wasn't intentional, what wordings exude that attitude in your opinion?
Re:Job Description as runnable python UnitTest by njharman on Tuesday September 07, 2010 @02:11PM (#1669582)
I went back to find specific things for you and couldn't. The idea of "tricky" "test" is off putting. Making me jump through hoops just for the "honor" of being a possible candidate.

OTOH, I could have just been a bad mood that day.

Re:Job Description as runnable python UnitTest by eitally on Friday September 03, 2010 @07:08AM (#1659171)
I appreciate the concept but it's too readable. If you're going to do something like this as an actual test, why not funkify it a little bit to challenge the candidates?

Still, great idea! Coming up next -- Job Description as an infographic!

Re:Job Description as runnable python UnitTest by d0m on Friday September 03, 2010 @08:11AM (#1659281)
I think they're searching hackers who like clean code and who appreciate tests. It would be strange if they wanted to recruit this kind of people by writing obfuscated code.

Also, it's more for fun then anything else. I mean, this could have been simply written on a pdf with: Django experience, >10, etc.

Re:Job Description as runnable python UnitTest by smn on Friday September 03, 2010 @07:12AM (#1659182)
Yeah, truth in that. I'm needing to write a couple more like this, this is the first one. Next one will be an job description for a DB guy with interest in databases in the broadest sense. Not sure how to go about that one yet.

I like the infographic idea, any other suggestions?

Re:Job Description as runnable python UnitTest by RyanMcGreal on Friday September 03, 2010 @07:48AM (#1659247)

    select *
    from job_candidates
    where interest > 0
    order by interest desc
Re:Job Description as runnable python UnitTest by mahmud on Friday September 03, 2010 @07:21AM (#1659200)
I am sure eitally was being sarcastic.

Also, why are you attempting to recruit people who are interested in a subject "in the broadest sense", as opposed to people who live and breath the damn thing?

Recruiting people of marginal interest and passing familiarity sounds like a recipe for mediocrity, imo.

Re:Job Description as runnable python UnitTest by smn on Friday September 03, 2010 @07:26AM (#1659207)
Maybe my bad choice of words. In the "broadest sense" I meant that we're looking for a DB person who's interested in both relational DBs as well as the complete other side of the spectrum.

Still, I think a tongue in cheek infographic could be pretty cool as a job description. True, maybe not so much for databases.

Re:Job Description as runnable python UnitTest by eitally on Friday September 03, 2010 @09:44AM (#1659503)
Yep, but the infographic idea does sound fun. It might make more sense as a resume for a creative than a job posting, though.
Re:Job Description as runnable python UnitTest by jimbokun on Friday September 03, 2010 @09:29AM (#1659463)
As a job candidate, seeing funkified code would cause me to worry that all of their code looked like that and make me less likely to apply.
Re:Job Description as runnable python UnitTest by emehrkay on Friday September 03, 2010 @07:50AM (#1659249)
Give the candidate 10/15 before the interview to complete this. Run it and if it fails thank them for their time.

I just might do something like this with some html/css/javascript.

Re:Job Description as runnable python UnitTest by famousactress on Friday September 03, 2010 @11:32AM (#1659894)
(sorry, gut reaction). This feels like a company who wants to seem like a company I want to work for.
Re:Job Description as runnable python UnitTest by drv on Friday September 03, 2010 @03:41PM (#1660835)
Some of these tests seem backwards:

"10 years software development experience." is translated as

   assert candidate.results['started_programming'] <= years_ago(10)
That reads like "10 years or less" rather than "10 years or more"; I'd be wary of applying to a place that can't even get that right (although maybe your first job can be fixing their ad).

Edit: Reading more closely, perhaps years_ago(10) returns the numeric year that was 10 years ago now, and 'started_programming' is an absolute year as well, in which case this test makes more sense. However, it's not intuitive to read this way...

Re:Job Description as runnable python UnitTest by jimbokun on Friday September 03, 2010 @09:59AM (#1659558)
Python scope still freaks me out.

It's weird to me that the "candidate" referenced by FoundationEngineerTestCase is the same candidate instantiated at the bottom of the file, without ever being explicitly passed into an instance of that class. I would have expected:

    test_program = CandidateTestProgram(candidate)
Furthermore, how is CandidateTestProgram connected to FoundationEngineerTestCase? Does it do a global search for subclasses of unittest.TestCase, then instantiate and execute them?
Re:Job Description as runnable python UnitTest by digitallogic on Friday September 03, 2010 @10:59AM (#1659774)
Referencing the 'candidate' variable from within the test case is not a good approach as it's referencing a module global instead of an attribute. Additionally, it only exists when the module is executed directly, so if it's imported and run in a different manner a name error will result for every test that references.

As for the TestProgram, it's inheriting routines from the base class in the unittest module that do introspection to find all test fixtures.

Re:Job Description as runnable python UnitTest by pdelgallego on Friday September 03, 2010 @08:40AM (#1659347)
It would be better if you just write the test, so the candidate in order to apply should fork, write a Candidate class and pull a request.

BTW the position is in Cape Town?

Re:Job Description as runnable python UnitTest by smn on Friday September 03, 2010 @08:47AM (#1659362)
not necessarily, but would be nice.