8 ms·
How I Program Stuff
- potomak 15y agoAbout 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 http://tomatoes.heroku.com
- mrlase 15y agoWhat 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.
- deleted 15y ago[deleted]
- b14ck 15y agoJust do it, man. Start writing something and don't stop until your fingers are bleeding and you're suffering from dehydration. But seriously, just do it! I used to get stuck like that. When that happens now, I just start coding no matter what. I'll tell myself: "OK you MUST write code for at least 30 minutes or you can't leave." something like that.
- deleted 15y ago[deleted]
- jrockway 15y agoI 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.
- dan00 15y ago"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.
- randomdata 15y agoI 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.
- agumonkey 15y agoEither 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
- mrlase 15y agoI 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.
- schrototo 15y ago0. Spend way way way too much time thinking of a project name.
- cturner 15y agoI 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.
- wylie 15y ago"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.
- the_cat_kittles 15y agoI 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.
- b14ck 15y agoThrowing away code feels good inside. It feels a lot like shrugging off tons of worry ^^
- jilebedev 15y agoObjectively 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.
- slewis 15y agoIf 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.
- deleted 15y ago[deleted]
- jacobr 15y agoAnd with good version control practices, there's really no reason not to remove any code you don't _really_ need right now.
- khookie 15y ago:-( "sudo rm -rf *" brings back really bad memories...
- mahmud 15y agoFor 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.
- ppk 15y agoWhat 3 programming languages do you have on your phone, and pray tell, what kind of wonder phone is this?
- groovy2shoes 15y agoThe 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.
- mahmud 15y agoYep. Clojure, Lua & Retro. The last is crap and I can't wait to get a real useful FORTH on my Android.
- Derbasti 15y agoThis 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?
- b14ck 15y agoI 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.
- kevinchen 15y agoYou guys...this is about his programming practices. He never said that this has to apply to everyone.
- vellum 15y agoHis 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 http://news.ycombinator.com/item?id=561311
- 15y ago
- codeanand 15y agoAnd 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
- zeeed 15y ago+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.
- leak 15y ago"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.
- paulhauggis 15y agoExactly. 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.
- motter 15y agoFor me, programming is creative, and to be creative, you need to have the right environment.
- agumonkey 15y agoI 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.
- duopixel 15y agoI'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 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.
- manmal 15y agoFor 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.
- ofca 15y agoOne 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.
- akg 15y agoOne 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.
- keithpeter 15y agoYou 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...)
- akg 15y ago;-), 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).
- powertower 15y agoNo. I'd rather die.
- Peaker 15y ago> 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.
- jonstjohn 15y agoThis 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.
- Peaker 15y agoMaybe you didn't have lots of topic branches floating above the trunk?
- steve8918 15y agoI'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.
- dsteinweg 15y agoI 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 http://en.wikipedia.org/wiki/Rubber_duck_debugging
- cuu508 15y agoYeah, 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)
- lza 15y agoInteresting 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:)