Hacker News new | past | comments | ask | show | jobs | submit login
How I Program Stuff (rdegges.com)
165 points by craigkerstiens on Jan 17, 2012 | hide | past | favorite | 52 comments



This post is so deeply antisocial it makes me sad. Maybe I am just not born to be a programmer like he is, but I invariably have more fun and I am more productive and creative when working with other people.

That said, I enjoy how he so poignantly describes coding as antisocial at its core. With people, you need to make compromises and concessions all the time. Code on the other hand has no feelings, and deserves no pity. Maybe this is why so many programmers struggle with being social.

I feel like there is a message about work/life balance in there. Or rather, code/empathy balance. Can you realdily switch between ruthless coding mode and caring people mode? How do you deal with that contrast?


His method of coding works for him because he’s introverted.

"As (odd?) as that may be, being around other people seems to really drain my energy and sap my creativeness. Despite my best efforts, I just don't have the same energy around other people as I do by myself."

That's the real definition of introversion. It's not just being shy. Some people feel energetic when they work with other people in a bullpen (extroverts).

There was an Atlantic article posted here that explained more. http://news.ycombinator.com/item?id=561311


Wanting to be alone when you're working is not antisocial. If you claim to be able to do serious work while being constantly interrupted by people -- whether on IM, IRC or face to face -- then one of three possibilities exist:

1. You are a superhuman with Buddha-like concentration.

2. You're lying.

3. You're doing trivial work.

However, it's a major problem if the OP goes out of his way to avoid communicating with people after his work session. In that case, none of the work he did has value. Code that other people can't understand is worse than no code at all.

There is a time for work and a time for communicating your work to other people. You cannot do both at the same time.


> This post is so deeply antisocial it makes me sad

The post is describing what works for him. While in the midst of something, mails, random greetings, IM pings are extremely irritating. When I was at my day job, I always had my headphones to cut myself from the open cube farm.

When you are working on something, apart from the required inputs and division of responsibility, it isn't a group activity. If you find it antisocial, well, that's how it is.

Programming isn't alone in that regard. Think sculpting, painting, theorem proving, creating music etc. All of these activities can, and are generally done as a team, but the individual's work is his own.

> I invariably have more fun and I am more productive and creative when working with other people.

I am curious. How else you suggest you go about programming?

> Maybe this is why so many programmers struggle with being social.

Since your premise was lone wolf nature of coding, I presume you will be making the same conclusions about sculpting and painting? I don't think you have a valid inference here.

> I feel like there is a message about work/life balance in there

It's simple - when you are working, you aren't free to take long and/or frequent calls from family/friends; or go fetch grocery even if you are working from home. When you are at home, unless it's a serious outage, you don't take unnecessary calls relating to work.


It's simple - when you are working, you aren't free to take long and/or frequent calls from family/friends; or go fetch grocery even if you are working from home. When you are at home, unless it's a serious outage, you don't take unnecessary calls relating to work.

This, of course, is good advice, and fits well to any sort of individual endeavor, being programming, painting, or wrenching on your bike.

I think many people react negatively to articles like this one because they read it as prescriptive (that is, this is how you _should_ work as a programmer) rather than _descriptive_ (that is, this is what works for me as a programmer, taking into account my character).

Generally, I work best at home, free of distractions, but there are times when collaborative work at the office is also productive. YMMV.


Yes. There is an essential chasm there.

Treating people like computers/code means you are a sociopath, and treating code like people means you won't get it to do anything. Code needs control, not empathy.

We programmers are stuck in the middle, pulled by either extreme.

