Live data from Hacker News

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

news.ycombinator.com

41–50 of 112 posts

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

#41
The question is a bit open ended, so here are a few thoughts. Programming involves learning by doing. Just start on something. Perfection is the enemy of the good. Your first real attempt won't be perfect. In fact it will be downright terrible. Set your expectations accordingly and do not let this prevent you from getting started. It will also never be finished. Do not let the scope of the project prevent you from getting started. In fact you might even be bad at estimating the amount of time it will take. Ignore those fears and confusion and just start. Channel your weekend warrior instinct. Sit down on a Friday and just start typing stuff.

Start with an idea, a problem. It really helps when the problem is personal. What do you hate? What annoys you? The text editor you use? Some little feature of JS that the makers of the language seemed to have forgotten about (how could they!)? Some website that just looks wrong to you? The todo list that doesn't work the way you want? Just think of something that doesn't quite work the way you want, a void, and then try to fill it. Just start and get in over your head. Do some spying on how others solved it (preferably only if you really get stuck, or once you made substantial progress). Maybe you can solve it better? Gotta dog food it. I find dogfooding a solution to a personal annoyance is what keeps you progressing towards a finish line.

If your asking about, say, the idea of website design, and the typical systems that make up sites (the software stack), just start reading about website design. Make a dumb website. Make a blog. Make a family photo album. Basically, start, and then figure out what you don't know, and then figure out what you need to know to proceed. It is an iterative learning process of realizing all the things you do not know and calmly tackling them. For some, this is the best part, the adding of another tool to the toolkit, the unearthing of some common pattern among the tools.

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

#42

Excellent question for a Friday. Coding is like welding, how do you find two pieces of metal that need to be joined? Generally the answer is visualize something that could exist, but does not exist, and then fill in the parts that need to be there for it to exist. What you need at this point are a series of assignments which are self-contained problems with known solutions. The assignment 'create a web server that di…

One of my favourite comments ever on HN. The welding analogy is apt.

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

#43
post #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 Pyt…

You are exactly right on this description of the the pain that is learning to develop.

Example: If you want to learn to play baseball. You learn the mechanics of the game. You learn to hit, catch, and throw. You can be an expert baseball player, and you can practice the shit out of mechanics all day long, and play games, and win games all day long for decades.

But if you want to manage a club and win games, you need to take that next step to learning the mechanics of the game beyond playing baseball, or all you will ever be is a player, and you will never be able to actually build a team that wins games.

Telling someone to go practice hitting, throwing, and catching in order to perfect their ability to orchestrate and manage an entire team of different moving parts would sound crazy.

And that is how it sounds when people continually say "just go write, fix, and build."

I do not have an answer for this problem. But, the answers that always rear their heads when this question comes around, have the opposite ideals of how anyone that has taken the time to learn the mechanics of development. Those people that have taken the time and effort to learn the mechanics are mostly those that appreciate clear and concise paths to solutions. And, as far as I know there is not good resource for bridging that big gap between mechanics and craft. I could be wrong, and there could be a wealth of this information on this process stashed away somewhere. But, the problem is that most of these paths are most likely buried somewhere in a course or resource that is shrouded in mechanics, when the learner is just looking for craft.

The person that clearly outlines this path from Mechanic to Craftsmen will undoubtedly be very successful.

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

#44
The most salient part of your question to me was the word user. How do you add functionality to benefit a user? Once you have a clear idea who your user is, and what they want, the answer comes more naturally to you. For instance, if your user is someone who wants to know a piece of information, you can display that information. If there is logic to be handled depending on who the user is, you can google "nodejs authentication" and use a library to handle that for you. Everything is constructed in steps, and I don't think there's a magical barrier between writing your first lines of code and having useful functionality.

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

#45

There are a lot of good answers here. What launched me into development when I didn't even know to program (so one step behind you) was that I found a problem I had personally had and looked for a way that could solved it. It turned out it was programming. The reason this was so effective was I was already passionate about the problem before I even knew what programming was. Then I discovered programming was the righ…

This is an excellent comment, and I really feel similar to you, and I have had the same experience!

I completely agree with "working with someone else". Find a programming buddy, do it. Join IRC and start becoming a regular in whatever channels you're passionate about (#programming, #rails... etc). You will find someone you kick off well with, and you will find yourselves working on the same project but the BEST thing is you will both make each other passionate and force one another to finish a project. It's exciting and fun.

However, "being forced to do it" I'm not sure sits well with me -- if you're forced to create web forms all day, every day, you'll get so tired, bored and you'll start to _hate_ programming. It's best to be around like minded people (even if it's IRC or your programming buddy).

My programming buddy is now my co-founder. Exciting times ahead! :-)

My last tip would be to learn algorithms, which aren't tied to any programming language but will give you a really good mindset for solving problems. It wasn't until I really sat down to learn recursion etc, that I learned programming for real.

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

