How to start programming?

Status
Not open for further replies.

barich

Ars Legatus Legionis
11,030
Subscriptor++
I have no idea how to program anything. I am fairly proficient in other areas of computers, but programming has never been much of an interest of mine. . .until now.

I know there are many different programming languages, some harder than others to learn, and I could tell you what a variable is.

That's about it.

So, if I want to work my way up to programming in C++, preferably as quickly as possible, what would be the best way to start? Books? Classes? Should I start with something simpler like Visual Basic and move up to C++, or should I just dive straight into hell?

Would it be possible for me to be reasonably proficient in Visual Basic and/or C++ in a few months?
 

dpowers

Ars Scholae Palatinae
1,395
Subscriptor
If you're serious about it, there really is no substitute for going to school. Sure, you can go buy a couple of books on C++ programming and begin to learn the basics, but it's always easier when that is supplemented with a teacher, programming assignments, and tests of your knowledge.

Find a junior college, pick a few classes, and see if you like it.

And no, unless you're a genius that can devote your entire next few months to programming, then it is not possible to do anything really worthwhile in any language. There's a reason it takes students 2-6 years to complete their CS degree.
 

mebeSajid

Ars Praefectus
4,022
Subscriptor
Isn't it odd that something like this comes up every two weeks or so? People could do a search on old threads for opinions.

Also, since you asked for advice, I'd advise you to start out with Java. Java doesn't make you do explicit memory management, and for a beginner, that's a good thing. I started out with Visual Basic, and all I need to tell you with regard to that is:
If you can avoid it, DO NOT LET VISUAL BASIC BE YOUR FIRST PROGRAMMING LANGUAGE. It allows for a lot of bad habits. It took me a very long time to get rid of some of those habits, like optional parameters for functions.

Sajid
 

Nimdok

Ars Scholae Palatinae
1,214
Think of something you want to program and then come back and ask us what you need. Do you want to write a website? A game? A file sharing program? An addon for some existing application? A simple command line utility?

If you set out just "learning to program" you'll probably never go anywhere because you have no solid goal.

As for VB, it does teach you bad habits. But so do C/C++, Perl, PHP, and many other languages. They could still be useful depending on what he wants to do.
 

Venom

Wise, Aged Ars Veteran
193
The first language I started to learn, was C++. This was in grade 11. Prior to that, I only knew basic HTML tags. :)
If your school offers a programming class, whatever it is, take it. All the better if it is in C++ since that is your goal. During my first semester in university, I did Pascal, and now (2nd semester), I'm learning Java.

I agree with what the others have said, nothing substitutes a teacher, and tests + assignments. But whatever the case, I think you could dive into C++ right away. Even though it may be harder, you'll need to learn the hard parts of it either way - it's just likely that you will make more mistakes if you start with something complex, but who cares?
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
If you're serious about it, there really is no substitute for going to school. Sure, you can go buy a couple of books on C++ programming and begin to learn the basics, but it's always easier when that is supplemented with a teacher, programming assignments, and tests of your knowledge.
I disagree. In my experience there's a pretty pronounced gap between self-taught and school-taught programmers, with a big edge going to the former.
 

guilt

Ars Tribunus Militum
2,522
I disagree. In my experience there's a pretty pronounced gap between self-taught and school-taught programmers, with a big edge going to the former.

I disagree. In my experience most people don't have the gumption to figure out good style and correct practices in programming on there own. The only possible reason for the supposed 'edge' the former has is that the only people that can really become decent programmers from self-teaching either have a natural inclination or a lot of time on there hands.

There's a lot to 'programming' that you'll miss out on without a properly structured program. If you just want to hack out simple stuff and kludge together large stuff just start playing. If you really want to be able to approach large tasks correctly and write clean, efficient code as well as understand the underlying theory (why its actually good code) then there is no substitute for class.

Anyways, I would suggest python or c++ to start. c++ preferably, mainly because its not quite as easy as python (its far from difficult, though), among other reasons. After getting a little c++ under your belt /then/ play with python (you'll really appreciate it that way). After that it depends on what you want to do with your code. I wouldn't suggest Java simply because of its minor annoyances. Whatever you do, don't use an IDE, learn what code looks like, then use an IDE; same reasoning as before.

guilt
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
Very true guilt; once you're talking about "real world" programming, a measure of precision and discipline go a lot farther than raw intuition or "thinking like a coder" or what have you. I still think that both are ultimately necessary, however, and that the way 99% of the really smart coders I've run into learned those intangibles was just hacking at it by the seat of their pants - alone. Pointer arithmetic, for example, seems to be something people either just "get" or never do, almost as if it were an aptitude rather than a skill. I don't actually believe that's true (any more than the myths that run rampant in the music community surrounding absolute pitch), but it's certainly not something you can pick up working a problem set.
 

dockeen

Ars Tribunus Militum
1,600
Interesting point about pointers. In that light, it is interesting that one of the points "in favor" of "safer" languages such as Java and C# is the elimination of those types of operations.

Even using pointers for speed is somewhat lessened these days by smarter compilers. In many cases, using straight array notation
is just as fast as using pointer notation, and much more readable.

Maybe things are evolving in a direction of less creativity and more predicatability. We will see...

On the original topic, one key to being good at this is to really like to problem solve, and be really curious. If you don't have that, it doesn't matter what you program in.

Wayne

Learned my first language in class in high school, every language since with books and help of smart people for spot help.
 

Doomlord_uk

Ars Legatus Legionis
26,376
Subscriptor++
I'm just starting out on learning to program properly - I'm studying html. No flames please, I know it's not a language, but it's a good, and very useful start to telling a computer to do something vaguely useful. I've also started to use Dark BASIC which is pretty cool and good fun - but I've not got anything much working right yet.

In the past I tried qBasic (!) and also wading through a 'reference' manual on C. Not the way to go!

My aim is to move onto C/C++ on linux as well as windows and to write (one day) my own OS. I have a gazillion ideas for this but dunno if this is a realistic idea. Machine code is pretty cool to learn and gets you deep into microarchitecture, memory management and stuff like that - right up my street. It will be fun trying...

[Edit]

Didn't a lot of today's self-taught programmers learn on ZX-81s, Ataris and the like, back in the day when programs came in listings in mags and books? All of my friends (that program) started out this way. One guy taught himself 68k assembler when he was 11... don't know what he's doing today though - haven't seen him in 10 years. The internet is a pretty good place to learn from anyway - and it's free. You just have to find the right forums or sites.

I'd be a bit wary of programming classes - unless you get a talented teacher you could end up learning very little. I did programming at school and learnt jack all - the teacher never explained syntax, he just said, 'type this and watch'. great... In the UK Pascal was a popular 'educational' language - don't know why, but I knew no-one ever used it professionally.

[This message was edited by Doomlord_uk on March 11, 2002 at 10:42.]
 

dockeen

Ars Tribunus Militum
1,600
I started out learning programming in a high school math class on a terminal which was a selectric typewriter hooked by modem to a mainframe about 90 miles away...

So much of learning is so personal. Take the concept of this
line of code, in BASIC:

x = x + 1

Some people understand it, some people look at it as a
strange and wrong mathematical equation. This is the
sort of low-level nuts and bolts I learned about BASIC
back in High School, that somehow, I doubt I would have
gotten on my own with a book. But, once you have learned
a language, at least at the nuts and bolts level, the next
language is much easier. (Unless your next language is
something like APL)

It does help that there are resources like this where you
can ask questions about things like iteration or recursion,
the stuff that would make someone like me start using
profanity if I were on my own with a book.

I can only speak for me, I am not a total dummy, getting
a Ph.D. in physics did not kill all my brain cells, but
I would be leery about trying to learn from scratch on
my own.

I will not volunteer a language suggestion unless you
ask, I have very definite opinions, as do others, and
we have had this discussion in several threads in the
last month.

Wayne
 

guilt

Ars Tribunus Militum
2,522
however, and that the way 99% of the really smart coders I've run into learned those intangibles was just hacking at it by the seat of their pants

Interesting, I am indeed jealous of this type of folk, I think that for our fellows thiss probably going to have to be a decision they make for them selves. I wonder if the make 'Matrix knowledge discs' for programming/computer science, if so, that might be a viable option. :D

guilt
 
I started programming at a young age by hacking from the seat of my pants. To start programming in C++, get visual C++ or the like and start by making some commandline programs or the quick windows ones (where you don't bother with gui's) once you get the basics down of general programming structure, loops, function calls, stacks, pointers, objects, polymorphism, structs, operator overloading, etc.. then move into GUI's and the like.
JAVA is a nice starting language the GUI (swing not AWT) is nice and easy to learn. All of the bits of learning C++ mentioned above apply though.
learning to program in VB is a way to learn how to code crap.
C# is extremely new comparativly so there isn't as much online help with it.
 
And no, unless you're a genius that can devote your entire next few months to programming, then it is not possible to do anything really worthwhile in any language. There's a reason it takes students 2-6 years to complete their CS degree.
I'll have to disagree with that. For someone with an inclination towards programming, it's possible to pick up stuff rather quickly. The reason it takes several years to complete a CS degree is that:
a) Parts of it are useless (COBOL classes, to name just that).
b) It has to be universal (ie. start at the level of the students with the least knowledge, and move slightly below the speed of the average student)
c) It covers a lot of theory which isn't essential to get simple things done. That theory becomes useful for complex problem solving, which you may, or may not tackle in parallel with learning programming. Solving complex problems is more fun though.
 