I wonder if we will bridge that gap in the 21th century (and how?). To me, it is a much more worthy goal then "making the damn things even faster and smaller" (but, see also my reply here: https://news.ycombinator.com/item?id=3474387).


I enjoy working with other people, however, I do best when working with them through IRC, software, etc.

For instance, in both my professional and personal life, the most successful projects I've worked on with others have been those in which communication was primarily done through pull requests on Github, or IRC conversations late at night.

Maybe it is antisocial, but I just can't seem to function as well working in person with other people as I do on my own.

What sort of stuff do you do better around others? I'm genuinely interested.


You guys...this is about his programming practices. He never said that this has to apply to everyone.


For me it's much less glamorous, and even less purposeful. I write code almost everyday, sometimes without even thinking about it. If I don't carry out some form of automation at least once every 2 days, I get physically ill [hyperbole alert!] I'm the guy that always installs strange editors & calculators on other people's computers.

Most of the time I don't have a particular need for a development environment, but I have a phobia about being stranded somewhere without my tools. My mobile phone has 3 programming languages, their manuals and other cheat-sheets. It also has as many advanced calculators, solvers & graphic visualization utilities.

To me it's a mix of arms race & addiction. I hack because I crave it. I feel inadequate if I don't know how something works.

Most of my work is snippets. I usually store it in a file with a long descriptive name, for later finding & greping. I have had a ~/hacks directory in all my machines for the last 12 years or so.


What 3 programming languages do you have on your phone, and pray tell, what kind of wonder phone is this?


The Android Market has a bunch of mini development environments. On my Galaxy S, I have a Clojure REPL and two little apps for Ruby and Lua "development." Of course, you wouldn't want to do anything serious directly on the phone, but it's nice for trying out little things when you have an idea while you're out.


Yep. Clojure, Lua & Retro. The last is crap and I can't wait to get a real useful FORTH on my Android.


I've found that I will have times of really, really productive programming, usually around 5-6 hrs a day for 3-5 days. I'm not one of those guys that can claim to program 18 hrs a day for weeks on end, but I'm pretty happy with the quality and amount that I can program. However, historically, my biggest weakness is that once I finish a milestone in any particular project, I get too pleased with myself, I admire what I have built, and then take the next 2 days kind of milling around. I recently decided to take 1 yr off to pursue my own side-projects, so this is the one thing I'm trying to change about myself.

I'm not one to advocate Performance enhancing drugs, but I've discovered that taking a 5 Hr energy around 11 am really helps me concentrate the rest of the day, especially when I'm learning new things.

Every programmer has their own style, but the one thing I disagree with the OP is programming in a complete vacuum. I agree that programming by yourself really helps in terms of getting rid of your distractions.

But the one thing I miss is sitting around and talking about problems with other programmers. I've found throughout my career that when I stuck on a particular bug or issue, as soon as I try to talk it out with another programmer, the answer comes pretty quickly. The physical act of trying to explain the situation seems to force you to take a different pathway in your brain that gives you another perspective that you might have been otherwise stuck on if you just say there thinking about it.


When I run into a similar issue and don't have a programmer to talk to off-hand, I write an e-mail describing the bug. I usually don't send the e-mail because by the time I finish writing it out, I've figured out the answer.


I overcome problems all the time by talking it out with someone--they don't even have to be a programmer. Just describing the process, what I'm trying to accomplish, the pieces of information involved, and the "why's" of each step can help me find where my logical flaw or bug is.

http://en.wikipedia.org/wiki/Rubber_duck_debugging


Yeah, for every StackOverflow question I ask, there are several that I start formulating and then discard, as merely putting thoughts into words leads to new insights.

Also I use paper a lot for solving problems and making decisions. Simply write everything down as if I was explaining the thought process to someone. Writing it down helps the same way as with SO questions, but also extends my very limited "immediate memory" (similarly as with arithemtic operations in head / on paper)


yup StackOverflow is awesome, especially for the reason that you meant. In order to not look like an idiot, I do a bunch of research and try to cover my t's so that it is actually a decent question, and usually by the end of writing up the question, I have found my solution. Stackoverflow is the best resource I have, working on my own now.


What I do:

1. Open terminal, `mkdir <project name> && cd <project name>`

2. Spend way too much time thinking of what language to use.

3. Spend way too much time thinking of how I should implement it.

4. Start coding.

5. Get bored and have new idea.

6. Go to step 1.

I think I need to work on actually finishing my projects and spending less time with thinking.


I disagree. There is more value in starting something than in finishing it. Starting a project may involve designing and testing a new algorithm. Finishing it may involve playing with CSS for hours. At that point, there is no educational value in finishing it; the time would be better spent on a new project.

Personally, I have a lot of 80-90% "finished" projects that are available for people to use. This is usually enough. If someone is really using them, I might be motivated to finish everything on my todo list. But otherwise, something else would interest me more than checking off some imaginary todo list.


"There is more value in starting something than in finishing it."

I see your point about learning and agree with it, but I don't think that in starting something is more value than in finishing it.

Starting is pretty easy, because new things are always more interesting. It's getting hard when the interest vanishes. That's the challenge of finishing something, that you can overcome this stage. Otherwise you will never produce something remarkable, but just jump from something interesting to the next.

For me, jumping from one to next thing just isn't satisfying, it's aimless, just following your desires without any direction.


I agree. I start a lot of projects. I will spend some time on just about every dumb idea I come up with, just to see what life the project takes on.

Usually, with some small effort, I confirm that most of the ideas are, in fact, dumb. I'll stop development right there. But every once in long a while, the idea still sounds like a good one and it still keeps calling me to continue working on it. Those are the ones I will take to "completion."

It is good to finish things sometimes, but if you find yourself lacking the motivation to finish a project, there is a good chance that it isn't worth finishing. At least in my experience, when you are on to something valuable, you'll naturally be drawn back to it.


0. Spend way way way too much time thinking of a project name.


Either I have multiple personality disorders on HN or we have far too much in common ..

I would have added a variation though, swap the first two.

  1. read about a new language|framework
  2. open terminal


I do this quite often too actually... was one of the last languages you looked at Haskell? Or even a functional programming language? I spent way too much time trying to wrap my head around that tonight.


I do this as well. But I've stopped thinking of things I play with as projects, but rather patterns.

    > I think I need to work on actually finishing my projects
I've wondered before - why do I get ashamed of sandboxing? I decided it was because projects were accumulating in my 'project' directory, creating noise about things that would never be complete.

But it doesn't have to be like this! When you stop thinking of them as projects, no need for guilt.

I've built a tool to make it easier to manage your data and encourage sandboxing rather than projects. It's stupidly simple but changed the way I work:

  http://trogrd.tumblr.com/post/15130555126/saga
If the post doesn't explain it, you could try this: get it; create $HOME/saga. Then running something like "saga my test directory" a couple of times, and have a look at what it's creating in $HOME/saga until it's self-explanatory.


This actually looks pretty neat :) I'll have to play around with it in a bit. I have a feeling this could keep my ~/code directory much more organized :P

