Live data from Hacker News

Ask HN: When does programming start to make sense?

news.ycombinator.com

31–40 of 53 posts

Re: Ask HN: When does programming start to make sense?

#31
post #8

Earlier quoted context omitted.

What is causing the frustration?

I can see the solution in my head as a picture, not words. Maybe I need to practice framing problems more.

This is actually good, its how I do it, and I have success. You see programming as an abstract mechanical thing rather than abstract descriptive thing.

Take a look at http://users.evtek.fi/~jaanah/IntroC/DBeech/3gl_flow.htm and get the gist of the symbols, then chart out things like if, if/than, while, for, etc. Don't forget do/while, since this is also a fundamental, but its not always represented in your language of choice, and is sometimes simulated with things like an infinite loop with a break.

Move up to some simple programs. These symbols don't represent data structures (arrays, objects) so you can fudge that part.

When it clicks then stop using it. But keep in mind, when you run across something where the logic is confusing, or especially if you can't figure out a clean way to represent the flow, come back to your old friends, and you'll be amazed at how they will guide you. I still fall back on flow charts, they aren't a crutch, they are a tool.

Re: Ask HN: When does programming start to make sense?

#32
Don't worry, you don't become a professional programmer in one day. It's a long process.

I started programming (Qbasic) at the age of 12. My first programs were just some combinations of blocks of code taken from the help document. Until 18, I had been always an amateur programmer. Then Things changed. Programming can be flipped from fun to work. I can get paid to have fun, so why don't do it?

I was introduced to the real world and I discovered that my knowledge, as huge as it was (a little from everything) wouldn't really help building the smallest application. I also can't write code on my own. I need another application to copy from or re-use the code. My frustrations began, but they lasted short.

I started reading books. My target was Visual C#. I read a book about .Net fundamentals and another one about Visual Studio. I become a better programmer. It did took me months to understand OOP, but I finished by mastering it. And yay! I used collections.

I left Visual C# and decided to develop for the web. I planned to learn it from scratch. From the start to the end. First, I need a strong knowledge about the Client Side. That is HTML, CSS and JavaScript. The first two are somewhat easy to master and learn. JavaScript is very expressive and can take a while to master.

Actually, I felt in love with JavaScript and with it's prototypal and dynamic nature. I'm 19 and I already built 2 scripts that I'm selling on code canyon (I'm working on the third right now ;)) Suddenly while browsing on the web, I found a small niche, that can be valued to $100K/year. It's hidden somewhere and related to JavaScript. No one explored this domain (except low-quality Open Source solutions) I made my researches, grabbed a related domain and making a plan.

Learning Programming? Oups! I forgot about it!!!

Re: Ask HN: When does programming start to make sense?

#33
post #3

It took me a long, long time until I became reasonably confident that most problems would eventually succumb to my programming ability. Probably almost twenty years from when I wrote my first program, or a few years after college. I can't write code on my own, though -- unless the problem is trivial and the APIs I'm using I know like the back of my hand, I need an Internet connection to do it. Part of this issue is p…

That is interesting. The experience has been almost the opposite for me. When I first started programming, it did not take me long to start "getting it", and I was very confident that there was no programming problem I could not solve. As the years went by, I've noticed that my confidence has decreased to the point where I am almost certain that there is no problem I can solve (besides the most trivial ones). Maybe I'm just getting dumber.

Re: Ask HN: When does programming start to make sense?

#34

Programming, as a whole, is far larger than any one person could come to comprehend in a single lifetime (imagine it being 1000x bigger). And to make matters worse, it is continually growing more complex at a rate no person could follow either! Just when you think you've finally gotten a solid grasp on writing CRUD apps in PHP, someone shows you Haskell, or Prolog, and suddenly realized just how little you thought yo…

Disclaimer: I am very much a novice when it comes to any kind of programming; I have only been working in PHP, which I know is considered a scripting language and not a programming language, for a few months now. My understanding is relatively limited.

"Programming, as a whole, is far larger than any one person could come to comprehend in a single lifetime (...) And to make matters worse, it is continually growing more complex at a rate no person could follow either!"

Isn't programming, essentially, the writing of instructions and providing them to systems that act upon them? Reading through that statement I wonder whether it's not programming that is complex, but many problems that exist in various fields of business or study—problems that need a programmed solution.

Please—if you don't mind—would you elaborate?

Re: Ask HN: When does programming start to make sense?

#35
I've been writing code 'on my own' since 4th grade. My school gave a class on programming the Apple IIe and I loved it. My parents bought me a series of computers, starting with a Sinclair 1000, and I wrote little programs for all of them until they weren't good enough and we upgraded. I taught myself several other forms of basic, then started on other languages like C, PHP and Cold Fusion.

Maybe you need to stop 'learning' programming and just do it. Pick a task you want to complete, possibly even a task you've done before, and just do it.

I learned all those other languages and language variants starting with the same program: Sierpinski's Triangle. Why? Because I already knew the logic for it inside and out and it was entertaining to watch. Every new language I came across, I wrote another Sierpinski's Triangle program on it as my first program.

Re: Ask HN: When does programming start to make sense?

#36
post #8

Earlier quoted context omitted.

What is causing the frustration?

I can see the solution in my head as a picture, not words. Maybe I need to practice framing problems more.

That's interesting, and actually quite encouraging: it suggests that you do think in terms of abstractions of the problem you're trying to solve, which is arguably the most fundamental skill in programming. If your difficulty is that you haven't got the mechanical process of turning your thoughts into code down yet, that's a much easier thing to overcome.

