9

I gave up on programming a little over a year ago when I kept hitting this wall. I am revisiting the subject because I want to create basic Android application. But I feel that my limited knowledge will not suffice.

Here is my problem.

I have read a few books and watched video tutorials on C#/Java, followed examples, then finished the book. In the end they always seem to leave me dumbfounded as to what to do next.

What a mean is they teach you from your basic "hello world" application all the way up to if's and arrays then seemingly expect you to know how to go out into the world of coding and create anything.

Am I missing something here? I know these are the building blocks of all programs but books that I read never really show me what to do next.

The easy answer I suppose would be to 'start coding', but where? I read "Head First Java" for example; up to the part were they tell you take everything you have learned and create a dog racing game....

"try not to cheat and look at the source code provided, you should be able to do this by now" _ that's not an exact quote but basically that's what I was told.......

Half an hour ago they were just explaining how to do arrays, then without any theory I am meant to create a working game?

The reason I ask this is because I fear that this is all I am supposed to know to at least start coding, yet it feels like I have been given a small toolbox and been told to build a skyscraper.

Thank you for any advice

2
  • "Dog racing game" could mean a lot of things. For starters, does it even involve any graphics? As long as what you're creating doesn't involve any graphics then I would think that's perfectly appropriate for a beginner. Maybe do hangman instead just to avoid thinking about images...
    – jhocking
    Commented Jan 9, 2013 at 23:08
  • It's quite possible to build a skyscraper with that small toolbox--big programs are just organized collections of a LOT of small bits. You won't be able to NOW, though--you have to start out building a birdhouse and work your way up. As jhocking said, don't try to do anything with graphics yet--there's a good reason the beginning stuff is always based on unformatted text. Commented Jan 10, 2013 at 4:51

8 Answers 8

10

What a mean is they teach you from your basic "hello world" app all the way up to if's and arrays then seemingly expect you to know how to go out into the world of coding and create anything.

Am I missing something here? I know these are the building blocks of all programs but books that I read never really show me what to do next.

Actually, no. They aren't. The building blocks of all programs are abstraction and reuse. Lots of programming languages don't even have arrays or ifs or loops.

There are some great books that teach you how to program as opposed to how a particular programming language works, which seems to be the books that you've been reading.

How to Design Programs aka HtDP is such a book. It teaches you, well, how to design programs. And it does this by giving you recipes to follow for how to analyze problems, solve them, transform them into algorithms and further into working programs.

Note that "recipe" is basically another word for "program", so in other words, the book teaches you programs for humans to run in their heads in order to generate programs to be executed by computers. How cool is that? :-)

The authors are currently working on a draft for a second edition of HtDP, which you might want to read instead of the first edition. The material about imperative programming has been removed, and is going to be covered in the as-of-yet unwritten second volume How to Design Components, but you can read those missing chapters from the first edition.

Note that HtDP assumes no programming knowledge and is targeted at high school students. But don't let that stop you: it just means that you'll probably be able to finish some early chapters faster, but I don't think you will be bored.

Concrete Abstractions is also a good read along similar veins. Like HtDP, it doesn't assume any programming knowledge.

Another book that you might hear mentioned is Structure and Interpretation of Computer Programs aka SICP. It is one of the greatest programming books ever written, and again, it doesn't assume any programming knowledge.

It is, however, geared to complete newbies who study at MIT. And so, while it does not assume any programming knowledge, it does assume quite a bit of domain knowledge, e.g. in the fields of electrical engineering, physics and math. Note: these have nothing to do with the concepts being taught, they are just needed to understand the exercises and examples. So, it might be better to read HtDP or Concrete Abstractions first, and then read SICP.

8
  • 1
    I've never heard of a programming language without an if statement or some kind of loop: It wouldn't be turing complete without them. Commented Jan 4, 2013 at 10:07
  • @Martin Schröder: There exist programming languages without loop statements and they are Turing complete.
    – Giorgio
    Commented Jan 4, 2013 at 10:31
  • @Giorgio: For example? AFAIK you need some kind of loop/goto. Commented Jan 4, 2013 at 10:32
  • 2
    @MartinSchröder: Lambda Calculus is Turing-complete (in fact, it is the language for which that term was invented), and it has only function abstraction and function application. It doesn't even have recursion, you have to encode that using a fixpoint combinator! On the flipside: there are plenty of programming languages which aren't Turing-complete, like SQL (before 2003), or more subtly, C (Turing-completeness requires infinite storage, but C guarantees that you can take the address of anything and store it in a finitely sized variable). Commented Jan 4, 2013 at 15:14
  • 2
    @MartinSchröder: Or, another tack: there are programming languages where merely compiling the program can force the compiler to solve difficult problems. In C# you can encode 3-SAT problems as overload resolution problems and make the compiler solve them, and in Haskell you can actually encode problems equivalent to the Halting Problem into the type system and make the compiler solve them. You seem to think of "programming languages" as being imperative languages but there are many non-imperative languages that can represent complex calculations. Commented Jan 4, 2013 at 16:26
5

