TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to become a programmer

23 pointsby lowfatover 17 years ago
Hello, I have been doing some web programming during the last few months and I'd like to become much better at it. I am trying to learn by reading programming (php) books and doing the practice exercises. I have also tried to write my own code for fun. The problem is that the stuff I do from books are really, really boring! The stuff I do on my own is more fun, but I get stuck quite a bit. Last week I spent an entire day trying to debug why php was not connecting to the mysql db. Once I figured it out, it was great, but I was beat. Is there a better way to learn programming?

19 comments

edw519over 17 years ago
"Once I figured it out, it was great, but I was beat. Is there a better way to learn programming?"<p>No. You found it.
评论 #90872 未加载
评论 #91296 未加载
zaidfover 17 years ago
The way I learned PHP is by developing two apps that I really wanted to build. I set aside three weeks for each app and coded PHP day and night.<p>One thing I realized was the importance of rhythm. If I code for a day and then come back to it after a week, it was almost like I was starting from zero. <p>Coding for sometime continuously is a good way to pickup a new language.
评论 #90814 未加载
euccastroover 17 years ago
Find someone around you who can program, and somehow get them to mentor you. It's less intimidating, but rather equivalent, if you ask them if they could be available for questions every now and then. I think many people who really like to program will be happy to help you out, as long as you do your homework and show respect for their time.<p>Ideally, you'd work in the same room as your mentor, but it should be enough if you can meet once a day or so. A longer feedback cycle, or mentoring remotely through the net, is less than ideal, but anything you can get is better than being on your own.<p>Ask them what language they'd be more comfortable helping you out with. Start playing with that language. For that, follow other advice in this thread. Don't expect to be spoonfed.<p>If you get stuck in something after giving it a honest try, ask. Every now and then, show them what you are doing, even if you have no immediate problems. Chances are that they can steer you into better ways to think about problems, simplify your code, etc. These are insights that only come through experience. They are often hard to explain out of the blue, and hard to internalize so that you can put them to use later, when explained in abstract terms. They are best communicated in little doses, while commenting on actual code that addresses actual problems. Ideally, <i>your</i> code and <i>your</i> problems.
jsmcgdover 17 years ago
I think the route to success with programming is much like maths, medicine or indeed any discipline, go for breadth first then depth. Don't spend all your time mastering one aspect, try to learn many different things at once even if you are actually only interested one specific thing. Once you have even just basic knowledge and familiarity with most facets of a field then you will be better equipped to approach any specialization.<p>So in your case its fine to learn PHP but I would encourage you to look at many different things that are unlike or even the antithesis of PHP. It will help you understand where general computing nomenclature comes from, what the limits of your chosen technology are, how best to implement it in a given environment and ultimately it will give you a much better understanding of the technology itself.
cratukiover 17 years ago
It's always exciting to hear someone eager starting out. The only secret is to keep being interested and not give up on yourself. If you're looking for a fun problem to solve, try writing a brute-force sudoku solver. That could be fun in the context of a webapp. I'd also recommend getting a solid grounding in SQL and designing schemas. You can do a lot of this by brainstorming applications and then working out how you'd design the schema. You don't actually have to write it, and the process can be a good way to get a feel for whether an application will be simple or hard.
vikramover 17 years ago
There is only one way. You need to pick a problem and then try to solve it. The problem needs to have depth and should require some gumption on your part.<p>Unfortunately, days when you try and solve one problem for a long time can be common. When you think you are getting into something like that you need to take a 5 minute quite break. Something that gives your concious brain quite time, I find ideas and answers flood in then.
iceyover 17 years ago
Don't be turned off by the fact that this is geared towards kids more than adults: <p><a href="http://hacketyhack.net/" rel="nofollow">http://hacketyhack.net/</a><p>It's a pretty decent introduction to Ruby.
评论 #90822 未加载
mynameishereover 17 years ago
I'm not sure PHP is the best first language.
评论 #90988 未加载
mishamover 17 years ago
First, ignore the language wars. They are all BS. You want to use PHP, use PHP. Just keep in mind that every language was written for a fairly specific task and it's very good at that task. Don't try to use C to write a server-side script. Likewise, it doesn't make sense to use PHP to write an OS. Try to understand what problem you want to solve and then pick the right tool for the job based on performance, libraries available, community support and past projects that are similar to yours.<p>Now on to becoming a better programmer:<p>Find a good project and read some theory books on debugging and how to write code in general (check amazon.com and read the reviews). Books like Code Complete 2nd edition and Beautiful Code. If you want to be more serious about it, the Computer Science series by Knuth will give you all you need to know to get a CS degree, but they are boring so you have to be willing to stick with them. Those books, 3 volumes, are the bibles of Computer Science ( yes, someone will disagree) and as such they are theory. However, you need to know a good deal of that theory to write good software. Specifically, you can concentrate on searching/sorting algorithms, algorithm analyses and machine architecture.<p>In general, you will find that there is a HUGE learning curve to understand what the computer is doing with your program and how to write code that makes sense, which makes you a good developer. However, the time you invest in learning what happens behind the scenes is worth it's weight in gold, independent of the language you use.<p>Always try to figure out what the tool/language you are using is trying to do and don't blindly trust it.<p>Never, ever skimp on comments. You don't have to write a novel and explain that you are adding 2 to variable i, but do explain what the function is doing or what a complex bit of code is doing, this will save you hours when trying to find that bug.<p>Use a version control tool. The simplest one to use would be Subversion and the book for it is free online. There are also free Subversion hosting services such as <a href="http://beanstalkapp.com/" rel="nofollow">http://beanstalkapp.com/</a>.<p>Depending on how serious you are, you might want to look at the coursework from colleges like Stanford. Many top schools post their coursework with lectures online.<p>Google is your best friend. Just paste the compiler error and remove any variable names and you will often find people who had the same exact problem with possible solutions. You might have to play with the search string, but you will often arrive at an answer quite fast in this manner.<p>Try to find mentors on forums and newsgroups. This will take time as you develop relationships with people, but it's the best way to learn as the software development industry is still, very much, based on the notion of apprenticeship.<p>Try to study some open source projects. Little ones are best, as they are least complicated usually. Trying to figure out what someone else wrote will make you a better programmer in a hurry, because you will notice mistakes people make and how you would like to do things differently.<p>Lastly, think about which tool/program/etc. that you would love to have or rewrite an existing project in your own style and do it. The first one will be horrible, full of bugs and many many problems, but it will teach you more than most classes you take in school.
评论 #90909 未加载
movover 17 years ago
1. Read SICP <p>2. Do the exercises<p>3. In parallel, choose an open source project and join on that<p>4. Share with us your experience
mattmaroonover 17 years ago
PHP is probably a pretty good place to start. I built myself a couple web apps with it years back, having never coded anything previously that wasn't on a TI-82. It's a good introductory language to web programming.<p>I'm now spending my time on RoR, and I don't think it's a very good language for starters. It's just too much to learn at once.
评论 #91346 未加载
superjaredover 17 years ago
When I started coding I found a book that spoke to me -- This is very important because if you get a book you don't like or understand you will not want to learn from it.<p>And I tend to agree you should probably not start with PHP as your first language. I did, and now all I do is Python and Ruby which are significantly better, imho.
评论 #90813 未加载
kirubakaranover 17 years ago
Playful Programming <a href="http://books.google.com/books?id=HMvf12TnJQIC&#38;pg=PA381&#38;lpg=PA381&#38;ots=sJgmVARlBm&#38;sig=xd2-4tPAn8HG8W0CEH8oyhpvR-Q" rel="nofollow">http://books.google.com/books?id=HMvf12TnJQIC&#38;pg=PA381&#...</a>
nextmoveoneover 17 years ago
I'd also like to add that becoming an active member of a forum helps a little bit, as long as you only use it as a last resort. <p> For a first project, I'd say, just don't give up, think of something you want to make and dont stop until it's done.
maurycyover 17 years ago
Stand on the shoulders of giants, e.g. use and study good code.
telover 17 years ago
Learn many languages as soon as you feel interested. See programing from as many points of view as possible.
jimbokunover 17 years ago
An argument for learning Python:<p><a href="http://xkcd.com/353/" rel="nofollow">http://xkcd.com/353/</a>
ivanover 17 years ago
Join some Opensource project at sourceforge.net
评论 #90915 未加载
downerover 17 years ago
I recommend throwing out the entire field of computers and starting from first principles. Let's put the Ermine back in <i>determine</i> and stop weaseling our way out of deterministic systems.
评论 #90929 未加载