Live data from Hacker News

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

news.ycombinator.com

91–100 of 112 posts

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

#91

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…

Like said, I normally buy a domain and setup an idea and work on it. In the process I learn a lot.

Why would you buy a domain per idea for learning to develop? Sure for production this is a given but for fiddling about with things unless you have a good reason to work remotely why would you?

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

#92

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…

First off, thank you for the excellent reply. I think I'll be saying this a lot in this thread, but I don't know how to express my gratitude for your response--it's shed some light on things for me.

I'm a college student, and I haven't had a single programming course. I'm interested in full-stack, including front-end design and dev. I've learned my shit with that, and can hold my own with it pretty well. However, I do have plenty of free time to do what I want with programming, and I've taken on a massive load.

Every day I'm hopping between frameworks. I did half of the Ember.js course at CodeSchool, realized I didn't like how the project was being handled and decided to try React. That's just the latest, though--I've been trying to learn Node, Express, Gulp, Slush, and a bunch of others. I've got about 10 projects with just a bit of work done on them, and no more because I got stuck, didn't know what to do, and moved on. I see now that I really need to pick my tool and learn it.

Right now, that's going to be Node + Express for me. I don't think I have the gusto or interest to get into the nitty-gritty of Node core dev, but I could definitely do that with Express. Thank you for the excellent guide on how to really focus with it. I'll definitely be doing that immediately.

Thanks for your help, and I'll definitely sign on to Freenode to chat and get some help/ideas some time.

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

#93
post #92

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…

First off, thank you for the excellent reply. I think I'll be saying this a lot in this thread, but I don't know how to express my gratitude for your response--it's shed some light on things for me. I'm a college student, and I haven't had a single programming course. I'm interested in full-stack, including front-end design and dev. I've learned my shit with that, and can hold my own with it pretty well. However, I d…

You're welcome. I'm glad that you found my write up helpful.

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

#94

Earlier quoted context omitted.

Outside academia it is all about conformance to requirements -- i.e. you get paid to solve a problem for somebody somewhere.

True. But my read of the OP is that they learned for the pleasure and interest of it. They want to "solve problems" for the intellectual satisfaction and joy of doing so, not because someone is paying them or anticipating doing so. We have to master the skills before we get rewarded for them.

Thank you very, very much for your main comment. I am actually a member of both academia and the realm of "regular people/programmers/hackers/whatever." I'm a college student, so a lot of my work is for the most part free (despite what most people think about academia). However, I also want to do programming for a living, and know I will have to conform eventually.

That said, you're absolutely right in saying that I want to "solve problems" (that's just the best term I could come up with after months of trying to convey my meaning to many people--I have no attachment to it) for the intellectual satisfaction and joy of doing so. I really just love what I have done with writing code. It's really fulfilling and the structure of it resonates with me at a deep level.

So, your comment is very helpful. There's no end to the small problems or ideas that I have, especially within my work writing code. You may have answered this and I didn't understand, but the main thing I'm getting at with my OP is that I don't have the skill set to actually solve the problems. I know it probably sounds completely ridiculous, but I've approached many small problems and have always produced the absolute barest skeleton of the program which solves the problem I have. I then draw a blank on what I need to do next to continue solving the problem--the structure and the logic don't exist in my brain yet. That's what I really want to get from this thread, and I think there are some excellent responses that help with that, including yours.

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

#95
post #94

Earlier quoted context omitted.

True. But my read of the OP is that they learned for the pleasure and interest of it. They want to "solve problems" for the intellectual satisfaction and joy of doing so, not because someone is paying them or anticipating doing so. We have to master the skills before we get rewarded for them.

Thank you very, very much for your main comment. I am actually a member of both academia and the realm of "regular people/programmers/hackers/whatever." I'm a college student, so a lot of my work is for the most part free (despite what most people think about academia). However, I also want to do programming for a living, and know I will have to conform eventually. That said, you're absolutely right in saying that I…

I don't know your career ambitions and goals, but there is a lot to be said for the technician/mechanic/custodian (not really sure of the best word) who solves one problem and moves on.

If you are at all inclined to system administration, your approach (notice problem, solve problem quickly and effectively, move on to next problem) can translate to solid work.

Now I speculate: As an employee, this will probably lead to low to medium pay positions - at least until you start seeing and solving larger scale problems. As a consultant, however, if you can get a stable of repeat clients, preferably under retainer, you may actually do quite well.