Well, you are not in a unique situation. Most of the books the beginner books in programming language tend to focus more on the basic building blocks of the language and that is a good thing. However as it happened with you, at the end we find ourselves in a situation where we have learned every single construct the language has to offer but can't apply that to solve some practical problems. In short, the gap between textual examples and practical programs can be bridged only when you try to play with the code(as Telastyn) said.Here is what I generally do while learning some new stuff :

  1. While learning from the book, try to find some real life scenarios where some code example/technique in the book can be applied.
  2. Try to mix the example programs given in the book to make something that is bigger and complicated. After that try to minimize the code and write a different code that gives the same result.
  3. Google for practical projects for the language under consideration.
  4. After you are sure you have learned the basic language element, experiment with a framework of your choice. For first time, chose something that has an easier learning curve.
  5. Look out for some existing project and try to study its design.
  6. Go for advanced books that teach you more advance application design stuff like application patterns, OO design and implementation etc.

In the end its all about practice and research that will help you enhance your programming skills and ultimately make you an architect of many skyscrapers.

2

See this for C#. It's very complete: http://www.programmersheaven.com/ebooks/csharp_ebook.pdf I used that myself, just half a year ago. I use the #Develop compiler with it for the examples. I cannot help you much with Java because I hardly ever used it.

When it comes time to program, what many people don't realize is that you usually use an additional SDK or framework for what you're designing. So don't expect to jump immediately from Java or C# to phone programming, because you're likely to need a good intermediary framework, and the learning curves for those can be just as tiresome as the learning curves for the programming languages themselves. Although the C# tutorial I posted only covers C#, many of the concepts it covers are seen in other Object-oriented languages, like Java.

Edit: The scenario you describe is, unfortunately, the route that many tutorials follow. You don't have to follow such a tutorial, and if it works against the way you learn, it's probably best to try and pick up a different one (I don't know of any, but Google probably does). But just to be sure, check to see if the author of that book you're describing explained the code line by line. Don't worry about how smart you are, only a prodigy could go straight from a book to a working game. Just remember, tutorials are by no means the standard measurement of ability, so go for whatever teaches you the best and don't get discouraged!

1
  • Great answer, and I'd like to add that you should decide on a project you'd like to undertake. Google ways to solve the problems the project presents. You will learn a lot by looking for better ways to solve the issues you are faced with. Commented Jan 4, 2013 at 3:14
1

Yes, that should be plenty to make super basic programs. At this point you try to make a slightly more complex program than what the books had you do. When you need to do something specific and don't know how even with some work, then you search the Internet or ask a teacher/mentor. This will lead to more advanced features (and fairly often to a dead end since you unknowingly picked something way more complex than what you can do).

No book is going to teach you how to solve problems.

No book is going to explain how to design programs - that comes with practice. No book is going to teach you how to make a non-trivial application - there is just too much nuance; you would learn how to build that implementation not things like it.

The best way to learn at this point is to dabble. To play around with the code to create something. Just like artists often start off doodling little tidbits that get progressively more sophisticated and good looking, so do programmers need that exploratory progression.

2
  • 1
    "No book is going to explain how to design programs" – The authors of How to Design Programs might disagree :-) Commented Jan 4, 2013 at 3:41
  • 1
    @JörgWMittag: They'll have some common techniques and demonstrations of typical programs, but anything non trivial is going to require a large degree of learned human judgment, which as of 2013, still cannot be mechanized. Commented Jan 4, 2013 at 5:25
1

I can't really remember if I used a book to get into programming, but I guess in those days it was more a syntax reference manual instead of a tutorial book. It taught me what the programming language could do, but not how to build a real application with it.

Luckily there were some examples in the book that I used to type in (yes, no downloadable sourcecode examples then) and then tried to figure out how it worked. That's not the optimal way to learn programming, but to me it was fun at the time.

What I would recommend is that you set yourself a goal like "I want to build a Javascript application that draws a bouncing circle" and then use your already acquired knowledge to start and look up everything else in the language SDKs/documentation and/or here on SO.

That's the approach I'm using when I try to jump into a new language and learn my first steps. Most of the books I read in the recent days I wasn't satisfied because I got the same feeling of missing something important. But luckily we have the internets now, so whatever language you want to learn, you can find example sourcecode on the internet and use that to continue your learning.

edit Of course, some more general books teaching you how to design an application or which process (SCRUM, XP, V-Modell) to follow is a good addition to the pure language knowledge.

1

I agree with Jörg that you should also read some general books on the concepts of programming rather than learning too many details about a particular language at this stage. Regarding the book How to Design Programs, it is used as a reference in this course, which could be of interest for you.

Otherwise, another tool that others have not mentioned is speak a lot with other developers. I remember that for me one of the most effective ways for learning to program was to spend many hours discussing with colleagues or other programmers about aspects of programming, programming languages, techniques, or concrete problems I was facing at that particular moment. Oral transmission of knowledge can still be one of the most effective means for learning new skills.

1
  • +1. I know people who go to conferences without going to a single talk. They just go there to hang out in the hallways and discuss problems with total strangers, just to get a different point of view. Commented Jan 5, 2013 at 3:20
0

I would suggest finding open source projects and turning those into personal sandboxes. Modify existing behaviors, add new behaviors and delete some too. Play around, implement your own ideas and "what if I tried this".

I'm not advocating you convert someone elses open source project and claim it your own.

I am saying look at other working projects as a means of teaching yourself how to get to the next steps. There's lots of sites available with opensource code to download. Here's a few that come to mind: CodePlex CodeProject

-5

That's coders life. You don't know a technology, but you develop a 'hello world' and you become an expert. In companies (real life) it's how it works. Good Luck

1
  • 2
    That's not a very useful answer.
    – svick
    Commented Jan 4, 2013 at 21:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.