jbode

Ars Legatus Legionis
11,752
Subscriptor
Originally posted by euzeka:

quote:
And no, unless you're a genius that can devote your entire next few months to programming, then it is not possible to do anything really worthwhile in any language. There's a reason it takes students 2-6 years to complete their CS degree.

I'll have to disagree with that. For someone with an inclination towards programming, it's possible to pick up stuff rather quickly. The reason it takes several years to complete a CS degree is that:
a) Parts of it are useless (COBOL classes, to name just that).
b) It has to be universal (ie. start at the level of the students with the least knowledge, and move slightly below the speed of the average student)
c) It covers a lot of theory which isn't essential to get simple things done. That theory becomes useful for complex problem solving, which you may, or may not tackle in parallel with learning programming. Solving complex problems is more fun though.

COBOL is still alive and well and in use, thank you very much.

A CS degree covers more than programming (indeed, programming is a small part of Computer Science, just like English grammar is a small part of English literature). If all you want to do is write code, you don't have to know much about the theoretical aspects of CS. However, it will take some time to learn proper techniques. Recursion, data structures, and algorithmic analysis aren't things that are easily picked up on your own. Some people can do it, but they are the exception.
 
COBOL is still alive and well and in use, thank you very much.

A CS degree covers more than programming
It's alive but dying. And since the CS degree is about more than programming, specific languages shouldn't matter... (so I say ditch COBOL, but keep the "business programming" idea, which would translate into VB or Java + DB backend). My point is that at least 95% of use will never use COBOL again, or even get near it.
 

dockeen

Ars Tribunus Militum
1,600
There is another application of programming that you
don't always hear about on here. It is what I will
refer to as technical programming. The sort of work
that I do, simulation, physical phenomenology, avionics..

And even though I do have a Ph.D. in physics, I am
not a domain expert at every physical problem. But
I do have some skills that are important. Good (not
great) coding skills. Very good ability to read what
code is trying to do. Good physical knowlege and
perspective on the way nature works. This spectrum
of skills helps me be pretty successful at what I do.

So, in addition to knowing languages, it is very useful
to have a pretty good grasp of mathematics and some
science. Certainly anyone who has tried to do 3D
graphics knows how useful math is.

So, one OLD mans advice. If you really want to be good
using the computer, don't forget the basis of a good
overall education, business, math, sciences. You can
make yourself a VERY dangerous person.

Wayne (its pronounced Age-ed)
 
Status
Not open for further replies.