How To Go About Programming

First of all I would like to welcome and hail the programmers reading this. I have an enormous amount of respect for you and consider you the new architects of a wondrous and powerful new chapter in our history. The things you create are the foundation for the new frontier of a computerized world. That being said I have an interest in learning how to program and was wondering if anyone could point me in a direction to pursue.

A few questions:

  1. Do you have any understanding of programming? From your post, I assume the answer is “no”, but I thought I’d double-check.
  2. What does “programming” mean to you, at your current state of knowledge?
  3. Why do you want to learn programming? Is it so that you can program something? Or, is it more in the nature of doing simple programming so that you can better appreciate what programming is all about?

And, all hail to thee too!

I am a student programmer myself, one whom has always had a great deal of respect for other competent programmers who prove themselves through the excellence of their programs. Having said that I expect that I should have to earn your respect as a[student] programmer…

I would be happy to help you as much as I can, I enjoy teaching others what I know about programming, it helps me more fully understand what I have learnt, and I like it when someone goes “Eureka! Finally I understand” and goes on to do good work. I have not had much expereince at this so far of course, but i am told I am adequate at it.

Now, obviously you are going to want to start of with the basics, the concepts underlaying all of programming in this day and age. But which programming languages [if any] do you have a particular interest in? I would suggest learning C, then C++, as a bare minimum, but you would be best off learning Java, VB, and many others as well. Qt, which is based on C++, would be a good choice for cross-platform development.

I have started a seriestutorial files on C programming, part one should be done later today. it covers the basic concepts underpinning programming in many languages. You might want to read that, as I think it would be of some use to you, and others have commented that it is reasonably informative.

You could also try some of these links:

C Programming

C++ tutorial, but I suggest learning some C programming first

The book that I found very useful, when I was a programming newbie, was SAM’s Teach Yourself C in 21 Days. It starts with the basics, and builds on that foundation to give you a comprehensive understanding of C. Once you master C, I’d suggest getting Teach Yourself C++ in 21 days, followed by MFC Programming from the Ground Up which will teach you enough to be able to venture into Windows Programming.

In my opinion that’s the best way to go about things C, then C++, and finally MFC.

To throw in a different opinion: I really don’t think learning C is the best way to start off programming. C is a fairly low level language and you’ll have enough problems learning the syntax and logic of a program to have to worry about what’s going on with the hardware.

I recommend Python, it’s a gentle introduction to what programming is all about. You can find tutorials and all the information you’ll need here http://www.python.org/doc/Intros.html

C++ wouldn’t be too bad of a start. My first textbook was Structured & Object-Oriented Problem Solving Using C++. I found the writing very clear and the author describes each concept very thoroughly. You may be able to find it at http://www.cheapesttextbooks.com/ or one of the various other college text book sites. Another pro of the book is that it comes with Visual C++: all the programs to code and compile a program.

But even before that you may want to go out and buy the book Programming Logic and Design by Joyce Farrell. Learning a language (for the most part) should not be an incredibly difficult task although there are exceptions. It’s all about algorithms. The language comes second. If you really want to get inside the head of a programmer, read the aforementioned book and do some of the problems at the end of the chapter. You’ll find that while you never actually ‘code’ anything, your creating the logic that can be coded using any language.

To throw in a different opinion: I really don’t think learning C is the best way to start off programming. C is a fairly low level language and you’ll have enough problems learning the syntax and logic of a program to have to worry about what’s going on with the hardware.

…

C++ wouldn’t be too bad of a start. My first textbook was Structured & Object-Oriented Problem Solving Using C++. I found the writing very clear and the author describes each concept very thoroughly. You may be able to find it at http://www.cheapesttextbooks.com/ or one of the various other college text book sites. Another pro of the book is that it comes with Visual C++: all the programs to code and compile a program.

…

Well, we learnt C in the Programming Fundamentals course at Uni, and apparently this sort of thing is not uncommon..at least in New Zealand.

C++ would indeed be a decent start, it is possible to do well at C++ without knowing C, I reccommend the textbox, A First Book of C++: From Here To There, it teaches C++ in a clear way, while not skimping on the important fundementals. it does not cover alot of the Object-Orientated stuff which makes C++ really shine, but you can should be able to find good textbooks on that.

However, I still reccommend learning C, as it is still widely used, and makes learning C++ a little easier.

I really don’t think learning C is the best way to start off programming.

I’m a little perplexed by this statement, given that you say the following:

C++ wouldn’t be too bad of a start.

If you know C++, then you pretty much know C. C++ is more or less C with classes. Also, I don’t consider C to be a low-level language at all - but the whole issue is relative anyway. I’ve spent a great deal of time writing assembly code, so for me C is high-level. If you’ve done a lot of programming in Python, you’re more likely to consider C to be a low-level.

They do usually teach you C, in every introductory programming course.

They do usually teach you C, in every introductory programming course.

Well, usually they do indeed. But apparently at the university my mate goes to they teach Java in their Progrmming Fundamentals class… though im not sure this is a better choice than C.

These days, C is considered low level. It is often considered a glorified macro-assembler.

Pascal is probably a little better for beginners but since most languages take a C-look, C is probably the better way to go. I think if one starts with C then they will learn to be more careful in programming when it comes to memory allocation and pointers, and will also learn about the underlying machine. C doesn’t hold your hand or hide much so the learning process can be difficult but well worth it.

Somewhere along the way, one should also learn Lisp or Scheme, and investigate Forth.

  • Keith

These days, C is considered low level. It is often considered a glorified macro-assembler.

Pascal is probably a little better for beginners but since most languages take a C-look, C is probably the better way to go. I think if one starts with C then they will learn to be more careful in programming when it comes to memory allocation and pointers, and will also learn about the underlying machine. C doesn’t hold your hand or hide much so the learning process can be difficult but well worth it.

Somewhere along the way, one should also learn Lisp or Scheme, and investigate Forth.

  • Keith

The stuff you mention above about C are many of the reasons I have always thought C is a preffered langauge for entry-level programming, and were some the reasons my lecturer gave when I done the course.

I have looked a little into Lisp, like a few hours into it, and I like what I see so far. Apparently it is used a lot in Computer Science research, could you say in what fields of research?

Lisp, historically, has been linked with AI but it is great as a general purpose language.

Paul Graham’s website ( www.paulgraham.com ) has a lot on Lisp that makes for interesting reading.

  • Keith

A few questions:

  1. Do you have any understanding of programming? From your post, I assume the answer is “no”, but I thought I’d double-check.

  2. What does “programming” mean to you, at your current state of knowledge?

  3. Why do you want to learn programming? Is it so that you can program something? Or, is it more in the nature of doing simple programming so that you can better appreciate what programming is all about?

And, all hail to thee too!

  1. Nothing I can do anything with.

2.Its stringing together various commands.

  1. So I can get a better understanding of what is going on when I use a program. I feel dangerously ignorant about something that is becoming an all pervasive part of our lives.

Some years ago, I’d have said: get Visual Basic and learn that. However, today the editor and tools have so much functionality that I would not recommend that as the best place to start.

Your best bet would be to get a “Learn Programming” book (link to Amazon). This one says you’ll learn programming in 24 hours :smiley: I’m not familiar with this book, but despite the silly title, it seemed to have the most appropriate content and reviews (of the few that I looked at). Even if you don’t learn programming from this book, it seems it will give you enough so you can figure what you want to do next.

Some non-traditional approaches also occurred to me: you could start with something non-traditional, like HTML and JavaScript on your own web-site. Or, if you like robots, you could get a Lego MindStorms kit with the programmable “brick”. These would be quite different from traditional programming, but might be more fun. So, if these motivate you more, you might consider them. Otherwise, stick with the traditional.

I would not recommend C or C++ for a beginner. Java might be okay, if done right. “Sevik” suggested LISP. Not sure if he realized you’re a beginner or if he’s trying to pull your leg. I’ve programmed in LISP; my advice would be: don’t go anywhere near LISP, unless someone pays you well to do so. :stuck_out_tongue:

I would not recommend C or C++ for a beginner. Java might be okay, if done right. “Sevik” suggested LISP. Not sure if he realized you’re a beginner or if he’s trying to pull your leg. I’ve programmed in LISP; my advice would be: don’t go anywhere near LISP, unless someone pays you well to do so. :smiley:

Why would you not reccommend beginners learn C?

I would suggest learning C

No, no, no!

Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

If you want to start programming, begin with a simple yet powerful object oriented language like VB.Net, python, or ruby.

The easiest path to programming would be to use VB.Net and Visual Studio 2005. It allows you to create a complete web or windows based application without a single line of code.

I don’t recommend reading programming language books either. It’s not much easier than trying to learn a foreign language by reading a book. You should read a quickie tutorial, then jump right in, using a reference work and examples to get help when you need it. The programming books you do read should be on strategy and design, not syntax.

Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

C is hardly an “ancient legacy language”, it’s pretty much the standard when it comes to compilers for embedded applications (anything from digital cameras, DVD players, car computer systems). Not to mention developing algorithms with Matlab. It’s fast, and gives you total control over the hardware (the only way you’re going to do better is if you drop down to assembly).

I stand by my statement - if you want to learn Programming, starting with C is the best way. If you want to do as little coding as possible, and mess around with forms and templates instead, by all means stick with VB…

C’s fine for what it’s designed to do. I’ve coded in C for a few years, and there I like it. However, it is not designed for safety in the form of error-detection. For that reason, it is a programmer’s language, not a beginner’s language.

A really good language to learn procedural programming is Pascal; but, that means hunting for an old Turbo Pascal tool. Pascal’s focus on “safety”, with the sacrifice of power, might have been what killed it.

Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

So I guess I shouldn’t suggest learning 370 Assembly language, right?

C is hardly an “ancient legacy language”, it’s pretty much the standard when it comes to compilers for embedded applications (anything from digital cameras, DVD players, car computer systems). Not to mention developing algorithms with Matlab. It’s fast, and gives you total control over the hardware (the only way you’re going to do better is if you drop down to assembly).

Total control over the hardware means that the programmer has to know how to handle the hardware. This is really too much to ask a beginner to do, programming is hard enough. Learning with a low level he must learn the syntax but more importantly the logic of developing a program AND learn about the hardware at the same time. Higher level languages do a better job because of their singular focus, allowing the programmer to develop that algorithmic type of thinking which is so important while hiding the machinery.

It’s fast, and gives you total control over the hardware (the only way you’re going to do better is if you drop down to assembly).

I think that .Net gives me better control over hardware and can be faster than C. Some see C’s reliance on pointers as a benefit, but it usually just leads to inefficient memory management and leaky code. I don’t think blue screens are the “total control” over hardware that you want. Unless you are writing kernel or driver code (in which case, C++ is best) a managed framework is much more efficient. If you want to access hardware, you can do that with .Net too, but how many lines would it take you to do this with C:

Dim port As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort(PortName, BaudRate, IO.Ports.Parity.Even)

port.WriteLine(filetosend)

or

if My.Computer.Network.IsAvailable then My.Computer.Network.UploadFile(File, Address, User, Password)