Could you share with us what books and programming languages/tools you've been using? While there are certainly common ideas, different types of language take a different approaches to describing a program. Maybe whatever you've chosen doesn't suit your way of thinking particularly well, and you would find another tool more intuitive at this stage.

Re: Ask HN: When does programming start to make sense?

#37
I've got C64 and manual in German when I was 10 (I've only knew Polish at that time, but who cares :)).

For a few years I only played games, and sometimes entered some example BASIC code and tinkered with constans in code to see what will happen. I remember that my copy of manual had error in some magic graphic system initialization code, so I've never programmed graphic on C64. It was very frustrating.

Then I've got PC when I was 15 and I played with Turbo Basic, then Turbo Pascal - then I've understood variables and it all started to make sense. Since then I only feel like I know less, and less :)

PS - the most impressive thing I've seen that encuraged me to keep programming was ASCII art adventure game written in windows batch files. I've thought - if someon can do so much witch bat files, I can do everything with my knowledge of Turbo Pascal :)

Re: Ask HN: When does programming start to make sense?

#38
post #34

Programming, as a whole, is far larger than any one person could come to comprehend in a single lifetime (imagine it being 1000x bigger). And to make matters worse, it is continually growing more complex at a rate no person could follow either! Just when you think you've finally gotten a solid grasp on writing CRUD apps in PHP, someone shows you Haskell, or Prolog, and suddenly realized just how little you thought yo…

Disclaimer: I am very much a novice when it comes to any kind of programming; I have only been working in PHP, which I know is considered a scripting language and not a programming language, for a few months now. My understanding is relatively limited. "Programming, as a whole, is far larger than any one person could come to comprehend in a single lifetime (...) And to make matters worse, it is continually growing mo…

whether it's not programming that is complex, but many problems that exist in various fields of business or study

Unfortunately, it's both. ;)

While PHP is indeed a programming language (the term "scripting language" is a fairly meaningless label) when you work in PHP building web pages you're likely to spend most of your time working on things that are computationally tractable [1], but hard because it's just hard to translate the customer's problems into code within the available budget. Your customer has a problem, it's lots of work to map that problem onto code, it's hard to explain to the customer just how much work it is to turn the "simple" activities performed by (say) their administrative assistant into algorithms, and the result tends to be expensive to document, deploy, and maintain. So, yeah, it's the problems that seem to be hard, not the "programming" -- though, in fact, there is no hard-and-fast distinction there.

But then there are problems in programming that are difficult to impossible, all by themselves. The CS folks around here can point you at plenty of them, but here's a famous one:

http://en.wikipedia.org/wiki/Travelling_salesman_problem

which is a member of an entire class of famously hard-to-compute problems:

http://en.wikipedia.org/wiki/List_of_NP-complete_problems

which (I believe) are not particularly rare, but which come up in various disguises, and which must be carefully worked around.

On a somewhat more applied level, there are lots of difficult problems in code optimization that you can work on:

http://en.wikipedia.org/wiki/Low_Level_Virtual_Machine

Or you can spend your day exploring a giant set of data-storage possibilities, each of which is right in its own way, and wrong in its own way:

http://en.wikipedia.org/wiki/CAP_theorem

http://www.allthingsdistributed.com/2008/12/eventually_consi...

One may suspect, of course, that this distinction I'm trying to draw between "difficult programming" and "difficult problems" is not real; it's just a matter of the degree of abstraction you use when describing the programming. And I think you'd be right to suspect that. Programming is programming, and programming is hard.

---

[1] Though it is very, very possible to put something that is computationally intractable into a "simple" web page. Web pages have no upper bound of complexity.

Re: Ask HN: When does programming start to make sense?

#39
By the way, I have other problem with programming.

For some time it's not technical difficulty that prevents me from acomplishing my programming goals, but my laziness.

I am very good at learning new languages, APIs, programming techniques, etc, because that offers me fast positive feedback. I feel good because I've learned sth new.

But to achieve anything I have to sit down to real, boring work, and this I am to lazy to do. I prefer to try new cool languages than do any useful work in languages I already know. I feel worse programmer than I was when I only knew Basic and Turbo Pascal, no matter all the techniques, design patterns, languages, etc, that I now know.

Do you have similiar experiences? How do you deal with this?

Re: Ask HN: When does programming start to make sense?

#40

You need to design first - on paper, white-board, etc. You wouldn't build a house without blueprints, so why try to write a big program without sketching stuff out so that you can break down into manageable chunks. If that doesn't help, then maybe you need to take a good CS course. If you have only programmed in C++, then it doesn't sound like a comprehensive background in CS.

Exactly this. The image of the lone hacker sitting down and pouring out a bunch of code straight from his brain is a romantic one, but if you haven't spent a little time deciding what your data structures are going to look like and how you're going to pass stuff around, etc., your code will be crap. "Just coding it" leads to both frustration as you sit wondering what you should be writing and why programming is so hard, and poor code. The poor code comes in when you start throwing in stuff like one-use elements in your structs to keep track of something you hadn't forseen, when a little bit of planning could have alleviated that.

I'm certainly not saying you should go write up a design document complete with UML and everything. That would be ridiculous, damn it I'm an engineer not a bureaucrat! Just sit down and think (on paper) about how some of the important stuff needs to look. It'll help a lot.

As for the second point, C++ does seem like a weird place to start. Go learn assembly or C. Learning to write assembly is a process of continually solving tiny programming puzzles, as you figure out how to hand-roll a loop and such.

Post reply on HN