Live data from Hacker News

Ask HN: I've learned a programming language – how do I solve problems with code?

news.ycombinator.com

1–10 of 112 posts

Ask HN: I've learned a programming language – how do I solve problems with code?

#1
I've spent a lot of time learning JavaScript (done the Codecademy JS course, finished CodeSchool's Real Time Web with Node.js, and read and implemented most of Node.js in Action), and I thought all I would need to do after I learned it was to start writing code.

Well, I can write code, sure. But I don't know how to _solve problems_ with it. I know how to create a webserver in Node that echos "Hello, World!" because I've done it a thousand times. But I don't know how to make a site with logic and structure behind it that will lend itself to solid functionality that users can benefit from.

How do I learn that?

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#2
Start small then build up. Give yourself lots of small nonsense throw-away challenges, or maybe take one small part of somebody else's website and see if you can duplicate it.

You have to keep challenging your boundaries. Don't do stuff you know, try to to do things you don't know. But keep each step upwards simple - don't try to build a skyscraper before you can build a house.

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#5
Find a problem first. Then try to implement a solution using your language of choice (Node in this case). An example could be: "I want to create a service that parses books and lists the most frequently words used. A step further would be to have the user enter a longer piece of text and analyzes it (http://www.online-utility.org/text/analyzer.jsp)"

Another example is "I want to create a service that auto-corrects text that users enter."

Try to find something that would make your own life easier. Chances are that other people are having the same problem.

Shameless plug. Hopefully you get some ideas out of it: http://jairampatel.com/projects.html

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#6

Start small then build up. Give yourself lots of small nonsense throw-away challenges, or maybe take one small part of somebody else's website and see if you can duplicate it. You have to keep challenging your boundaries. Don't do stuff you know, try to to do things you don't know. But keep each step upwards simple - don't try to build a skyscraper before you can build a house.

I think this is great advice. The only thing I can add from my own experience is - take your time to reflect on what you've learned once you achieve a new goal.

I also sometimes like to redo old stuff without looking at the code of my old solution and then compare. It is time consuming but really helps to see how you have grown.

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#7
I was in this same situation for a long time and when meteor 1.0 came out I went through several tutorials, including discovermeteor, bulletproof meteor. Its like a wave of ok, now I can build stuff and its dynamic, I had a plan to learn socket.io and now it just works. I have also signed up for the free mongodb class jan-Feb so that I don't make a big mistake at some point and dump my database. I also used erlang zotonic for a while but meteor has a bunch more kool-aid that makes it easier when you get stuck or have a question. Oh man, good luck I have been in that situation and can really feel your pain.

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#8
This is a very common problem for people getting into software development. You are not alone!

A lot of other people in this thread provided some good advice to finding problems to solve, but I'd just like to comment a bit on how to solve them.

My advice: read code. Lots of it. Find popular libraries in your language of code and pick them a part to see how they work. Set up some open source project that solves a real problem (a CMS, chat bot, whatever) and explore how it operates.

Seeing how other people solve problems will give you a good frame of reference on how to tackle other challenges you encounter. You will also occasionally come across sub-optimal solutions: learn from those as well. Seeing how to do something badly can be just as valuable as seeing something done well!

At the end of the day I think programming is a lot like writing: a good writer reads a lot of books and writes often.

Just keep at it, there's a whole community of people here who've gone through this exact same thing. Good luck!

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#9
>How do I learn that?

I had (have?) the same issue. Maybe it's something that experienced programmers take for granted; there is a huge disconnect between writing code and developing software.

I've asked the same question, and received the same answer: get your hands dirty. I agree with the premise, and am working on it. But there's the disconnect. I can write a little Python, but have you ever tried to set up a Python development environment on your computer? I don't understand 95% of what is required.

All that said, I'm way ahead of where I was when I started, a year or so ago. I'll keep plugging away, and recommend doing the same. Hopefully we see a few good replies here to help us out.

Re: Ask HN: I've learned a programming language – how do I solve problems with code?

#10
As others have mentioned, you need to practice solving problems with increasing complexity. You can try Project Euler which has lot of mathematical/computer programming problems. https://projecteuler.net/problems

You can also try daily programmer subreddit http://www.reddit.com/r/dailyprogrammer

If you want to practice with Bioinformatics problems: http://rosalind.info/problems/list-view/

Post reply on HN