Re:Interviewing programmers: coding test example explained
by ComSubVie on Thursday June 03, 2010 @09:44AM
(#1401254)
I think he used p_rite so that the variable names length is identical to p_read, which can make the code look more pretty.
[ Parent
| on HN ]
Re:Interviewing programmers: coding test example explained
by jemfinch on Thursday June 03, 2010 @11:12AM
(#1401513)
In that case, I'd suggest `p_rd` (well, IMO, just `rd` would suffice) and `p_wr`. Then they're both fairly unambiguous abbreviations.
Re:Interviewing programmers: coding test example explained
by dkersten on Thursday June 03, 2010 @01:58PM
(#1401976)
I think p_wt is better than p_wr. Honestly though, aligning the length of variable names is, in my humble opinion, retarded - he should have went for p_read and p_write.
Re:Interviewing programmers: coding test example explained
by nickelplate on Thursday June 03, 2010 @02:25PM
(#1402049)
"aligning the length of variable names is, in my humble opinion, retarded"
I feel the same way.
Re:Interviewing programmers: coding test example explained
by ori_b on Thursday June 03, 2010 @02:48PM
(#1402118)
I'd probably go with just 'r' and 'w', or 'src' and 'dst'
Re:Interviewing programmers: coding test example explained
by aquark on Thursday June 03, 2010 @09:59AM
(#1401301)
I like having the variables the same length from an aesthetic point, but my brain also flags 'rite' as being spelled wrong and that detracts (albeit slightly) from reading and understanding the code.
Re:Interviewing programmers: coding test example explained
by pavel_lishin on Thursday June 03, 2010 @01:02PM
(#1401837)
Yes, but less readable. This is a trivial, sure, but I really dislike seeing misspelled variables. My favorite, of course, is $cue, which usually (but not always) means that the variable in question is related to a queue.