Page 1 of 1

What language would you recommend for a complete newbie?

Posted: Fri Aug 07, 2009 3:33 am UTC
by sleeply
Hi all,

I have no experience with programming at all, but I am interested in learning as a hobby and in my spare time. I was going to start learning C or C++, but then I was told that it would be better for me to learn Java. However, I don't think that I'll be going into a corporate programming job (which is what I hear C/C++ and Java are most used for), so I'm not sure if either of those two would work for me.

My question to you, fellow xkcd-ers, is what would you recommend for someone who has no prior experience and wants to learn programming just for fun? I see people recommending a lot of different languages, and I am quite confused :?

Re: What language would you recommend for a complete newbie?

Posted: Fri Aug 07, 2009 3:39 am UTC
by sje46
In b4 Python

Re: What language would you recommend for a complete newbie?

Posted: Fri Aug 07, 2009 3:45 am UTC
by ash.gti
viewtopic.php?f=40&t=20660 has a lot of discussion for this topic. Read that first, then ask a question if you still have any.

Re: What language would you recommend for a complete newbie?

Posted: Fri Aug 07, 2009 4:44 pm UTC
by baultista
sleeply wrote:Hi all,

I have no experience with programming at all, but I am interested in learning as a hobby and in my spare time. I was going to start learning C or C++, but then I was told that it would be better for me to learn Java. However, I don't think that I'll be going into a corporate programming job (which is what I hear C/C++ and Java are most used for), so I'm not sure if either of those two would work for me.

My question to you, fellow xkcd-ers, is what would you recommend for someone who has no prior experience and wants to learn programming just for fun? I see people recommending a lot of different languages, and I am quite confused :?

I learned VB first. Mistake #1.

I wouldn't start out with Java right away... learn how to code procedurally first, then with OO. You can sort of write procedural code in Java (use a single class and shove as much as possible in your main() function) but you'll develop some really bad habits.

I'd recommend Python, tbh. C++ is as good a starting point as any, too.

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 5:43 am UTC
by TheChewanater
Learn a C-based language first, like Java, C++, or C#. No, forget that last one. C# is evil.

I learned C++ first, and I'm still learning. I've never learned Java or Python, or anything but C++, as well as some Javascript and Actionscript.

Whatever you do, stay away fro any language that isn't C-Based until you have a good grasp on what you're doing. If you're a noob, it will give you too many bad habits, and make C/C++ seem to hard in comparison. That's the approach I took, and it's worked pretty well so far.

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 6:23 am UTC
by notallama
how will a non-c based language give you bad habits?

i'd suggest learning c before c++, but after a higher level language.
for a starting langage, i'd suggest scheme or ruby.

also, when you learn c, gdb will be your best friend.
(ddd or emacs provide a graphical interface for gdb)

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 6:44 am UTC
by TheChewanater
notallama wrote:how will a non-c based language give you bad habits?

i'd suggest learning c before c++, but after a higher level language.
for a starting langage, i'd suggest scheme or ruby.

also, when you learn c, gdb will be your best friend.
(ddd or emacs provide a graphical interface for gdb)


Not quite bad habits, but I started to learn basic, and it made c++ a little hard to grasp at first. Although I don't think I expected to get it right away, if I had continued with Basic, I'd want to learn c++ for its extended functionality, but it'd be harder to learn sometimes longer ways of doing things.

Hey, anyone tried GML as a first language? That's like C,C++, etc.

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 9:02 am UTC
by Mat
I'd suggest python or ruby, which are very beginner friendly, but unless you have a specific goal in mind for what you want to program, the language itself isn't that important. Just make sure you find a good resource to learn from. You might want to have a look at the "how do I learn about [n]" thread.

Whatever you do, stay away fro any language that isn't C-Based until you have a good grasp on what you're doing. If you're a noob, it will give you too many bad habits, and make C/C++ seem to hard in comparison. That's the approach I took, and it's worked pretty well so far.
This makes no sense. Also, I would avoid C++/Java/etc. because there's a lot to learn for a beginner. C itself would be better.

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 9:59 am UTC
by You, sir, name?
I do not think C is a good language to start with (don't even get me started on C++ and Java, they're even worse). What it boils down to is that you've got to learn to crawl before you learn to walk. Until you've got the fundamentals of code flow and types and all that down, being confronted with pointers and weak typing and all the stuff that makes C powerful will just make things needlessly difficult. C simply has too many gotchas to make a good first language.