As a note, you have a broken Github link on that post at the bottom.


Thanks for all feedback. Fixing link now.


> Being ruthless with your code means you make commits that fix whitespace, fix indentation, ... --whatever needs to be done, you do it without a bit of regret.

Given that current tools are not advanced enough to properly merge these kinds of changes, you end up learning not to mess with whitespace/indentation (at least not commit these changes) because it will generate spurious conflicts.

Bad indentation make bugs slightly more likely. Conflicts make bugs much more likely. It's a sad tradeoff to have, but until our tools mature, this is the case.


This kind of depends. At the company I work for we had a wide-range of coding styles for several years, then decided to standardize and run all code that was not explicitly excluded through a pre-commit hook to enforce standards. We replaced a significant amount of code using tabs with 4 spaces. I don't remember ever really having a problem with conflicts. May be a setting in your source control software.


Maybe you didn't have lots of topic branches floating above the trunk?


One practice I've found that works really well is to cancel your internet subscription. I am then forced to go to public hotspots to check/answer emails, browse the web, go on hacker news, Facebook, twitter, etc. Most of the time I can just download API docs for the projects/libraries I am working on and don't need a persistence connection. You'll be surprised how much you don't miss out on by simply checking your emails 1-2 times a day.

This has greatly increased my coding efficiency as I am not distracted with being constantly connected to the world. I code "ruthlessly" during the time and when it is time for a break, I head over to my local coffee shop for some free wi-fi and a refreshing macchiato. For emergencies I always have my iPhone connection over 3G. Not only am I less distracted and more efficient, but I'm saving money (cost of coffee < cost of internet) and I find my life to be more balanced.


You must be paying quite a large monthly fee for your Internet. I have thought of this route, but there is a desktop PC to keep updated (linux likes its downloads, but then if I used that system just for production...)


;-), not that much. A decent connection is about $30 - 50/mo. The money saving is merely a fringe benefit, but it does add up over time. I usually just put everything up on my Linode instance where I can remotely manage updates via ssh. As for system updates on my laptop, coffee shops tend to work fine during off-peak hours or you can just head over to a nearby university library (which is also a nice chance to meet smart people).


