9 ms·
How to improve your programming skills
- stephen_dryden 15y agoReally good article, I agree with every point. If I were to add to it I stress the importance of reading books by different authors and publishers, even if they're about the same subject. This helps you get a much wider, well-rounded view and it often improves the learning experience.
- antoarts 15y agoThank you :). I agree it is always good to see a thing from as many angles as possible. Additionally, some author might have left something out which another one did not.
- vibrunazo 15y agoI agree, reading books of different perspectives is great. I would also like to bring up the importance of reading "good practices" books and articles. Learning not only how to write good code for yourself, but good code for your colleagues to work with is an important skill to have. Writing maintainable code is often not trivial. I recommend reading Effective Java by Joshua Bloch.
- highace 15y ago+1 for don't rush to StackOverflow! You don't get better if you don't tax your brain a little, much like how you don't get stronger if you use a winch or wheelbarrow to carry a load instead of carrying it yourself.
- Tashtego 15y agoI've been trying to get better at this myself. Although, you do feel foolish when you bang your head against something for six hours, and then you get your first (correct) answer on stack overflow five minutes after you post. Still, if you're not feeling foolish often, you're not learning. Competence is deadly that way.
- wccrawford 15y agoLearning to find the answer yourself is -way- more helpful than having it provided to you. Don't regret those 6 hours. It's a process.
- highace 15y agoAgreed. Plus next time you won't have to go looking for it on Stack again because it'll be ingrained, painfully, in your brain. And you'll probably learn a whole lot of other things along the way too. StackOverflow isn't a total no-no, just don't make it priority 1.
- minikomi 15y agoOr, if it's important, go to stack but make a record of what it was... Then try to do the same thing without looking a weekend down the line .. sometimes things can't wait!
- bajsejohannes 15y agoThe article suggest reading code, which I agree is a good way to improve programming skills. But I'm a bit unsure what to do with the advice to read the linux source code. Where would you start? I find the only way to actually get to reading code, is if you have a need to understand some part of it (e.g. to fix a bug or add a feature). So perhaps a more actionable proposal is to try to fix a bug, preferably one you care about, in some open source project.
- llimllib 15y agoI often go read code to figure out how somebody else does something I want to do. Usually, somebody has solved your problem better than you have.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- peteretep 15y agoLearning Javascript changed my Perl for the ... more fun to write. Possibly better, too. I've started passing around coderefs as arguments to functions a lot more recently, and allowing people who use my APIs to do just that... I've been writing code that allows you to describe a website in data and at a high level recently, and builds you up all the methods you need to interact with it. In general, when people need to provide parameters, I also let them pass in coderefs that can be executed to provide those eg: my $name = ref($args{'form_name'}) eq 'CODE' ? $args{'form_name'}->( $self, @user_options ) : $args{'form_name'}; my $form = $self->mech->form_name( $name );
- perlgeek 15y agoThen I can highly recommend "Higher Order Perl" by M.J. Dominus (ebook for free on http://hop.perl.plover.com/book/ http://hop.perl.plover.com/book/ but the printed edition is well worth paying for too). It essentially teaches you functional programming in Perl.
- peteretep 15y agoIt's a great book! Here's something really cool: ultra-linguist and general bad-ass Sean Burke went through it doing all the examples in ... Javascript! http://interglacial.com/hoj/hoj.html http://interglacial.com/hoj/hoj.html
- bsaunder 15y agoI've explored similar concepts. In particular I've found it rather powerful to be able to export/import code refs with: use YAML::Syck; $YAML::Syck::UseCode = 1; Watch out though, when you take executable code from a user.
- bluekeybox 15y agoHa! I thought I was the only one... When I first learned Perl two years ago, I wrote my programs in a very boring, imperative C-like style; in the time that passed, I exposed myself to the functional side of Python while also learning some deep Javascript; last month after having come back to Perl, I noticed that the new code I am cranking out basically looks like Lisp with some curly brackets in-between. God, do I hope that the programmer that comes after me is as excited about the code-as-data, data-as-code paradigm as I am... Or at least can understand anything I wrote :)
- peteretep 15y agoAlso, randomly: I started putting bug bounties on my code on CPAN: http://search.cpan.org/~sargie/Data-Google-Visualization-DataTable-0.08/lib/Data/Google/Visualization/DataTable.pm#BUG_BOUNTY http://search.cpan.org/~sargie/Data-Google-Visualization-Dat... This made me more conscientious about what I release ;-)
- perlgeek 15y agoI found a doc bug :-) "This module is attempts to hide the gory details". The "is" isn't English grammar. (No, doesn't count as a bug, really)
- antoarts 15y agoFor those of you who get a database error, I think it is the huge amount of traffic I'm getting at the moment which causes this (>1000 visits last hour). I'm using shared hosting, which might have problems with this, so in one way, you are DDOSing my site ;-). I don't know if it is safe to tell you to just wait and reload the page, but do that, BUT NOT TOO FAST!
- tszming 15y agoAre you using any caching module, e.g. Hyper Cache for WP? If not, you should give it a try.
- antoarts 15y agoI started using one just recently. I'm not a web developer and I just installed WordPress less than a month ago. Apparently, PHP scripts are heavy to execute :S It seems to work better now.
- phereford 15y agoI got a "Database Connection Error" (I am sure your server got hit hard with being top 5 on HN). :) The irony makes me giddy.
- edw519 15y ago11. Rewrite something that desperately needs to be rewritten. So many times I've encountered something and thought, "I can't believe that people are actually expected to use this software." It was bad from a user perspective: difficult to use, slow, tedious to do what you actually needed to do, unable to "get there from here". Then once I looked under the hood, it was often worse: built upon a horribly designed data structure, inflexible with constants where there should have been parameters, no apparent thought put into its use, too many violations of acceptable practice to mention, looking as if it evolved haphazardly (which it probably did). It's easy to bitch about stuff like this, but you often have to go to the next level to do something about it. It's amazing how much rethinking you have to do and how many tools you have to build to turn horrible software into what should have "obviously" been done in the first place. Easier said than done. And often, some of my best learning experiences.
- rickmb 15y agoRewriting something is most definitely a good way to learn that a) rewrites are easy to underestimate, and often not such a good idea as they seem, and b) the previous programmer may not be such an idiot as you first thought. Understanding the thinking behind other peoples code (yes, even crap code) is one of the hardest programming skills to acquire.
- steve-howard 15y agoThis is something that took a lot of mistakes to learn for me. Replace only the code that's definitely wrong, and resist the urge to start over. Whenever I see a project announce that they're going to rewrite the next version, I know I'll never see it.
- Derbasti 15y agoInstead of rewriting something, you should really refactor it until it is beautiful. Unless the original author was really stupid, you are bound to go through all the same errors and dead-ends the original author went through on his first try.
- DavidMcLaughlin 15y ago"Learn a new programming language" I would rephrase this to learn a new programming paradigm. There are fundamental differences between static typing and dynamic typing, object orientation and functional, manual memory management and garbage collection. There are also "pure" single-paradigm languages and multi-paradigm languages. If you learn the same type of language multiple times, you're really just learning new syntax and probably a couple of extra idiosyncrasies, so it's important that you pick languages with fundamental differences. Compare going through this learning path: Perl -> PHP -> JavaScript -> Python -> Ruby -> Node.js To going through this: Java -> C -> Scheme -> JavaScript -> Erlang For example.
- antoarts 15y agoYeah, I said that it especially helps if the language utilises a different paradigm. It is the important thing, actually.
- nagnatron 15y agoI went like this CPP -> Java -> Haskell -> Python -> Ruby -> Coffeescript and elisp somewhere inbetween. I learned a lot about languages but there are many of my friends who know just PHP or Java and who are much more productive day to day than me. My advice to someone would be to pick one language an learn it really well so you can do pretty much anything in it. Do Code Katas, make stuff all the time. When you're bored, dick around with other languages like Haskell or some of the Lisps(try to do SICP exercises). But be productive in at least one language. Check out some of Corey Haines's videos on practice to understand better what I mean.
- 15y ago
- deleted 15y ago[deleted]
- zwentz 15y agoI find that trying to ask my question at StackOverflow is the best way to improve. Because I have to think about how best to word my problem, and really make it clear and concise. And usually when I do that, I end up just solving the problem on my own. Of course, I see a lot of give me teh codez there, so I can see where the author is coming from. Nevertheless, I find it to be a useful tool in helping me become a better programmer.
- cruise02 15y agoI had the same thought. I think the author is only warning against immediately looking on Stack Overflow for existing answers. Formulating a good question of your own for SO requires a significant amount of thinking about the problem, which is what's being advocated.
- antoarts 15y agoGood catch. This is similar to "rubber-duck debugging" (http://en.wikipedia.org/wiki/Rubber_duck_debugging http://en.wikipedia.org/wiki/Rubber_duck_debugging).
- joecasper 15y agoReally good article. Another way to improve your programming skills would be to teach someone else. I find this to be one of the best ways to solidify your understanding of something.
- synnik 15y ago11. Learn how the entire stack works. I see way too many people coding around problems that could be solved at the server level, the network layer, etc.
- antoarts 15y agoI hope that I fixed the problem now by installing a plugin (QuickCache) which caches pages and serves a normal, static HTML page when possible instead of generating a new dynamically from the PHP scripts each time. I hope.
- Morendil 15y agoThis is severely biased toward things that require no in-person interaction. So I'll add two: 0. talk to other programmers 11. attend a Coding Dojo
- Androsynth 15y ago-Build something that is bigger/more complex than your current skill level. This will not only improve your skills in general, but learning from the mistakes you make is probably the best way to grow as a programmer.
- Androsynth 15y agoBy the way, I can't recommend going out and reading massive textbooks. That might be useful in a vacuum, but in reality you only have so much time. Programming should always be number one on this list; followed by: -building something completely different than your used to (either in scope, by features, or by language) -looking at code from open source projects The main thing: always challenge yourself. When your at the inflection point of your learning curve, do something different. Expanding your boundaries will not only help you learn different technologies, but it will give you a better perspective on your actual specialties.
- spacemanaki 15y agoSome things are better found in books though. I've been reading Lisp in Small Pieces for a while now, and there's some great stuff buried in there. I don't think I would have stumbled upon it just hacking away on toy Lisps on my own. There might be other places to find some of these things, like other compiler texts or the actual source of some Lisp compilers and runtimes, but books are often laid out in a nice pedagogical way. Reading the SBCL or Racket source would be a steep way to get to some of these ideas. I would amend your recommendation to say, pick the massive textbooks you read carefully. Don't suffer through big, poorly written books.
- Androsynth 15y agothats a good point.
- blaaah 15y agoBut how does one get ideas for a project? I started learning programming using C++ about 5 months ago. I've been making good progress on learning the concepts but I just can't think of anything useful to create.
- chc 15y agoDo you do anything? Like, anything at all besides learn C++? Do you know anyone else who does things? Think about what parts of those things are suboptimal and create something to make it better. For example, where I work, we get a lot of user-submitted content, but we can't use all of it. So we need to filter. The lady who is primarily responsible for this simply doesn't have the time to vet the massive number of images she runs across to make sure they meet some basic criteria for size and quality, so I wrote a program that mostly automates it.
- blaaah 15y agoWell, I'm a college student, so no I don't do much else aside from learning how to do stuff.
- chc 15y agoI'm sure you study, research, write, socialize, etc. in addition to learning C++. If not, I recommend starting. Those are all way more important than C++. And like I said, it doesn't need to be your pain that you're relieving. Look at the people around you — even if you yourself are chained into your bed with no hope of escape, I bet you know people who do things. You can help them do those things. For example, take a look at patio11 on this site. He's built a whole business out of a simple tool he wrote in a few hours to help a teacher make bingo cards for her students, because making bingo cards is such a soul-sucking waste of time when humans do it. (To be clear, he's put a lot more time than that into building the program and the business over the years. But it only took a few hours of coding to solve the problem.)
- blaaah 15y ago
- shii 15y agoReading and trying to work with the Linux kernel source is hardly a good way to get better programming skills. It's really large and hard to understand. Something like Minix, MenuetOS, or LoseThos is a much better alternative to hack on. LoseThos particularly reminds me of old school hackable boxes like the Commodore64.
- kenjackson 15y agoWhile people recommend reading code, like the Linux sources, I also find more code focused sites like Code Project (www.codeproject.com) very useful. These aren't blogs like Coding Horror, which are more "philosophy". These articles on Code Project typically are explaining code in detail.
- isomorph 15y agoI like how "Program" is all the way down at number 5
- nu2ycombinator 15y agoWhat I observe so far is people who learn all kind of programming languages will become very good programmers. And one who see language as a tool to solve problem and applies it smartly will become millionaire providing food for remaining good programmers.
- pmr_ 15y agoAll of the advice given here is good and none of the tips here are going to hurt you. It's just another less abstract reiteration of a few truths that encompass much more than programming. Work with different tools. Think. Talk about what you do with other people. Do all of it a lot.
- secoif 15y agoi.e communicate, keep an open mind and challenge yourself
- JesseAldridge 15y ago> 10. Don’t rush to StackOverflow. Think! Disagree with this one. My rule is, "If you get stuck for more than 10 minutes, post to StackOverflow." I'll post my question then continue trying to solve it myself. Sometimes someone will post a good answer right away, saving me lots of time. Other times I'll end up solving my problem on my own, but I'll still learn something valuable from a comment or answer somebody posts to my question. Here's a good example of what I'm talking about: http://stackoverflow.com/questions/6327396/set-time-part-of-datetime-in-ruby http://stackoverflow.com/questions/6327396/set-time-part-of-...
- rmc 15y agoI'll post my question then continue trying to solve it myself I also do that aswell. But it's a bit annoying when, within 10 minutes, my (unanswered) question is the top google result for the problem (due to high keyword relevance).
- roundsquare 15y agoIt sounds like you value "getting things done" over "improving your skills." That's not a bad thing, but its not what the article was about.
- JesseAldridge 15y agoI don't know about that. My point was that by posting to StackOverflow you can do both more efficiently. I don't see much of a point in trying to trial-and-error a problem, hunt through documentation, etc, when somebody more experienced can just tell you what to do in a few seconds. The same lesson is learned either way.
- roundsquare 15y ago"The same lesson is learned either way." Not at all. Learning how to find the solutions to a problem is very different from learning the solution to your specific issue. I'm not saying its always worth your time, but there is a different lesson learned when you find the solution yourself.
- coreyhaines 15y agoAlso, spend time doing focused practices. Attend a coderetreat (www.coderetreat.com)
- kvgr 15y ago8. is very important. Once you decide to write article, you got to have solid knowledge about the topic. You just can't write the code and see if it works :) you got to know why and how!
- jrockway 15y agoOne way to improve your programming skills: stop reading programming blogs and start programming.
- secoif 15y agoWorst part of this is that you can end up sounding and feeling like you are/could be a far better programmer than you actually are; you know all of the ideals, philosophy and lingo about how to create clean, amazing code but actually turning this into real programs that solve real problems in real budget & time constraints is a very, very different thing.
- ataranto 15y ago1. Find something that you can't do. 2. Do it. 3. Repeat.
- lhnz 15y ago1. Learn paradigms, kinds of problems and computer science fundamentals. 2. Work on poorly-run large projects with (a) performance problems or (b) code organisation problems. 3. Work on other projects with developers that use (1) to solve the problems of (2). You'll be surprised how quickly you learn when you've seen the benefits to be had by doing things better... ;)
- known 15y agoDebug other people's code.