In that sense, python is a good choice. Ruby will work too, or lua, or most other modern interpreted languages.

TheChewanater wrote:Not quite bad habits, but I started to learn basic, and it made c++ a little hard to grasp at first. Although I don't think I expected to get it right away, if I had continued with Basic, I'd want to learn c++ for its extended functionality, but it'd be harder to learn sometimes longer ways of doing things.


Basic is hardly representative for non-C based languages. It's well documented as mind-crippling. For in the words of Edsger Djikstra:

"It is practically impossible
to teach good programming
to students that have had
a prior exposure
to BASIC:

As potential programmers
they are mentally mutilated
beyond hope of regeneration
."

(Re-formatted in verse with questionable metric by me)

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 1:29 pm UTC
by sleeply
Thank you for all of your replies, they have been helpful :D

After further consideration, I decided to start with Python, then maybe try C or C++ after I get a firm grasp on the basics. I have a question though--one of my friends has some programming experience and recommends that I do Java after Python, instead of C or C++. I know that Java is more commonly used, but from what I've heard, it doesn't seem like it would be the language of my choice for my needs. What would you say would be a better transition into the world of programming after finishing Python?

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 3:06 pm UTC
by notallama
the troule with java is that if you put it on your resume, you might have to use it.
if you want to learn the java libraries, i'd suggest using them from another language,
like clojure, scala, or groovy.

c++ is good to know, but as a said, learn c first.
basically, c++ will seem fairly magical if you don't first wrap your head around pointers and the preprocessor.
it could easily lead to cargo cult programming if you jump right to c++.

Re: What language would you recommend for a complete newbie?

Posted: Sat Aug 08, 2009 3:13 pm UTC
by You, sir, name?
sleeply wrote:Thank you for all of your replies, they have been helpful :D

After further consideration, I decided to start with Python, then maybe try C or C++ after I get a firm grasp on the basics. I have a question though--one of my friends has some programming experience and recommends that I do Java after Python, instead of C or C++. I know that Java is more commonly used, but from what I've heard, it doesn't seem like it would be the language of my choice for my needs. What would you say would be a better transition into the world of programming after finishing Python?


It doesn't really matter where you go after python. After you've learned C++, learning Java is pretty straightforward, and vice versa. If you know people who are into Java, you may consider taking that avenue just for the convenience of having a go-to guy.

notallama wrote:the troule with java is that if you put it on your resume, you might have to use it.


Indeed. There should be a don't ask don't tell policy about Java.

Re: What language would you recommend for a complete newbie?

Posted: Sun Aug 09, 2009 5:56 am UTC
by the.coding.eye
TheChewanater wrote:C# is evil.


As someone who isn't super advanced in programming, although I have done a fair amount of website programming using ASP.NET and C# along with all the database stuff, why do you consider C# to be evil?

Re: What language would you recommend for a complete newbie?

Posted: Sun Aug 09, 2009 2:43 pm UTC
by Vault
Probably because it's from Microsoft. The issue I have with it is that if you write a program for .net you have almost no hope of it being cross platform (though if the Mono project accomplishes its goal, this won't be as big of an issue).

Re: What language would you recommend for a complete newbie?

Posted: Sun Aug 09, 2009 3:19 pm UTC
by ash.gti
Vault wrote:Probably because it's from Microsoft. The issue I have with it is that if you write a program for .net you have almost no hope of it being cross platform (though if the Mono project accomplishes its goal, this won't be as big of an issue).

I have run a few C#.NET compiled binaries on my Mac with absolutely no changes to the binary. All I had to do was install mono. Its not perfect (I got a few errors that caused it to crash, but those same features worked in Windows when I tried later) but its pretty darn good in its current implementation.

I don't know C# at all so /shrug no comment about it as a language, but Mono seems to be doing pretty well as far as I can tell.

Re: What language would you recommend for a complete newbie?

Posted: Sun Aug 09, 2009 3:46 pm UTC
by Vault
From what I know about C# as a language it seems to be nice to work with. It's a lot like Java, but with some extra features that I wish Java supported.

