120
votes

I've read lots of books for various programming languages, Java, Python, C, etc. I understand and know all of the basics of the languages and I understand algorithms and data structures. (Equivalent of say two years of computer science classes)

BUT, I still can't figure how to write a program that does anything useful.

All of the programming books show you how to write the language, but NOT how to use it! The programming examples are all very basic, like build a card catalog for a library or a simple game or use algorithms, etc. They dont't show you how to develop complex programs that actually do anything useful!

I've looked at open-source programs on SourceForge, but they don't make much sense to me. There are hundreds of files in each program and thousands of lines of code. But how do I learn how to do this? There's nothing in any book I can buy on Amazon that will give me the tools to write any of these programs.

How do you go from reading Introduction to Java or Programming Python, or C Programming Language, etc.. to actually being able to say, I have an idea for X program? Is this how I go about developing it?

It seems like there is so much more involved in writing a program than you can learn in a book or from a class. I feel like there is something.

How can I be put on the right track?

11
  • 52
    Some people just aren't meant to program. Only you can answer whether an alternative path would sort you out or if it's time to try something else. You're unlikely to get an answer that will be useful here.
    – duffymo
    Commented Dec 29, 2010 at 21:10
  • 3
    What would you consider to be "useful"?
    – user1249
    Commented Dec 29, 2010 at 21:17
  • 7
    @Michael - I, for one, voted as Off-Topic, move to P.SE. I thought that would be a more appropriate place for a discussion on programming as a career and a craft.
    – mtrw
    Commented Dec 29, 2010 at 21:17
  • 12
    @duffymo: And some people aren't meant to comment on questions.
    – user7146
    Commented Dec 30, 2010 at 3:06
  • 4
    I think you're just taking too long leaps. Going from the book examples to full-fledged Sourceforge projects is vast and daunting. Instead, try extending what you've already built. Add features, add GUIs, add network capabilities; and pretty soon, I imagine you'll have your own project on Sourceforge.
    – gablin
    Commented Dec 30, 2010 at 21:07

48 Answers 48

1
2
1
vote

Try thinking up the smallest program you want and code it. Just the other day I wrote up code that automatically downloaded every file from a list of files. That was actually the easy part. The hour was mostly spent on creating the GUI, having it load and save settings and small simple things like that. The GUI is a time vacuum.

Also I suggest using a language with a massive library (it doesn't matter if it's portable or not). And a statically compiled language if your starting out (which means no Ruby, Python or JavaScript). I like .NET using the C# language. You can try Boo with SharpDevelop or use C# or VB.NET using Visual Studio Express. I like Visual Studio because I am a power user and use things like Ctrl + -, Ctrl + [, Ctrl + ','. But anything with breakpoints and the callstack is good. The only reason I can stand to debugging JavaScript code is because Firebug has these (along with immediate window and a watch).

1
vote

I died too much in some ZX Spectrum game, so the only way was to add more lives. I had a book, that described what code and where I need to change, so it was pretty easy. Then I found how to add ammunition (unfortunately the game become pointless after that).

So from my point of view, the best way to learn - is to achieve minor and easy goals. For me it was modifying existing code. If you are satisfied with every program you meet, maybe programming is not for you?

1
  • Excellent point. It's a shame someone without the ability to understand what you said voted it down. Every programmer I know got interested in programming via games. And most of us did so to modify the games we were playing. From adding lives to changing the basic functionality of the game itself. That led to writing little games and then utilities and then little apps and then big apps.
    – Pickle Pumper
    Commented Dec 30, 2010 at 18:39
1
vote

BUT, I still can't figure how to write a program that does anything useful.

Really?? Well, I suppose if you just read the books and didn't do any example programs and so forth then that's possible, but seems a bit overstated.

Anyway, the best advice is to just start working on some idea that you are interested in. If you have a real interest then it can start small and grow and grow. That's usually what happens with me. I might start a project just for the fun of it, thinking it will just be a small test project. Then I add and add....

1
vote

Another problem is that, you need a different programming language depending on what you are trying to program.

If you want to program a Windows application that extends a Microsoft product, you have to use .NET C# or VB.NET or VBScript. If you want to program an iPhone you have to use Objective-C, Java for Android, Silverlight for Windows Mobile, maybe Java for financial applications, etc.

It's not like you can learn one language and then be able to program anything you want...

1
vote

"Out of Box thinking"

Hey, I asked myself the same questions five years back (at that time I hadn't heard about Stack Exchange). Studying programming every time won't make sense, you need to develop something.

Determine what to develop

1) Small goals make small and successful first projects

2) Plan so that you have little parts that clearly work and show you progress

3) Find something you're passionate about but is still small enough to be achievable

  • I build personal albums - which I have gained some Flash knowledge, Photoshop
  • I build my own personal blogs - gained some PHP knowledge
  • Bought Internet domains - gained some server knowledge

  • I find many freelance projects - I read their requirements and tried to build my own applications, I gained a lot of knowledge of programming, documentation, etc.

1
vote

Have you read Code Complete 2, and The Pragmatic Programmer?

These two books taught me a lot more than any course, tutorial, book or video.

Programming is about learning how to build something from scratch with a specific set of tools. But, if you do not know the fundamentals, you can't do anything.

0
votes

The primary difference between sucessful large applications and academic exercises is typically that the former are designed against a set of requirements. If you simply start with a vague idea in your head and start writing code, you are unlikley to get far.

So programming ability is probably not the issue here; what you really need to get you further is software engineering skills; i.e. the ability to capture and specifiy project requirements, and then to design a software architecture and detailed design to meet those requirements - this is the road map that will keep you on the right track throughout development. That is not to say the the requirements and design need be complete before you start to code (the waterfall method), incremental developmennt is a more flexible approach; but you should have some sort of framework and idea of how the application elements will interact and communicate.

Furthermore, a requirements specification and design is more-or-less essential if the project development is to be implemented by more than a single developer (another common feature of large projects).

Another feature of sucessful large scale applications is a strong motivation to complete. What would motivate you to do that I cannot say but in my case I am paid for it, I seldom write software for mere fun any more, but getting paid to do what you might otherwise do for free in any case is a great way to make a living.

0
votes

I learned programming because I know what I want to program.

Programming requires problem-solving skills, which it's hard to learn. Try to reproduce something "everyday", like a vending machine program that calculates changes in coins, and also an elevator simulation.

0
votes

Think of something that you would would find useful and try making it. I mean something sensible, not Photoshop :-)

0
votes

The only way you're going to learn to program is by... writing programs.

0
votes

Simple, try to do better than written in your book.

0
votes

I have found that something which benefited me greatly in this area was looking at code that other people have written. I mean code they wrote outside of school since school assignments typically are not applicable to the real world.

0
votes

"The secret is there are no secrets" - Kung Fu Panda . First don't panic, choose a language and start writing something like tic tac toe game and keep adding new features. You have mentioned that you have read too many books but have you implemented what you learn? Try to look around you and find what manual system you can convert to automation, or what existing program can you re-engineer. Patience and Imagination is key to success in programming though i am not a great programmer but i am trying what i shared and its working. :)

0
votes

Yeah it's amazing how many "moving parts" are involved in making our software/hardware run. Partly it's because problems are incredibly complex, and need to be subdivided into managable parts. Partly it's because problems are incredibly complex, and no-one knows what they are doing. :) We have tens of programming languages, and hundreds of programming frameworks and libraries. Everything is blackboxed and layered. You can't do anything useful within just one layer of this mess. Need to learn and master the limitations and quirks of multiple layers. And writing everything yourself is close to impossible. Simple things grow unimaginably difficult as the code base increases.

0
votes

You can find plenty of good answers here, but still, let's add this.

First of all, don't panic. A lot of people learned programming to different degrees, you will find the level that suits you, that's for sure. Work hard on reaching a quite high level, one step at a time.

Start in small. I remember one of my first applications, it was basically a frontend for an MP3 encoder. Nothing fancy, it just started a command line app with different parameters. But I enjoyed it!

PS: One of the most useful skills is that you should practice all the time: how to ask better. If you can ask in a really good way, you will find the answer in no time.

0
votes

The biggest challenge to learning how to program is to come up with something someone finds useful.

My biggest issue in programming for myself has always been inventing problems that needs solving.

I started programming in the mid 1980s by doing a course and then working for a company that told me what to solve. Your alternative is to do what I did in the 1990s when I wanted to learn JavaScript - I joined communities (one was the site Stack Overflow calls the hyphened site - start the downvoting...) where people asked questions, and commented with my suggestions on how to solve the problem. Having a specific task with a known input and output, really helped me focussing on finding the answer or similar answers and applying this to the problem at hand. After a few years of answering questions, I was fluent.

I am now doing the same with jQuery. I would have a hard time learning the jQuery syntax without specific problems that can be solved using that framework.

0
votes

Have you played the game of Chess ??. One can teach you the moves, but making them useful is your own concern. You can't learn from a watching a chess game played b/w two individuals instead of playing yourself; Similarly learning from a single USEFUL project as you said, won't help. You need to delve into your own requirements and make a project out of it.

Every project has his own requirements. Seldom, you will find a project using all the features of the language. Therefore, the books focus on the basic features, rather than taking a project and reading out.

To be honest with you, I too searched for a working sample of WPF application when i had to make one few months ago. Found nothing and then read from the books and internet and got things rolling.

And the last thing is that these already made applications or projects make you more confused than ever, because they are made by professionals who have their own styling and tweaks. To get to that level, you need to forget about everything else and just start coding and later on StackOverflow is always there to help you out.

-1
votes

Enlisting the help of Adderall.

2
  • I'm not sure who "disliked" my answer, but whatever. As a note, it wasn't a sarcastic or coy response... it helped me immensely. I wasn't advocating acquiring Adderall illegally, but I don't really think it's such a far out suggestion really. Commented Jan 6, 2011 at 1:20
  • 2
    It is used to treat ADHD which is apparently very common in the programming community. I'd say drugs are not the be all end all but he does have a point.
    – Terrance
    Commented Jan 6, 2011 at 15:51
1
2