Live data from Hacker News

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

news.ycombinator.com

81–90 of 112 posts

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

#81
Project ideas will come to you at some point. Meanwhile, while you're practicing, start making small projects that you know you can finish in a few days, but there's something new to you in it.

I learned by doing games, can't go wrong with that: Minesweeper, Poker/Blackjack (or any card game, implementing the rules of a complex card game is very educational), Tetris, Connect Four, etc. These are not unique projects and won't make you rich but keep on doing them one per week or so until you get a grasp of what you're doing. Just make sure you can and will finish your projects.

Small projects like that are also a very good way to fill your portfolio for your first entry level job. It's no substitute for a good CV but will certainly get the foot between the door compared to someone who doesn't have any work samples to show.

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

#83
Programmers learn programming by doing, they solve a problem / need, a problem for themselves, for customers, for other users.

What program did you/your customer/other users need?

Then do it.

No course in the world will tell you the exactly need and how to solve it exactly -> if it exists, millions of programmers will be unemployed ;-)

I learned it when i was 10 years old (C64), i saw the "cool" games and thought -> i want to create my own. Learned Basic, learned Assembler and Build step by step many different games and programs.

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

#84
I started development actively in 2010. At that time I was in my first year of college doing Mechanical Engineering which I didn't grasp really well. So, I ended up putting all my time into development.

The first thing I built was a small website which was a music catalogue. When I think about it now, it seems utterly pathetic but it was the first thing I ever built. Later on, I got into WordPress and spent a lot of my time picking up PHP and writing new themes. This was an enlightening experience as I picked up a lot of plugin writing practices and I ended up being invited to a few WordCamps.

In the coming years, I learnt a good deal of JavaScript and was working with PHP frameworks to write a lot of admin interfaces for my own projects and some tools for my college's software development team.

In the last one year, I picked up Ruby and wrote a few tiny gems.

With this much experience, I have been able to port code from most of the languages I have encountered to all the languages I know.

Currently, I work at a company where I write a lot of PHP, SQL queries, a lot of front-end and all of us are expected to be full-stack.

My only advice to you would be:

1. Start slow. Try to spend a lot of time learning from other people's code and attempt to imitate a lot of code which is already out there. Solve the same problem many other's have done and trust me that you will learn a lot more from it.

2. Why don't you start a blog? You can start with a blogging system in the beginning and maybe later you can write your own.

3. When you say:

> "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."

My answer would be, "If you can solve a problem for yourself, then there is bound to be a person who is benefit from it."

Good luck to you.

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

#85
>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.

Well, first think of a site. Something that's not "hello world", but it's not Gmail or Facebook either. Something simple.

E.g. create a site were a user can log in, write notes, and save them.

That can be the start -- it's a real problem (not novel, but real) and it teaches you how to move forward from hello world.

Then you can add to it: - Auto-save the notes as the user writes. - Let the user write notes in a rich text editor. - Let the user share his notes with other users. - Let the user mail the notes. - ...

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

#86

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…

[deleted]

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

#87
post #69

No no, don't work on petty real problems just yet, because you have only finished half of the programming training, specifically the bottom half that is the lowly Javascript(or PHP). Now you need to spend 3 months on a lisp language(Clojure, Racket, SBCL, Arc, doesn't matter), then another 3 months on Haskell, the King among Kings of programming languages, yet another 3 months on the almighty Emacs, and finally 3 mon…

>because you have only finished half of the programming training, specifically the bottom half that is the lowly Javascript(or PHP).

Sorry, that BS. Nothing "lowly" or "bottom half" about Javascript or PHP.

(And I've started 20+ years ago on Sun OS and Solaris and HPUX and doing C in actual terminal boxes...)

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

#88
One of the best quotes I've heard about programming was from an old C++ developer I knew- "the best way to learn how to program is to start 10 years ago"

The fact you are asking this question is a great sign. This is a key skill that is overlooked in technical hiring and by many development blogs trying to qualify what makes a "good" programmer. Problem abstraction is a huge part of software development. I work in enterprise development around a very specific niche of oil and gas. (ETRM) the "programming" I do amounts to little more than reading and writing to a database. The tricky part is modeling a business process and breaking it down into manageable units of work. For what I (and probably most developers) do, language is just syntax to know and interchangeable.

In my experience, programming is a series of learning curves and plateaus. A lot of what I know just comes from experience. The best way to learn is to program. You will eventually see patterns in the types of problems you see and know the general approach to solving it even if you don't have the exact answer.

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

#89
post #24

1) Go to Github 2) Browse the Javascript projects 3) Look for projects which are active with many follows/forks 4) Click on the Issues tab 5) See what open issues there are 6) See if the maintainer is active and applies pull requests 7) Pick an issue you can fix, fix it, write a patch 8) Send a pull request 9) See if the maintainer has any comments 10) Go back to step 1 See - you're solving problems. This is the kind…

Yes! There are so many comments in this thread and the last one makes the most sensible suggestion: get involved with an open source project!

There is absolutely no point in starting your own projects from scratch when you've never seen other projects.

Fixing random bugs in open source software is great for two reasons:

1) you'll need to read large amounts of code to find bugs, learning things about coding style, design patterns, architecture along the way

2) What you do actually has a purpose. There's nothing more boring than programming for the sake of "practice"

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

#90
Apart from good advice already given in this thread, solving problems with code usually consists of the following actions:

1. Define the problem - think about/write down exactly what you want the final program to do.

2. Break it down into smaller problems, then break those further, right down to the smallest.

3. Solve the small problems individually, one by one.

Post reply on HN