Hacker News new | past | comments | ask | show | jobs | submit | swish_bob's comments login

i was so disappointed when I realised they were emulating a USB keyboard to enter the PINs. That first picture made me think they had a actual robot finger for a moment ...


I am and have done both. I tend to prefer a functional style, but even then I'm going to be using classes (or a similar construct) for quite a lot of problems.


I came here to talk about Liskov, but since you beat me to it I'll mention SOLID principles of class design instead, which it really sounds like the OP isn't aware of or just isn't following and it feels like is the source of a lot of their class based woes.


Dunno, watching people cat something then pipe it to grep drives me up the wall. I'll let piping grep to wc -l instead of just using -c pass this time though.


I prefer cat-then-pipe while using shell interactively. It's easier to add things to the middle of the pipeline. You simply move the cursor the pipe character, and type another command.

Original:

  cat error.log | grep 'ERROR:' | wc -l
After change:

  cat error.log | grep -v 'SENSITIVE' | grep 'ERROR:' | wc -l
But with cat-less version, you have to think and sometimes even move things around.

Original:

  grep error.log 'ERROR:' | wc -l
After change:

  grep -v 'SENSITIVE' error.log | grep 'ERROR:' | wc -l
Moreover, some commands behave differently in cat-less mode. For example, gzip:

  gzip file.js | wc -c # oops, we've just removed file.js
  cat file.js | gzip | wc -c # shows compressed size


And a late 80s early 90s children's TV programme.


"Are your parents proud of what you do for a living?" is quite effective.


Why it exists ought to be explained by the existence of a test.

This isn't always possible, but it's far more possible than many developers seem to think.


That just makes two things that need to be commented doesn't it?

When I read code I care about what the code is supposed to do and why it's supposed to do that.

There is code that passes the current tests and is logically sound but no longer fits the business requirements. Knowing that it was implemented to solve a certain use case helps the reader / reviewer see whether the code and the test still fit or if they should be updated.

The best comments I've come across comment the intention and any context that isn't immediately obvious from the function.


Your test should explain what it's testing. Via it's name or some other mechanism. Otherwise how do you know what's gone wrong when it fails?


That other mechanism is comments.


Does that explain why, though? It explains that it's there, and someone obviously wanted it to be, but it still doesn't get at the why. I've found that most of the logic I'm left scratching my head at is due to some business rules that there's no better way to deal with - even if a test exists for it I still can't figure out what the tests purpose was, other than to just verify that it's working.


It's (mostly) a broadcast service. Them metaphor in this case, it's the radio station boosting your signal ...


I remember trying to create an MHD proof of concept in physics at school after reading the book, well before the movie was released. I thought it was inspired by the book ...


I particularly enjoy IntelliJ's local history, which will go so far as to tell me whether the tests were passing or failing (and how many failed) on a specific file at a specific point in time.


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: