The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
Please vote in the Forum Structure Poll. Polling will close at 2PM EST on January 21, 2025.
So I'm looking to teach myself my first programming language. I really don't have much experience offhand with programing other than some basic classes on object oriented stuff. At the moment I'm looking at possibly trying Java or Python, but I am up for suggestions if there are other good starting languages out there.
Basically, what do you recommend as a language? And with your recommendation, where would you recommend finding useful documentation or how to guides?
MeepZero on
0
Posts
admanbunionize your workplaceSeattle, WARegistered Userregular
What sort of programming interests you most? There are lots of good options, so I'd pick a language that allows you to do something that really interests you, as there's only so many "hello world" type things you can make before you will want to apply the knowledge to something more practical.
In my first year comp science class we were taught Java, which is good if you want to learn about Object Oriented Programming at the same time, because it really forces you to think in OO terms. OO is a very big deal and you will need to eventually understand it. But learning a programming language and OO concepts at the same time might be more work than you really want.
In which case I would also suggest Python.
Whatever you learn, I'd suggest staying away from super-fancy IDE's to begin with, and work in raw text. Having an IDE offering you a list of possible operations, and letting you know about errors while you're typing is handy, for sure. But when you're learning it's kind of like looking in the back of the book for the answer - you're generally better off figuring stuff out the hard way, it'll stick with you better.
Python seems to be pretty decent. It seems like it's becoming this generation's Perl. If you like the Unix/Linux side of things, Java is a good thing to be learning. In my area it's the second most in demand development skill after .Net and is used by all of the big companies.
.Net is also pretty nice and in very high demand in a lot of areas. Of course, saying .Net is somewhat vague since .Net can be done in multiple languages. My preference is C#. I greatly prefer the c-like syntax over VB syntax.
Unfortunately, I can't be too helpful on the guides. I've been doing this stuff for years now, so I generally just hit up google and can find what I need, then promptly forget about it.
Python seems interesting enough, and Java seems to be the older workhorse that everyone uses for everything. So I'll try for both. The hard part is finding a book or something to start with. I have to take classes on Java for college yet, but I would love to get familiar with it beforehand. I hear Java isn't the friendliest language to learn early on.
As for the "what I want to do" with it... I'll be honest, I havn't thought that far ahead yet. I guess I'm kinda looking for something to get me going as a project kinda thing. Maybe find a way to automate something I do on my computer or whatever.
For hobby-like stuff, python is maybe a better place to start than Java. Right now I write Perl professionally and have some personal projects in Java to build up portfolio of Java stuff for future job applications. Ideally, that would be reversed and I'd write Java at work and have my personal stuff be in Perl (or in your case Python).
Interpreted languages like Python are excellent for automating stuff on your computer. That's probably right behind web app development for its uses.
One thing to keep in mind is learn the concepts. The actual language and syntax are secondary. If you understand the concept, you can pick up a new programming language and write useful stuff within days or even hours.
One things that I think makes Python friendly for beginnings is you don't have to end all your lines with ; as all your blocks of code and controlled by tabs. This has the added benefit of making the code very readable, which is essential when you're new.
I would definitely go with Python, and then if you wanted to dive in headfirst to web developement type stuff, then I would go to Ruby and Ruby on Rails once you had a firm understanding of Python. As for the "harder" languages, I would take a look at Java first, since it was developed to be easier than the other two I am about to name.
Even though people here may hate me, a lot of the powerhouse stuff in the real world takes place in some version of C, be it C++ or C#. C# is pretty much exactly like Java, but C++ and C are completely different languages.
I still think your best bet is to start with Python and then move onto Java from there though.
EDIT: I also agree with Jimmy King that once you learn a language, its pretty much easier from there on out for other languages.
I will be the devils advocate here and go recommend against Python because of its more nuanced syntax, and unconventional language features like indentation based scope (I believe that's a feature of Python right, it's been several months since I've used it).
If you learn a more rigid, strongly typed, verbose syntax language like Java or C#, the migration from those languages to something like Python will probably be easier, because it's more like a deductive transition. "Great, I don't need brackets anymore", rather than going from Python to C# which is more like "why the fuck do I need brackets, this is bullshit".
Plus it will teach you respect for type safety and all those other goodies that come along with those dreaded strict languages like C#.
Also because C# and Java are sort of the midpoint between say, C, and Python.
I'm not a PHD or anything but if I had to plot them out on a line in terms of complexity it would look something like.
Machine Langauge --- C/C++ --- C#/Java --- Python et al -- HTML/CSS
It makes a transition to something low level like C a little easier than had you started at Python.
I'm not saying Python isn't easy. It is, but that's not necessarily a good thing if you're trying to really understand code and how things work, which a good programmer needs to do.
*edit*, plus in C#.NET you can drop down to C++ at will so if you're feeling adventurous you can write a function in C++ on top of your C# application. I'm pretty sure Python won't let you do that.
Personally if I had to choose over again I'd still go with C#.NET as opposed to Java.
JVM's and Java frameworks are beastly. .NET is pretty much turn-key and lets you focus on the code instead of dealing with framework, runtime, and compiling silliness.
With that said, there is J#.NET - I'm just not sure how similar it is to pure Java.
Learn to program functionally first, then study a language to actually program in. Python is my language of choice because of it's flexibility and ease for a single person to write something useful. In reality learning a program language isn't very difficult nor important compared to learning programming paradigms.
EDIT: Oh and do learn C sometime in your programming future if you really want to pursue it as a hobby. Before you do, I suggest you pick up a book on computer organization/architecture. IMHO learning about how data is organized in the machine makes learning about C's memory management and pointers ten times easier.
I will be the devils advocate here and go recommend against Python because of its more nuanced syntax, and unconventional language features like indentation based scope (I believe that's a feature of Python right, it's been several months since I've used it).
If you learn a more rigid, strongly typed, verbose syntax language like Java or C#, the migration from those languages to something like Python will probably be easier, because it's more like a deductive transition. "Great, I don't need brackets anymore", rather than going from Python to C# which is more like "why the fuck do I need brackets, this is bullshit".
Plus it will teach you respect for type safety and all those other goodies that come along with those dreaded strict languages like C#.
Your post implies that Python would not teach you type safety, this is false. Python is a strongly typed language. Stronger than C++ actually, since C++ allows implicit type casts between chars and integers.
This is a difficult question these days because few languages have the characteristics you'd want in a "teaching language" and are actually relevant.
For example, a wonderful first language is Pascal. Pascal has many of the conventions of the Algol-descended programming languages (imperative programming, similar control structures - procedure calls, if-then-else, case statements, etc.), is explicitly typed, and doesn't force you to adopt object-oriented programming or pointer-arithmetic stuff right away (although those are available if you want them).
However, Pascal simply isn't relevant anymore, so it's sort of a non-starter.
I think the best languages for learning are those that are highly constrained: the compiler (or other tools) should provide you high-quality feedback about what's wrong with your program when you write it.
In this sense, I have to prefer strongly, statically-typed languages for learning. Pascal, C#, Java, and probably even Visual Basic fall into this category. Others may disagree with me, of course.
Although in practice most would say that Python has little in common with, for example, C or C++, I think one thing they have in common is that they are purposefully unconstrained in fundamental ways. The argument in favor of this is that experts can do very nifty things as a result. The counterargument is that the unconstrained features are rife for misuse and outright abuse.
For example, in Python it is perfectly legal to write a function that sometimes returns an integer, sometimes a string, and sometimes an object representing the current phase of the moon. The question is: is this a good idea? Well, there are some circumstances where yes, this might be a great idea. An expert programmer might decide this is the ideal solution to some very specific problem.
A real expert would extensively document this, of course, but nothing in the Python world will actually force you to do that.
Likewise, C and C++ will let you treat anything as a bag of contiguous bits in memory if you want. You can treat anything as anything else and manipulate it at the bit level if you want. The upside is that you can do some very neat tricks for efficiency and the like. The downside is you risk corrupting data in memory, running off the end of your buffers and killing the program, and so on.
For so many programming language features, you can't really appreciate and understand them unless you understand the alternative. It's difficult to really appreciate and understand garbage collection if you've never managed your own memory. It's difficult to understand the advantages of dynamic typing if you've never had to write substantial amounts of code in a statically-typed language (conversely, it's difficult to appreciate the value of all the extra verbosity and constraint in a statically-typed language until you've tried to read someone else's code in a dynamically-typed language).
Ultimately, just pick a language and learn it. Eventually, once you've got the hang of one, try looking at others to see what's different over there. See how there are new problems that you didn't have in your first language, and problems that you had in your first language that are now solved.
Good luck.
DrFrylock on
0
ASimPersonCold...... and hard.Registered Userregular
edited June 2009
Incidentally, my first language was BASIC/VB6 and my first formal instruction was in Pascal. That was 10 years ago, though, when Pascal was already on the way out.
I guess what I'm trying to say is that I agree with DrFrylock about basically everything (as usual). Though my particular predilections say that you should learn C at some point. Maybe not as a first language, but C makes you appreciate two things:
1) About as close as you can get to the hardware without writing assembly, which is helpful in learning how computers actually work
2) All the stuff in higher-level languages that keeps you from shooting yourself in the foot
As usual, DrFrylock and Jasconius make some good points.
Interpreted languages like Python can be seen as easier and are frequently quicker to develop in. That makes them great for hobby development from home where you've frequently got limited resources and time compared to work. They also have a lot of voodoo in them which can cause you to not really understand what it is you're doing and how it's actually working, which is bad.
I hear Java isn't the friendliest language to learn early on.
Not true! At least in my experience. The official Java tutorials are really good. The really big index gives an overview of all concepts that you can search in when you don't understand something. Then there's the Java standard library API documentation, important classes have links in their documentation to the tutorials that explain their use. In my experience it's miles better than microsoft's horrid C# documentation.
Sun has taken the kitchen sink approach to the Java standard library, for most essential OO data types there is an implementation to be found there.
Furthermore, you can make OpenGL games for browsers in Java using the LWJGL library. Minecraft is a fine example of what you can achieve with it, although the developer hasn't even begun optimizing the engine.
Posts
Free, and full of great stuff.
See how many books I've read so far in 2010
Dive Into Python is great, but it's really written for people who already know how to program.
http://poignantguide.net/ruby/
In which case I would also suggest Python.
Whatever you learn, I'd suggest staying away from super-fancy IDE's to begin with, and work in raw text. Having an IDE offering you a list of possible operations, and letting you know about errors while you're typing is handy, for sure. But when you're learning it's kind of like looking in the back of the book for the answer - you're generally better off figuring stuff out the hard way, it'll stick with you better.
.Net is also pretty nice and in very high demand in a lot of areas. Of course, saying .Net is somewhat vague since .Net can be done in multiple languages. My preference is C#. I greatly prefer the c-like syntax over VB syntax.
Unfortunately, I can't be too helpful on the guides. I've been doing this stuff for years now, so I generally just hit up google and can find what I need, then promptly forget about it.
Python seems interesting enough, and Java seems to be the older workhorse that everyone uses for everything. So I'll try for both. The hard part is finding a book or something to start with. I have to take classes on Java for college yet, but I would love to get familiar with it beforehand. I hear Java isn't the friendliest language to learn early on.
As for the "what I want to do" with it... I'll be honest, I havn't thought that far ahead yet. I guess I'm kinda looking for something to get me going as a project kinda thing. Maybe find a way to automate something I do on my computer or whatever.
Interpreted languages like Python are excellent for automating stuff on your computer. That's probably right behind web app development for its uses.
One thing to keep in mind is learn the concepts. The actual language and syntax are secondary. If you understand the concept, you can pick up a new programming language and write useful stuff within days or even hours.
See how many books I've read so far in 2010
Even though people here may hate me, a lot of the powerhouse stuff in the real world takes place in some version of C, be it C++ or C#. C# is pretty much exactly like Java, but C++ and C are completely different languages.
I still think your best bet is to start with Python and then move onto Java from there though.
EDIT: I also agree with Jimmy King that once you learn a language, its pretty much easier from there on out for other languages.
See how many books I've read so far in 2010
If you learn a more rigid, strongly typed, verbose syntax language like Java or C#, the migration from those languages to something like Python will probably be easier, because it's more like a deductive transition. "Great, I don't need brackets anymore", rather than going from Python to C# which is more like "why the fuck do I need brackets, this is bullshit".
Plus it will teach you respect for type safety and all those other goodies that come along with those dreaded strict languages like C#.
Also because C# and Java are sort of the midpoint between say, C, and Python.
I'm not a PHD or anything but if I had to plot them out on a line in terms of complexity it would look something like.
Machine Langauge --- C/C++ --- C#/Java --- Python et al -- HTML/CSS
It makes a transition to something low level like C a little easier than had you started at Python.
I'm not saying Python isn't easy. It is, but that's not necessarily a good thing if you're trying to really understand code and how things work, which a good programmer needs to do.
*edit*, plus in C#.NET you can drop down to C++ at will so if you're feeling adventurous you can write a function in C++ on top of your C# application. I'm pretty sure Python won't let you do that.
we also talk about other random shit and clown upon each other
But I figure if I can get good at it, there's a lot more job opportunity than what I currently do.
The harder the rain, honey, the sweeter the sun.
JVM's and Java frameworks are beastly. .NET is pretty much turn-key and lets you focus on the code instead of dealing with framework, runtime, and compiling silliness.
With that said, there is J#.NET - I'm just not sure how similar it is to pure Java.
we also talk about other random shit and clown upon each other
www.htdp.org
Learn to program functionally first, then study a language to actually program in. Python is my language of choice because of it's flexibility and ease for a single person to write something useful. In reality learning a program language isn't very difficult nor important compared to learning programming paradigms.
EDIT: Oh and do learn C sometime in your programming future if you really want to pursue it as a hobby. Before you do, I suggest you pick up a book on computer organization/architecture. IMHO learning about how data is organized in the machine makes learning about C's memory management and pointers ten times easier.
I still would say learn Ruby first though because the link i posted makes it so much fun.
Your post implies that Python would not teach you type safety, this is false. Python is a strongly typed language. Stronger than C++ actually, since C++ allows implicit type casts between chars and integers.
See how many books I've read so far in 2010
For example, a wonderful first language is Pascal. Pascal has many of the conventions of the Algol-descended programming languages (imperative programming, similar control structures - procedure calls, if-then-else, case statements, etc.), is explicitly typed, and doesn't force you to adopt object-oriented programming or pointer-arithmetic stuff right away (although those are available if you want them).
However, Pascal simply isn't relevant anymore, so it's sort of a non-starter.
I think the best languages for learning are those that are highly constrained: the compiler (or other tools) should provide you high-quality feedback about what's wrong with your program when you write it.
In this sense, I have to prefer strongly, statically-typed languages for learning. Pascal, C#, Java, and probably even Visual Basic fall into this category. Others may disagree with me, of course.
Although in practice most would say that Python has little in common with, for example, C or C++, I think one thing they have in common is that they are purposefully unconstrained in fundamental ways. The argument in favor of this is that experts can do very nifty things as a result. The counterargument is that the unconstrained features are rife for misuse and outright abuse.
For example, in Python it is perfectly legal to write a function that sometimes returns an integer, sometimes a string, and sometimes an object representing the current phase of the moon. The question is: is this a good idea? Well, there are some circumstances where yes, this might be a great idea. An expert programmer might decide this is the ideal solution to some very specific problem.
A real expert would extensively document this, of course, but nothing in the Python world will actually force you to do that.
Likewise, C and C++ will let you treat anything as a bag of contiguous bits in memory if you want. You can treat anything as anything else and manipulate it at the bit level if you want. The upside is that you can do some very neat tricks for efficiency and the like. The downside is you risk corrupting data in memory, running off the end of your buffers and killing the program, and so on.
For so many programming language features, you can't really appreciate and understand them unless you understand the alternative. It's difficult to really appreciate and understand garbage collection if you've never managed your own memory. It's difficult to understand the advantages of dynamic typing if you've never had to write substantial amounts of code in a statically-typed language (conversely, it's difficult to appreciate the value of all the extra verbosity and constraint in a statically-typed language until you've tried to read someone else's code in a dynamically-typed language).
Ultimately, just pick a language and learn it. Eventually, once you've got the hang of one, try looking at others to see what's different over there. See how there are new problems that you didn't have in your first language, and problems that you had in your first language that are now solved.
Good luck.
I guess what I'm trying to say is that I agree with DrFrylock about basically everything (as usual). Though my particular predilections say that you should learn C at some point. Maybe not as a first language, but C makes you appreciate two things:
1) About as close as you can get to the hardware without writing assembly, which is helpful in learning how computers actually work
2) All the stuff in higher-level languages that keeps you from shooting yourself in the foot
Interpreted languages like Python can be seen as easier and are frequently quicker to develop in. That makes them great for hobby development from home where you've frequently got limited resources and time compared to work. They also have a lot of voodoo in them which can cause you to not really understand what it is you're doing and how it's actually working, which is bad.
Not true! At least in my experience. The official Java tutorials are really good. The really big index gives an overview of all concepts that you can search in when you don't understand something. Then there's the Java standard library API documentation, important classes have links in their documentation to the tutorials that explain their use. In my experience it's miles better than microsoft's horrid C# documentation.
Sun has taken the kitchen sink approach to the Java standard library, for most essential OO data types there is an implementation to be found there.
Furthermore, you can make OpenGL games for browsers in Java using the LWJGL library. Minecraft is a fine example of what you can achieve with it, although the developer hasn't even begun optimizing the engine.