Back to reality. How to make progress? Find an OSS project or two that you quite like, preferably ones with really good communities. Go through the lists of current bugs. Find and fix those you can.

Heck, just start finding flaws in people's code and documentation on GitHub, fix, and issue pull requests.

You will get a reputation in the community as a reliable, dependable problem solver. After a while, reach out to people who seem both approachable and a step or two above you. Ask if you might be able to help them with a larger problem, one which they need assistance with and on which they would be willing to mentor you.

That's one approach, at least.

Your academic environment may also have code that needs maintaining, patching, repairing, refactoring. Food for thought.

Keep at it, the penny will drop, things will click into place.

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

#96
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…

Absolutely agree with this.

There are hundreds of tutorials on how to write JavaScript, use the for loop, use if else statements, and so on. But not very many that I have found actually show how to use those to build a real program, explaining the steps and thought process behind the program along the way.

There are definitely ones that show you how to do things with it, but there's often not an explanation of _why_ something works the way it does.

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

#97
post #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…

I agree with this, but I do think there must be something that we're missing. Many, many skilled developers are saying "just go out there and build." The problem is we don't know how to build.

I think there might be an implied aspect of this that we're not getting. Someone said to (paraphrasing here) "Google every problem you come up against; 'how do I do x with y, how does a work, how do I implement b, etc.'" That seems like it would work--if you Google every problem you have, or look at the docs for every function you use, a pattern will start building in your head that shows you how to do x with y. I think the key here is looking at the core source of the tools you're using and connecting the dots in your head.

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

#98
post #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…

I can't relate to baseball but I notice a common pattern that applies to most fields.

You are told to do the basics over & over again so you:

a) Learn the motions

b) Learn how they work

You can't successfully apply your knowledge/tools/skills without knowing what makes them tick.

Let me phrase that with an example from my past. I was big into Starcraft at one point in my life.

Started with SC:BW. I was terrible back then, doing builds like an automaton following a recipe - I lost as soon as someone stepped out of the cannon and did something non-standard. Why? Easy. I had the mechanics but was missing the know-how on what made them work and how to apply them.

Instead of going that route I started to watch better players. They quickly diverged from the builds - enlightenment came when I noticed that they were playing reactionary. They observed their opponents and made decisions.

Why am I expanding now? Not because the build says so but because my opponent invested in tech so will not have the resources to pressure my new base etc. The basics are important, if you have your mechanics down then your mind is clear to react and just execute the movements to achieve the goal you want based on what you observed.

It works the same with programming. If you're stumbling with language syntax, your framework - the basics. You will then loose a lot of time hunting small issues and constantly loosing the big picture. When you're basics are down you are free to experiment and will notice patterns that beg you to apply one of the basics you learned.

Some problems are specific, fall into the 'what data structure, algorithm' should I use. Some are structure/flow related - how do I make those two things connect to each other and pass data around. Some are new - but they all mingle and repeat themselves very often.

When you read a lot of code, write a lot of code - you will start noticing the patterns. In the worst case scenario - knowing the basics will make it easier for you to ask better questions/find answers to hard problems faster.

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

#99

The question you are asking is like"How do I build a house?" It's too broad. Instead ask, "how do I pour a foundation?" or "How do I frame a wall?" Figure out how to setup a database. Figure out how to execute queries between database and application. Figure out how to write a login form. Build up from there, one small piece at a time.

Thanks for this. I think this is a large part of my problem. I don't know how to do fundamental things, such as set up an index route with Express, or how to use a templating engine with that to display dynamic text, or how to use a database to store that dynamic text.

I think your comment is a more direct way of saying what a lot of people have said: Break it down into smaller problems. You can go through each smaller problem and solve it, then move on to the next, until you're done. Once there, you'll have learned how to program. Or I should say, I will have.

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

#100

Just do it! You need to pick a pet/side project of something you want to work on and try to figure out how to get there with code. Perhaps start with a framework and go from there. If you can't come up with a project, find yourself a product person friend who can brainstorm ideas with you and work on it together. Where are you based?

I'm based in the middle of friggin' nowhere, New York (State). Not many good programmers around here. The nearest big city is Albany, which I'd bet has some, but I'm not really in a situation where I can go there to meet up with people.
Post reply on HN