Programming Concepts

Soldato
Joined
19 Dec 2009
Posts
2,669
Location
Lancashire
Okay, so I think I've narrowed down the reasons for my frustration when it comes to programming. The first of these is focus which, as far as I'm aware, there's not an easy fix for and is something that I really need to work on myself to improve (unless, of course, someone knows of a miracle cure! :p). The other is a lack of knowledge of the concepts behind programming. I have the basics down (i.e. I understand statements, functions, variables, scope etc.) but when it comes to things like OOP, code re-use, functional programming etc. then I unravel in seconds.

So I have two requests, I guess. First of all, is there a particularly good tutorial out there that explains all the principles of programming in general (things that apply across the board, rather than being language-specific). Secondly, are there any small exercises I could use to help learn them? In the past, I've struggled for things to do which has also hindered my progress a little. I tried Project Euler but I'm not exactly great with maths... :(

I've decided to start afresh, sort of, in that I've picked a language that's supposed to be easy to pick up and can be used in a variety of ways, for a wide range of things (Python). Hopefully that will work out better for me than C, where I'm struggling to get my head around lower-level stuff at the moment and, to be honest, isn't interesting me as much as I had thought it would.

Does anyone have any suggestions for the above, places I can look and things I can do to help with learning?

If I didn't quite make sense or missed something, I apologise. Haven't slept more than a few hours since Sunday night. :(
 
Good choice on Python, it's awesome :)

Programming Challenges by Steven Skienais a good general book for programming challenges but it soon gets hard. My advice would be to pick a problem and solve it, make something you have an interest in and ask loads of questions on places like here and Stack Overflow, 99% of problems you will encounter will have good, well documented solutions :) So make something like a music player, file downloader, file compressor/splitter etc and add as much or as little complexity as you need to learn a concept.

Also, my old university lecturer had a great book covering general beginner concepts, it's C# focused but you should be able to translate the concepts, can get it here: http://www.robmiles.com/c-yellow-book/Rob Miles CSharp Yellow Book 2010.pdf

It's all about practice :)
 
Good choice on Python, it's awesome :)

Programming Challenges by Steven Skienais a good general book for programming challenges but it soon gets hard. My advice would be to pick a problem and solve it, make something you have an interest in and ask loads of questions on places like here and Stack Overflow, 99% of problems you will encounter will have good, well documented solutions :) So make something like a music player, file downloader, file compressor/splitter etc and add as much or as little complexity as you need to learn a concept.

Also, my old university lecturer had a great book covering general beginner concepts, it's C# focused but you should be able to translate the concepts, can get it here: http://www.robmiles.com/c-yellow-book/Rob Miles CSharp Yellow Book 2010.pdf

It's all about practice :)

Thanks for that, those sound like some good starting points. I actually have the Yellow Book sat on my hard drive, but haven't delved in to it as at the moment, I can only use so much C# due to being limited to Mono (unless Mono has improved significantly since I last looked at it >.>). If practice is indeed the answer, then I imagine the focus part of this is really the issue and is preventing progress. I'm looking at setting up a quiet space where I can just sit, go through things and play about with code. Hopefully that will help.

Thanks for the tips. :)

billysielu said:
You pick up those high level skills on-the-job. You know enough to apply for a junior/trainee programmer role - that's probably the best way to improve.

Well, that's interesting, because I don't think I have anywhere near enough knowledge for any of the jobs I've seen listed, even at junior/trainee levels - a lot of them are asking for a degree in a computer-related subject, and a decent level of experience with a programming language, neither of which I really have. If I could find a job that was more along the lines of an apprenticeship, then I'd jump at the opportunity, because on-the-job learning is how I've got to where I am in terms of IT. Sadly, I haven't been able to find anything like that.
 
Check out 'Objects First with Java'. It nails everything you've asked for. Naturally it is focused on OO concepts in Java but it will explain fundamental programming concepts that apply to other languages. It explains stuff clearly and in very logical steps and is careful not to introduce concepts that rely on assumed knowledge. It has its own IDE, purpose built for people new to programming (it's not for developing code). The book contains various exercises throughout to test one's understanding. I really should be on commission for how much I recommend this book.
 