No. I'd rather die.


I think the author makes a very important point about being willing to throw away stuff. I think artists struggle with this too, because they project the amount of work on to things they make, which makes them see it as more beautiful and satisfying than their audience in some cases. I have actually started taking pleasure in throwing things away after working on them for a while, because I've learned that, like in music, what you leave out is just as important as what you leave in.


If anyone has trouble with throwing code away: trust your source control system! If you need to, keep a file called "threw_away.txt" also under source control as an index of stuff you deleted but that might be useful later.


And with good version control practices, there's really no reason not to remove any code you don't _really_ need right now.


Throwing away code feels good inside. It feels a lot like shrugging off tons of worry ^^


Objectively filtering code as accepted or discarded according to a high standard of quality is fairly easy when judging others' code. It's a lot more complicated when judging our own code :)

I'd argue we're naturally biased to hold our own creations on a higher pedestal, and hence more likely to keep them instead of discarding or rewriting them.


+1 for the "clean your desk, terminals, browsers".

To me it's literally like cleaning a workbench. Every good craftsman learns that in his education, yet somehow as a software guys these basic principles have never been taught to me.

It's a great article and a quick and good read. thanks for sharing.


I've programmed probably only four or five serious projects in my lifetime. I've seen that—as I learn more about software architecture—the quality of my code increases, but my output decreases.

In a certain way I miss the early days when the thrill was just having something work, despite being ugly on the inside. Nowadays I'm constantly refactoring code to make it more elegant, extensible, and maintainable.

I often go back to an interview with Charles Eames, he's talking about Industrial Design, but it applies perfectly to software design:

  Is design ephemeral?
  __
  Some needs are ephemeral. 
  Most designs are ephemeral.
  
  Ought it to tend towards the 
  ephemeral or towards permanence?
  __
  Those needs and designs that have 
  a more universal quality will tend toward permanence.
http://blog.gentry.io/eames-design-is-a-method-of-action

I constantly try to keep perspective of my work in terms of who needs to maintain it, how often it needs to be maintained, and its lifetime. When I think about it in these terms, then I can keep on being crappy but productive.


About isolation: I can't start to program without starting before my pomodoro timer [1], it become a new kind of time unit measure for me.

I start the timer and for 25 mins you just can't reach me, no skype, no gmail, no twitter.

[1] http://tomatoes.heroku.com


For me, the most important thing to do before programming is: Going outside for some time in the morning (e.g., for a walk), or I will be brain-foggy for most of the day. I don't care about other people being around or not - I like people and I like exchanging little bits of information while programming (to get out of the "box" for some seconds). Also, having other people around me somehow forces me to look at code from their perspective once in a while ("Will he like the method names?", "Will he kill me if I do it like this?",...) - it's like an internal review, triggered by the presence of others.


:-( "sudo rm -rf *" brings back really bad memories...


One more thing I found helps me a great deal > focusing your mind on something other than programming during a day. I found that I have no trouble coding for days in a row, but after a week or so, I go numb... I cant programm shit. That is why I started running and boxing. If you are the same, find something, some hobby that doesn't involve computers.


"being around other people seems to really drain my energy and sap my creativeness." sums up why I don't enjoy other programmers and why I like to program alone. If i'm programming on a team and we have dudes who are anti-social, can't take a joke, don't like to talk to you, don't eat lunch with you, etc, etc, it sucks. I don't care how good they are.


Exactly. A well-rounded developer should be able to work well with others. Most projects require people to work together to finish them successfully and on time.


"There is no room for ego in success." That seems like a good way to sum up the get-it-done hacker attitude. Ego can come later.


And when i really get stuck while debugging, I go take a nap, eat something and when i am back i easily figure out the error


I experience the same mental block around people he described. So much that I aggreed for a schedule offset, pretending a better fit for managing a team; in fact as soon as everybody left, my focus and creativity came back in a second, as if my mind was suffocating their presence and now could fill the room.


Interesting to read this and other posts that talk about isolation. I am the total opposite. I like noise and people around me. I have an office at home and renting one too. But I get the most done when I am coding in one of the local coffee store. I guess I am just wired backwards:)


For me, programming is creative, and to be creative, you need to have the right environment.




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

Search: