1. What makes you say your code isn't working?
2. What did you expect your code to do and why?
3. What did your code do instead and how do you know?
John Collison (of Stripe)
Yesterday I had a problem with Seaside linking to a stylesheet multiple times (don’t ask). After 15 minutes I gave up and decided to ask Patrick. He wasn’t on MSN and I was about to email him asking him to when I realised I prod him onto MSN a lot – the time I spend sending him emails to go on is an inefficiency. I decided to write a script to be able to poke members of the Auctomatic team from the command line. After 15 minutes of debugging (I could have sworn it was chomp that takes off trailing new newlines. Maybe I was just hungry) it was finally working and at my shell I simply had to enter:
$ poke p
Of course, emailing him would have just taken 10 seconds more so I’ll have to do a lot of poking before I can chalk this up as a saving
Stuff I Learn While Going Through the USACO Puzzles:
Crap, already behind schedule. It was time to pull out the big guns. It was then that I applied the most valuable skill I learned from my 4 year degree in Computer Science and 2 years working at a big tech company: looking things up on Google.
Do what you want to be in the mood to do. You can also get stuff done that you don’t feel like doing, just by starting to do it. Your brain only resists up until the point you actually start the job, at which point it starts to focus on doing it. You do what you want to be in the mood to do, and soon you’re in the mood to do it. It sounds ridiculous, but it’s the single most useful piece of information I’ve discovered about the way my brain works in 29 years of having one.
Quora - How do programmers code quickly?
http://www.quora.com/How-do-programmers-code-quickly?share=1
Quote:Jesse Farmer:
- They know how to use their keyboards to do work. Keyboards are way faster than mice once you know how to use them. They're also more amenable to muscle memory. Are you clicking around to open new files? When I'm coding I barely touch my mouse.
- They are good typists. I probably type around 80 WPM on average and 100-120 WPM if I'm focusing on my typing, for example. Go practice! I like http://play.typeracer.com/ and https://typing.io/.
- They know how to use their tools, especially on the command-line. Ctrl+R for reverse search, Ctrl+A/E for beginning/end of lines, <Tab> for autocompleting filenames, etc. These become muscle memory after a point.
- They are very good at debugging and are likely to isolate, identify, and resolve a bug 100x quicker than a beginner. This isn't just because they "know more." Oftentimes they know just as much as you, but have a more disciplined approach to finding the source of unexpected problems.
- They have a better sense of where to look for information and aren't afraid to navigate through manpages or even source code to understand how some other system is behaving. If I'm having trouble with a poorly-documented Ruby gem, for example, I'll often look at the gem's source code to see if I can make sense of what's going wrong. I'd say 90% of the time this is quicker than Google.
Regarding debugging, I wrote a blog post (Teaching Novice Programmers How to Debug Their Code) that outlines how to teach people to be better debuggers.