Live data from Hacker News

I Hate Puzzles: Am I Still a Programmer? (2011)

zef.me

241–250 of 268 posts

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#241

Earlier quoted context omitted.

You realize that regexes, fft and canvas APIs can be seen as the same kind of thing - as simply tools - as unit tests, Ruby and SOLID (whatever that is)? Some tools are usable in more contexts, but you can still lead a perfectly healthy life if you are in a domain where the ones you don't know are not needed.

SOLID is a set of (possibly questionable) religious principles often espoused by OOP programmers. It tends to boil down to "keep things modular and don't break abstractions", with specifics guidelines for dealing with objects and inheritance.

> SOLID is a set of (possibly questionable) religious principles often espoused by OOP programmers

Exactly my opinion

There's a good side to it, but it's mostly used for people to (in a cargo-cult way) abuse OO and replace simple computations with something spread over 5 levels of inheritance and lots of different types.

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#242
post #62

> I’ve been programming for 18 years now. Then congratulations, you are a programmer! Despite what you'll hear from people peddling various flavors of Kool-Aid, "programmer" isn't a personality type. It's a job description. If you program, you are a programmer, end of line, full stop. Don't let anyone convince you otherwise.

Once upon a time I was a programmer, building CRUD apps for enterprises. I hated puzzles, too. Then I discovered quicksort, and graph search, and Bayesian inference, and Dijkstra, and Karatsuba. I'm still a programmer, but now I love puzzles, too.

As long it is

>>I'm still a programmer, but now I love puzzles, too.

Its perfectly alright. But this generally becomes.

I'm still a programmer, but now every one should love puzzles, too.

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#243

Earlier quoted context omitted.

I thought about it like that : since the one whos cost is 1 is a good roamer he should get each of the other ones? This looks too damn easy?

That's a good solution to start off with, but given the current costs, it's not the most optimal one. A lot of time is wasted by sending C and D to cross independently. If you manage to get them to cross together at one point, you will ultimately save some time.

[deleted]

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#244

Earlier quoted context omitted.

I thought about it like that : since the one whos cost is 1 is a good roamer he should get each of the other ones? This looks too damn easy?

That's a good solution to start off with, but given the current costs, it's not the most optimal one. A lot of time is wasted by sending C and D to cross independently. If you manage to get them to cross together at one point, you will ultimately save some time.

Oh,yeah right!

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#245

Earlier quoted context omitted.

I thought about it like that : since the one whos cost is 1 is a good roamer he should get each of the other ones? This looks too damn easy?

That's a good solution to start off with, but given the current costs, it's not the most optimal one. A lot of time is wasted by sending C and D to cross independently. If you manage to get them to cross together at one point, you will ultimately save some time.

Okay, so my best bet is that the optimal solution is 17 minutes.

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#246

>Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge? 17 minutes, if you…

In the real world, a light source has a useful radius of illumination. This could be exploited. If the useful radius is greater than half the span of the bridge, everyone can cross the bridge in exactly 10 minutes. If the useful radius of the torch is 25% the bridge length, the bridge can be crossed in 15 minutes. So the correct answer to the puzzle question is "how much of the bridge does the torch illuminate?" Then…

[deleted]

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#247

>Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge? 17 minutes, if you…

In the real world, a light source has a useful radius of illumination. This could be exploited. If the useful radius is greater than half the span of the bridge, everyone can cross the bridge in exactly 10 minutes. If the useful radius of the torch is 25% the bridge length, the bridge can be crossed in 15 minutes. So the correct answer to the puzzle question is "how much of the bridge does the torch illuminate?" Then…

I don't think that would make the person who's interviewing you very happy.

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#248

Earlier quoted context omitted.

I do, if it will actually save me something. Usually, I don't need anything that actually requires me looking up or constructing a super complicated regular expression. Per your example, I code in a functional language. I'm even less likely to make a mistake if I just reuse the function, than I am to apply a regex.

You don't have to look up how to use regex if you know how to use regex. If you just learn how to use the tool already--which isn't very hard, the syntax is quite limited and the salient points are nearly universal between all regex engines--then the stuff isn't "complex". It's as complex as C or Javascript or Scheme was on your first day of learning it. Less so, because there is less to learn. The example is arbitra…

Clarification: I know how they work. What I -don't- bother keep in my head, is every metacharacter, character class (POSIX especially), assertions, string replacement options, etc, because I can just look those up. The example mentioned above is actually a really good case of why I don't worry about remembering all the specifics; because it's really easy to screw it up. Oh, I forgot {} were special characters, because I have -never- used them (any time I needed repetition it was always so few times, and for a single character class, I just repeated the character in the pattern), so I forgot to escape them.

And let's not forget the implementation different specifics (the need to specify multiline matching as a separate parameter into the parser, \ vs $ for string replacement, etc)

In general, if I'm writing a regex more complicated then "Hey, does this string match this literal?" I'm going to pull up a cheat sheet, because it avoids issues like that. But the number of times it makes sense to do that is really, really low.

It makes as much sense to me to say you should remember all ASCII character codes. Why? If you know how they work, and you're not using them enough to remember all of them automatically, it's not really a problem to just look them up if/when you need them.

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#249

Dijkstra commented on this multiple times (e.g., https://www.google.com/search?q=dijkstra+puzzle+minded+ewd+s... ). "I still often hear that a successful programmer should be 'puzzle-minded' whereas I have the feeling that a clear and systematic mind is more essential. A modern, competent programmer should not be puzzle-minded, he should not revel in tricks, he should be humble and avoid clever solutions like the pla…

Every time I hear the "cleverness" argument I can't resist posting this counter-argument:

http://www.linusakesson.net/programming/kernighans-lever/

Re: I Hate Puzzles: Am I Still a Programmer? (2011)

#250

This is what really irks me about the industry as a whole. Large companies like Facebook and Google have hiring processes in place that aim to weed out the strong from the weak by making them solve complex algorithmic puzzles and solve them on a whiteboard, and for larger companies like Facebook or Google who have massive troves of data, this kind of makes sense to me, but only if you're hiring a programmer to work w…

New web frameworks are making web development a more difficult problem, and Google's biasing of their hiring process towards "puzzle-solvers" has given birth to the poster-child of such complexity: AngularJS. AngularJS takes web development from something inelegant but simple into something inelegant and convoluted. I miss the days when web developers didn't need to add "transclusion," "directives", and "providers" i…

The only problem is companies who think web frameworks are obligatory. (And that sites not using them are somehow not as desirable.)
Post reply on HN