|
|
Back to UserFriendly Strip Comments Index
|
Where to begin if you are new to programming? | by krisguy | 2003-06-06 00:05:58 |
| My two cents |
by Elessar |
2006-11-19 12:55:59 |
First off, a word of caution on "jumping right in". I'm not sure how you meant that, and so this may not be relevant to you, but just in case it is... Never jump into writing code before you know in pretty good detail what you're going to write. I had several friends at school (some still there) who would start writing their programs before they had completely figured out what they were going to write. As a result, the time and effort they put into writing, rewriting, rerewriting, and debugging was probably at least an order of magnitude more than was necessary.
Back in the day (before me, but hey, I've studied my history ;-) ) when everyone didn't have a console at their desk, and you couldn't change a line, recompile, and retest in a matter of minutes, CS taught things like flowcharting and other formal design processes that were all supposed to happen before you ever wrote any code, so that the coe you wrote worked (or darned close to it) the first time.
The first programming class I took had a somewhat old fashioned teacher and text book, so even though we were all working on PCs, she still stressed a lot of traditional design methodologies. As boring and tedious and seemingly pointless as it was, I think I owe a lot to that introduction. At this point, my personal belief is that learning good design practices and developing those thought processes is far more important than learning a specific language. Unfortunately, it seems to be getting less and less attention.
If you've never programmed before, I'd recommend starting out writing stuff from scratch. There are two sides to this; first, you need to be sure to learn all the different pieces, and it's easier to do that when you're writing them all, and not just modifying one of them. Second, as others have mentioned, picking up someone else's project and understanding it can be challenging even if you're quite familiar with the language it's written in. Trying to do so while learning the language will make it that much more difficult.
Start small. Especially when you're first getting going, little programs that don't do anything interesting, like Hello, world, are good. They let you play with the one little piece of the language you're learning, without having to pick up everything at once. You can start increasing the complexity of your programs as you learn more.
A lot of books which teach languages include practice exercises. I'd recommending doing each and every one. The advantage to book provided exercises is that they were designed to stress what they've been covering, without requiring anything that hasn't been covered yet. And after finishing an exercise, don't just go on to the next one. Play with it; try finding other ways to solve the problem, or come up with ideas of how to extend it. It doesn't matter if it's a pointless program with pointless extensions. When you're first learning, the critical part is getting comfortable with the design process and your language.
The next question is what language to start with. While learning the design process, you have to apply them in some sort of language. The good thing is that, if you learn good design habits and work to understand the underlying concepts, rather than just recipe programming, picking up new languages down the road isn't all that big a deal. Picking up new design methodologies can be, but then all languages of that style should be relatively easy.
I first learned to program in Pascal. It was designed as an instructional language, and is relatively friendly. It also makes for a pretty easy transition to C. (They're so similar, in fact, that gcc has never bothered with a Pascal compiler; there's a tool that will translate Pascal code to C). The downside is that it wasn't designed to be a real world language, and as such isn't the best language choice for anything other than learning to program.
C is a great language. It's a high level language, but only barely so. It's only one rung up the ladder from assembly. It handles the menial stuff for you, but you still have to do pretty much everything else on your own. Learning C early on is important because it makes sure you know what's really going on underneath everything. And knowing what's going on underneath is important becase abstractions leak. Don't worry if you don't understand all the references in that article right now. You'll get the gist of it even so, and you can go back and reread later to understand more.
I'd also agree with another poster above who said you should learn assembly at some point. On the other hand, if you learn C, you will have learned a lot of what's good to learn from assembly, and it'll also make learning assembly a lot easier.
Some people have suggesting starting with an interpreted language so you don't have to deal with compilers and makefiles and all when you're first getting started. I don't think this is a significant point. No matter what language you start with, you're going to have to learn your development environment as well. Compiling a simple C program is as easy as learning how to use the command line of your interpreter, and you can get into fancier options and makefiles and all that once you're more comfortable with the basics.
So, the bottom line: personally, I'd start with C doing simple exercises and work up from there. But other suggestions here are just as valid, and it's really a matter of personal taste. The important things are to learn good design practices and the right mindsets. They can be learned no matter how you start, but it's really important to learn them early on, even when they don't seem to be that big a deal. Because later on when they are a big deal it's really hard to learn them, and you'll be glad you did back when it was easy.
But now that I've been writing this post for better than half an hour, I'll shut up and hope you still get around to reading this ;-) And if you have any questions or would like any hits or tips or whatever, feel free to drop me a line via email or ICQ (contact info is in my diary). |
|
[ Reply ] |
|
this helps | by DennisMV | 2003-06-06 15:46:16 |
|
Agreed :-) | by Elessar | 2003-06-06 16:55:57 |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|