Re: What language would you recommend for a complete newbie?

Posted: Mon Aug 10, 2009 6:24 am UTC
by TheChewanater
Mono isn't completely reliable, espesially for networking (you might not need that at this point, though.). Also, C# will probably die out if Mono isn't finished, and you'd have to start learning a different language to keep up with all the latest libraries and resources.

Re: What language would you recommend for a complete newbie?

Posted: Tue Aug 11, 2009 9:34 pm UTC
by sleeply
Thanks for all of the replies :D

So I've gotten some Python basics with the help of some online tutorials, but I want to teach myself some more before I head off to other languages. I guess I'll probably go to C next, even though my friend believes that "it's only for nerds"--as if there's anything wrong with that! :x

Regarding Java, I think I'll do that after C++, though that'll probably be very far off into the future.

Thanks again!

Re: What language would you recommend for a complete newbie?

Posted: Tue Aug 11, 2009 9:50 pm UTC
by ash.gti
hehe you can always mix and match

Code: Select all

class MyTest

  def factorial(n)
    f = 1
    n.downto(2) { |x| f *= x }
    f
  end

  inline do |builder| # ruby inline lets you write C functions embedded into a ruby class
    builder.c "
    long factorial_c(int max) {
      int i=max, result=1;
      while (i >= 2) { result *= i--; }
      return result;
    }"
  end
end


There is a python way of doing this too, but I don't know it off the top of my head.

Re: What language would you recommend for a complete newbie?

Posted: Tue Aug 11, 2009 11:57 pm UTC
by Kurushimi
A good way to practice a programming language, whichever one you choose, is to do Project Euler problems, if you like math that is. Some of them are really difficult, but there are several that can be solved with just a little time and effort.

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 3:42 am UTC
by TheChewanater
I'm not quite the expert on this... but why would one want to learn C then C++? I've picked up a decent amount of C, and it seems kinda like you would be learning the old way, then the new way, and then you're supposed to forget the old ways.

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 4:16 am UTC
by Area Man
TheChewanater wrote:I'm not quite the expert on this... but why would one want to learn C then C++? I've picked up a decent amount of C, and it seems kinda like you would be learning the old way, then the new way, and then you're supposed to forget the old ways.

Yes, completely unnecessary. C is not a stepping stone to C++, that's foolish; it's not a sequel to a must-read.
What can a newbie do in C that he can't do in C++ (and do it better); conversely, what do you have to use of advanced C++ to learn the simple stuff?
You can get the same basics by starting with ++ and gradually throw in more stuff.
Wasn't there a thread about this?
edit: yep

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 4:42 am UTC
by notallama
if your goal is to pick up c++ and use it as a primary language, then learning c first isn't going to do a lot of good.
if your goal is to learn more about computers/languages, learning c first is a pretty good idea.

the basic idea is that c is easier to learn, and it teaches you low level stuff right away.
and if you're using gdb, then you'll really start to get how the computer works.

you can do it with c++ too, but c gets straight to the point.

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 1:15 pm UTC
by ex-kgb
Stay away from

1. VB
2. C++
3. VB

I personally went Python -> Mono C# -> Haskell -> Asm -> C -> Caml, which doesn't follow any real pattern, but in the end the best thing to do is work with a bunch of languages and find out what works for you. It's better to get started now with C++ than to wait forever deciding to go with Python. So whatever choice you make, be prepared to dive into it.

Also, learn as many languages as you want. If both C and Python interest you, learn both. It will make you a better programmer, I promise.

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 2:43 pm UTC
by Kurushimi
Except, I don't think it's a good idea to try and learn two languages at the same time when you're first starting to program. I'd think it could get more confusing than learning them in sequence.

Re: What language would you recommend for a complete newbie?

Posted: Wed Aug 12, 2009 4:49 pm UTC
by transient
I started out programming with C++ (see http://www.amazon.com/Beginning-Game-Programming-Development/dp/1592002056 for an excellent book). If you have a good book to follow, it probably doesn't really matter which language you start out with, because the book will gradually introduce you to more and more advanced concepts.

My opinion? Find a good book, and learn the language that book teaches. Its a lot easier picking up other languages once you know one (particularily true if you already know C / C++).