Check out 'Objects First with Java'. It nails everything you've asked for. Naturally it is focused on OO concepts in Java but it will explain fundamental programming concepts that apply to other languages. It explains stuff clearly and in very logical steps and is careful not to introduce concepts that rely on assumed knowledge. It has its own IDE, purpose built for people new to programming (it's not for developing code). The book contains various exercises throughout to test one's understanding. I really should be on commission for how much I recommend this book.

Hmm, interesting. I'd be willing to take a look and see if it looks like the kind of book I'd get on with. Is there a sample on the website or would I have to find a copy to have a quick flick?
 
Thanks, I'll have a quick look at those links during my break. Not entirely sure Java appeals to me, but the concepts are what I want to get down, so it may well be worth looking in to going through that book.

Keep the comments coming, this is proving helpful so far. :)
 
If you want to wrap your head around OOP, it might be worth taking up an explicitly objective language like Objective-C. Its a superset of C, so C code is still perfectly valid, but it encourages you to think about things in terms of objects.

For example, the message dispatch syntax of [reciever message]

[person eat:apple]
[receiver function:variable]

Its also great for wrapping your head around calls to 'super' and 'self' and how they resolve in an inheritance chain.

There are lots of excellent docs on the apple dev library:

http://developer.apple.com/library/...C.html#//apple_ref/doc/uid/TP30001163-CH1-SW2
 
Last edited:
I agree with Python, it's a brilliant beginner language. It's one of the few languages where you can clearly concentrate on the problem at hand and not the syntax of the code.

I recommend going with 2.X version of Python and not 3. And I also recommend a book called "Byte of Python" which is a very good book for a beginner, very clear and concise.

http://www.swaroopch.com/notes/Python

Python has a pretty good community, and offers an IRC channel on freenode purely for Python.

Good luck.
 
If you want to wrap your head around OOP, it might be worth taking up an explicitly objective language like Objective-C. Its a superset of C, so C code is still perfectly valid, but it encourages you to think about things in terms of objects.

For example, the message dispatch syntax of [reciever message]

[person eat:apple]
[receiver function:variable]

Its also great for wrapping your head around calls to 'super' and 'self' and how they resolve in an inheritance chain.

There are lots of excellent docs on the apple dev library:

http://developer.apple.com/library/...C.html#//apple_ref/doc/uid/TP30001163-CH1-SW2

Interesting. I've never actually looked in to that, as I've always seen it as being fairly limited to iOS - is that the case?

I agree with Python, it's a brilliant beginner language. It's one of the few languages where you can clearly concentrate on the problem at hand and not the syntax of the code.

I recommend going with 2.X version of Python and not 3. And I also recommend a book called "Byte of Python" which is a very good book for a beginner, very clear and concise.

http://www.swaroopch.com/notes/Python

Python has a pretty good community, and offers an IRC channel on freenode purely for Python.

Good luck.

Is there any specific reason you're recommending the 2 series over the 3 series? I was looking more towards 3 for future-proofing and not really having to make the transition, but is there a reason I should avoid learning 3 or anything I should really be looking out for?

Thanks. :)
 
While you're looking up good concepts to be aware of before you go looking for a job, make sure you include TDD (Test driven development), and DI/IOC (Dependency injection & Inversion of control).

The latter may not be so important if you're looking to use Python, but it's still good to be aware of these things.
 
Not entirely sure Java appeals to me

What does appeal to you and what's wrong with Java?

Please ignore the snobbery associated with this language. There's a reason it is used a lot in industry. Old notions of it being a slow language are quite frankly just ignorant. Yes it isn't the fastest language to get going but once it is going the JVM translates commonly used method bytecode into native code. The only thing that consistently beats it performance wise is Fortran. It's object-orientated (get to know C and you'll appreciate OO concepts) and the API is brilliant. I fail to see why Java wouldn't appeal to programmers that just want to get stuff done.
 
