SilasBarta comments on Open Thread: March 2010, part 2 - Less Wrong
You are viewing a comment permalink. View the original post to see all comments and the full post content.
You are viewing a comment permalink. View the original post to see all comments and the full post content.
Comments (334)
Programming is different from medicine. All the good programmers I know have learned their craft on the job. Silas doesn't have to wait and learn without getting paid, his current skill level is already in demand.
But that's tangential. More importantly, whenever I hear the word "maintainability" I feel like "uh oh, they wanna sell me some doctrinaire bullshit". Maintainability is one of those things everyone has a different idea of. In my opinion you should just try to solve each problem in the most natural manner, and maintainability will happen automatically.
Allow me to illustrate with an example. One of my recent projects was a user interface for IPTV set-top boxes. Lots and lots of stuff like "my account", "channels I've subscribed to", et cetera. Now, the natural way to solve this problem is to have a separate file (a "page") for each screen that the user sees, and ignore small amounts of code duplication between pages. If you get this right, it's pretty much irrelevant how crappily each individual page is coded, because it's only five friggin' kilobytes and a maintenance programmer will easily find and change any functionality they want. On the other hand, if you get this wrong... and it's really fucking distressing how many experienced programmers manage to get this wrong... making a Framework with a big Architecture that separates each page into small reusable chunks, perfectly Factored, with shiny and impeccable code... maintenance tasks become hell. And so it is with other kinds of projects too, in fact with most projects I've faced in my life. Focus on finding the stupid, straightforward, natural solution, and it will be maintainable with no effort.
Sorry for not reading the follow-up discussion earlier.
What do you mean by this? How can I be hired for programming based on just what I have now? Who hires people at my level, and how would they know whether I'm lying about my abilities? (Yes, I know, interviews, but to they have to thin the field first.) Is there some major job finding trick I'm missing?
My degree isn't in comp sci (it's in mech. engineering and I work in structural), and my education in C++ is just high school AP courses and occasional times when I need automation.
Also, I've looked at the requests on e.g. rent-a-coder and they're universally things I can't get to a working .exe (though of course could write the underlying algorithms for).
The best 'trick' for job-finding is to get one from someone you know. I'm not sure what you can do with that.
Generally speaking, there are a lot of people who aren't good at thinking but have training in programming, and comparatively not a lot of people who are good at thinking but not good at programming, and the latter are more valuable than the former. If I were looking for someone entry-level for webdev (and I'm not), I'd be likely to hire you over a random person with a master's degree in computer science and some experience with webdev.
Heh, that's what I figured, and that's my weak point. (At least you didn't say, "Pff, just find one on the internet!" as some have been known to do.)
Thanks. I don't doubt people would hire me if they knew me, but there is a barrier to overcome.
I'm sorry to be the one to break the news to you, but the IT industry has appallingly low standards for hiring.
For instance, you may be able to get a programming job without at any point being asked to produce a code portfolio or to program in front of an interviewer.
I'd still be keen, by the way, to help you through a specific example that's giving you trouble compiling. I believe that when smart people get confused by things which their designers ought to have made simple, it's an opportunity to learn about improving similar designs.
A quick solution to the FizzBuzz quiz:
*in ur LessWrong, upvotin' ur memez*
For the first time here I'm having a Buridan moment - I don't know whether to upvote or downvote the above.
It might help to note that dialects - and I don't see any reason not to consider both the various kinds of 'netspeak and the various programming languages as such, in most cases of human-to-human interaction - are almost exclusively used as methods of signaling cultural affiliation. In this case, I parsed Bogus' use of 'netspeak as primarily an avoidance of affiliation with formal programming culture (which tends to linger even when programs are set out in standard English, in my experience), and secondarily a way of bringing in the emotional affect of the highly-social 'netspeak culture.
It is 'mammal stuff', but it seems to be appropriate in this instance, to me.
Thanks. I was mostly kidding, but I appreciate the extra perspective.
(Signalling my own affiliation as a true geek, I actually attempted to download a LOLCODE interpreter and run it on the above, but the ones I could get my hands on seem to be broken. I would upvote it if I could run it, and it gave the right answer.)
integer var
while(1)
{
++var
if (var % 15 == 0)
else if (var % 3 == 0)
else if (var % 5 ==0)
else
if !(var<100)
}
Looks right to me, though I wound up reformatting the loop a little. That's most likely a result of me being in the habit of using for loops for everything, and forgetting the proper formatting for other kinds, rather than being an actual flaw in the code - I'm willing to give bogus the benefit of the doubt about it, in any case.
Pretty much. Both you and bogus apparently forget to put an initial value into var (unless your language of choice automatically initializes them as 0).
Using while(1) with a conditional return is a little bizarre, when you can just go while(var<100).
Of course, my own draft used if(var % 3 == 0 && var % 5 == 0) instead of the more reasonable x%15.
Mine does, but I'm aware that it's good coding practice to specify anyway. I was maintaining his choice.
Yep, but I don't remember how else to signify an intrinsically infinite loop, and bogus' code seems to use an explicit return (which I wanted to keep for accuracy's sake) rather than checking the variable as part of the loop.
My method of choice would be for(var=0; var<100; ++var){} (using LSL format), which skips both explicitly returning and explicitly incrementing the variable.
Jeff Atwood also makes this meta point about blogging about fizzbuzz:
Somehow, the other responses to this comment reminded me of that.
Somehow, I believe this is my fault for having mentioned trying it myself, and for that, I apologize.
If all you have is regex s/.+/nail/
Warning: Do not try this (or any other perl coding) at home!
I think anyone who applies to a programming job and can't write this (in whatever language) deserves something worse than being politely turned down.
I tested myself with MATLAB (which makes it quite easy) out of some unnecessary curiosity - it took me about seven minutes, a fair part of which was debugging.
I feel rather ashamed of that, actually.
As everyone else seems to be posting their code:
A better program (by which I mean "faster", not "clearer" or "easier to modify" or "easier to maintain") would replace the tests with something less intensive - for example, incrementing two counters (one for 3 and one for 5) and zeroing them when they hit their respective desired factors.
I wouldn't be; I'd take it as (anecdotal) evidence that the craft of programming is systematically undertaught. By which I mean, the tiny, nano-level rules of how best to interact with this strange medium that is code.
(Recently added to my growing backlog of possibly-top-level-post-worthy topics is "how and why programming may be a usefull skill for rationalists to pick up"...)
I have to admit, I was looking up functions in the docs, too - I would have been a bit faster working in pseudocode on paper.
Edit: Also, my training is in engineering, not comp. sci. - the programming curriculum at my school consists of one MATLAB course.
Querying my brain for cached thoughts:
Programming encourages clear thinking - like evolution, it is immune to rationalization.
Thinking in terms of algorithms, rather than problem-answer pairs, and the former generalize.