#46
The best way to learn to sole problems is to find a practical problem and solve it!

Find something that would make you more efficient or something that you would personally use. It's going to be a lot of head banging at first but it keep banging away and then start adding complexity.

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

#47

Excellent question for a Friday. Coding is like welding, how do you find two pieces of metal that need to be joined? Generally the answer is visualize something that could exist, but does not exist, and then fill in the parts that need to be there for it to exist. What you need at this point are a series of assignments which are self-contained problems with known solutions. The assignment 'create a web server that di…

One of my favourite comments ever on HN. The welding analogy is apt.

[deleted]

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

#48

Hi from Tent :-) https://cphuntington97.cupcake.is If you're uninterested, please ignore, but here is something I want that might make an educational project: A list of English words and/or phrases that are "phonetically contained" within Spanish words and/or phrases (and vice versa). For example, the English words 'cone,' 'tea,' and 'go' are phonetically contained within the Spanish word 'contigo.' (I'm trying to wr…

http://www.speech.cs.cmu.edu/cgi-bin/cmudict makes English pronunciation pretty easy. I've used it for versifying, e.g. http://wry.me/sonnetron/

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

#49
[H]ow 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?

When you figure it out, please pass the message on to the fifty bazillion useless websites out there, that all want me to enter my e-mail address and create an account, yet provide no benefit.

To create something that will benefit users, you need a brilliant idea, not only the ability to code, even to code very well.

If you don't have your own idea, then you get someone else to supply the idea. The idea will start out vague, then take the shape of concrete use cases (interaction scenarios between the proposed system and the people or other agents that use it). From those emerge requirements and a detailed design, and then some prototype code that becomes production code.

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

#50
Hi bnb,

I started programming around 20 years ago - self taught and experiencing the same problems as you in the early beginnings.

I made mistakes when I started

- jumping around between languages

- thinking I couldn't grasp something

- jumping from one tutorial to another, and another, and another

- I wish I started learning algorithms & data structures earlier

- I wish I took time to dive deep instead of rushing to getting something working

What was my breakthrough?

I got a job in social assistance - it was mostly sitting at a desk and distributing food supplies. This left me with most of the day unfilled with errands and a PC in front of me. I installed Perl on it and started learning, digging deep into every bit of the language.

- Learning how the interpreter works

- Reading the perldoc for every module I used, every function I called

- Writing small scripts to help with my then daily tasks

- Writing code every day, even for stupid one off tasks or things I wanted to try

Three months later I got my first job as a Perl programmer - mostly doing web interfaces, marketing mailers & web scrapers. Having learned Perl to the level when the language itself wasn't getting in my way it was far easier to grasp additional concepts:

- programming paradigms

- algorithms & data structures

- abstraction

- documentation & good practices (version control, testing etc.)

This was a major stepping stone for me. Picking up any other programming language, framework was a breeze since then. I worked at a corporation doing Oracle PL/SQL for seven years. I programmed in Ada, Ruby, Perl, Python & JavaScript professionally in long term employment. I did contract work for C, C++, Java. I played with Common Lisp, Scheme, Prolog, Erlang & Smalltalk (mostly when I was hospitalized for a long period of time) and now I'm working with a start-up I co-founded where I'm doing Python, Ruby, Javascript, C, Go and recently some Dart.

Don't let anyone tell you that you're limited in any way - most of all don't think it yourself. The only limitation is what you want to achieve.

Recently I got really interested in OpenBSD and would really want to be involved in OpenBSD development.

Here's how I'm tackling this specific problem now with hindsights to the mistakes I made when starting as a programmer.

1) Pick one project

This is OpenBSD in my case - should be a heavily developed framework, library, application in your case.

I ignore all the OpenBSD vs X articles, post whatever. I made my choice.

2) Follow it

Subscribe to the mailing lists, join the IRC channel - consume news & changes about the project.

Don't feel bad when you can't keep up! 20 emails per day? Try to read a few of them and leave the rest for later - just keep at it.

3) Follow the code

Take a look at each code change made to the project, try to understand it even if it's over your head.

4) Run it!

Changes were made? Pull them in, run them.

5) Poke around

Try introducing your own changes. Hit a bug? Try to trace it down as much as you can & fix it. If you can't fix it, report it upstream.

6) Make your own

You want it to do more? Add it, or at least give it a good try.

Don't know how? Still try! Even if you just end up breaking stuff you will learn!

7) Rinse & repeat

Until you feel confident enough to go in on your own - though you rarely are completely on your own. Don't be afraid to ask for guidance & help. Just remember that it's always nicer to show people that you tried on your own (and documenting that) before going public with a help request.

So this was a wall of text, hope it helps you at least a little bit :)

I mostly work from home on my own schedule so can devote a few hours spread out throughout the day. If you really want to learn and need a helping hand in the early steps or someone to bump ideas against feel free to catch me on freenode @ #hncode.

Post reply on HN