What does appeal to you and what's wrong with Java?

Please ignore the snobbery associated with this language. There's a reason it is used a lot in industry. Old notions of it being a slow language are quite frankly just ignorant. Yes it isn't the fastest language to get going but once it is going the JVM translates commonly used method bytecode into native code. The only thing that consistently beats it performance wise is Fortran. It's object-orientated (get to know C and you'll appreciate OO concepts) and the API is brilliant. I fail to see why Java wouldn't appeal to programmers that just want to get stuff done.

Well, there are two major things, and one of them is unfortunately not so much programming related, but the JRE has been such a pain for us here that I try to avoid using software that depends on it as much as possible. The syntax also looks somewhat verbose and awkward (but the most experience I have is with VBS, so this is to be expected). That's not to say I'm unwilling to try it, just that my first look makes me think "hmm". Diving in to it could prove to be different though, I'm quite open-minded about that. :)

In terms of what does, I like how the syntax of Python and Ruby, for example, look. It seems quite natural. But I also want to learn a language that is relevant both industry and the Linux environment (I'm quite interested in getting in to developing applications that are useful to Linux users). I'm generally open to anything, and of course what I think now isn't entirely important, seeing as I've only looked at a few examples of each.
 
Well it is important that you to find the syntax natural so perhaps Python might be a nice starting point to learn the concepts in :) I'm rather biased towards Java as it's the language I started with so I obviously find it the most natural.

Although I haven't had issues with the JRE I certainly don't have experience of it within an organisational context so your points are valid. I would argue it's a configuration issue though and not a limitation of Java.

Do you think Java seems complicated to make you think "hmm"? If you understand each concept in isolation then it will eventually all fall into place, trust me.

If you're looking to do cross-platform development then Java is quite ideal. If you learn Java then there's no reason you can't code for any device running the JVM such as mobile phones.
 
While C++ is certainly OOP focused, it has a number of features that somewhat butcher the principles, including and not limited to multiple inheritance, which is why Java, C# and objective C are more suitable languages.

Butcher? Really? :confused: I would say it's certainly less constrained, but it's entirely possible to write C++ code using precisely the same principles as the more restrictive OO languages..
 
Well it is important that you to find the syntax natural so perhaps Python might be a nice starting point to learn the concepts in :) I'm rather biased towards Java as it's the language I started with so I obviously find it the most natural.

Although I haven't had issues with the JRE I certainly don't have experience of it within an organisational context so your points are valid. I would argue it's a configuration issue though and not a limitation of Java.

Do you think Java seems complicated to make you think "hmm"? If you understand each concept in isolation then it will eventually all fall into place, trust me.

If you're looking to do cross-platform development then Java is quite ideal. If you learn Java then there's no reason you can't code for any device running the JVM such as mobile phones.

It makes me go "hmm" because it looks like there's a lot to take in in terms of language features and syntactical rules. Again, that's based on what I've gathered from introductory material, so I'm only relying on first impressions. :)
 
It makes me go "hmm" because it looks like there's a lot to take in in terms of language features and syntactical rules. Again, that's based on what I've gathered from introductory material, so I'm only relying on first impressions. :)

Well keep it mind some introductory material is written rather poorly (in respect to who the target audience is). The authors of that book are exceptional programmers themselves but their line of work is focused on how to teach the subject and they do it well. Have you had time to check out the introductory chapters in that book? I promise it doesn't introduce a concept without having explained it (for example the main() method isn't explained for ages because it introduces concepts such as objects, arrays, visibility and static). They almost make it too easy :)

If you do have problems, like I said, feel free to ask me in there. I worked through the whole book as a first year undergraduate so can probably offer guidance.

Edit

It's worth noting that Java often requires a fair amount of syntax to express some things. I don't want to confuse you but the purpose of this is usually to prompt logical errors at compile time, not run-time. You shouldn't let this daunt you; once you understand the concept its child's play and good that it's in place.
 
Last edited:
Back
Top Bottom