As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Good beginner programming language

SceptreSceptre Registered User regular
edited June 2007 in Help / Advice Forum
So, I've been interested in programming for a couple of years, and as such have learned the basics of a couple of basic languages. (qBASIC and Visual Basic). However, now I find myself wanting to learn more about some of the more intermediate languages, and am somewhat frightened by how many there are to choose from. I'm really looking for just a good, general purpose program. Nothing too specialized.

Do you guys have any good reccomendations on which languages to start looking at, as well as some sites I can go to to help pick them up?

Sceptre on

Posts

  • Options
    CentipeedCentipeed Registered User regular
    edited June 2007
    It depends on your eventual goals.

    If you want to become a serious programmer at some point in the future, it might be best to dive in at the deep end, and learn something like C++ or Java.

    Delphi might be a good starting point, because there are free versions available and it was a relatively simple entry point for me.

    Whatever you choose, as long as you choose a language that teaches you the basic concepts for Object Orientated language (Structure, flow etc) then you'll be golden to learn any language in the future that you care to. It's those beginning concepts that most people have problems with, because after that it's just a case of applying those rules to a different language when you want to learn something new.

    Centipeed on
  • Options
    Jimmy KingJimmy King Registered User regular
    edited June 2007
    I suppose it depends on what you want to do, what platform you want to be working on, etc.

    On the *nix side of things I'm a big fan of Perl. It's easy to pick up, you can do a lot of things with fairly basic knowledge, and it's powerful and flexible enough to continue to be useful. That said, it's very smart in how it works behind the scenes and handles a lot of stuff for you, which may make it easy to develop some bad habit or write code that you don't fully understand how it works (make sure to use strict, that'll put an end to a lot of it). Keep in mind that many of the high level interpreted languages will be very smart and powerful and allow you learn bad habits, not just Perl.

    On the windows side, I like C# quite a bit. I've done some work with it and it has a lot of cool features, nice IDE to work in, etc. The .Net stuff may be easy for you to move into using VB .Net and from there go to C# if you like as they both have the same classes available to them. It's just a matter of syntax to switch between the two.

    C and C++ are always good options, too. Yes, they're lower level. Not a problem. They are also what many people learned with as one of their first languages. They'll probably help you keep better coding habits than a lot of higher level languages will because less is done for you, forcing you to learn what is really going on to make it work right.

    To an extent, though, it'll depend on what you want to do. Web apps? Services that run behind the scenese? Command line utilities? GUI apps? Stuff that runs purely locally or something that has some sort of network communication? All of these things? Once you know one language and the concepts of programming decently, picking up a new language isn't really the hard part, it's picking the right language for the job you are trying to accomplish.

    Jimmy King on
  • Options
    DaedalusDaedalus Registered User regular
    edited June 2007
    Learn C++.

    You can get away with C# or Java. I wouldn't recommend it, but some would.

    Stay as far away from anything with BASIC in the name as you can. Visual Basic causes brain damage and will teach you tons of habits that will keep you from programming anything properly in any real language.

    Oh, and if any jackass suggests assembly language, ignore them. Learn asm when you really feel you want to. That might be never, which is fine.

    edit: just read that you have "experience" with Visual Basic. Forget just about everything that you learned with that. Right now.

    Daedalus on
  • Options
    Iceman.USAFIceman.USAF Major East CoastRegistered User regular
    edited June 2007
    The intro CS course at my college is (was, 3 years ago, dunno about now) taught in scheme, which is a LISP variant.

    Take that as you will, its backwards generally but it gets you thinking about how to approach things.

    Iceman.USAF on
  • Options
    JaninJanin Registered User regular
    edited June 2007
    I advise Python. I feel that, especially in the beginning, it's much more important to learn how to program in general than how to use a specific language. By dispensing with all the boilerplate crap a C++ or Java program requires, the beginner's task is made easier. It's also a much more powerful language, and allows concepts such as functions passed as parameters to be learned much easier than the C/C++ version.

    You'll also benefit from the outstanding documentation. The Python tutorial covers the gamut from conditional statements (if, else, etc) to object orientation. Once you've learned Python, it's easy to apply the skills to other languages of your choice.

    Janin on
    [SIGPIC][/SIGPIC]
  • Options
    evilmrhenryevilmrhenry Registered User regular
    edited June 2007
    I'm also going to recommend Python. You'll likely want to learn C(++) at some point, but Python is quite good for learning "normal" programming practices. (Also, you will *always* indent correctly after learning python....)

    Anyway, start with banging your head against a wall until you forget everything about Visual Basic, then use the tutorial jmillikin linked.

    evilmrhenry on
  • Options
    LewishamLewisham Registered User regular
    edited June 2007
    You're all wrong ;)

    The answer is C. C is not muddled with object-orientation, it will teach you about data structures and data types, and all the necessary bits and bobs that operate underneath all these languages like Python and Java.

    It's the best base for procedural languages. Once you learn C, then you can move on and appreciate the extra power newer languages give you.

    Lewisham on
  • Options
    JaninJanin Registered User regular
    edited June 2007
    Lewisham wrote: »
    You're all wrong ;)

    The answer is C. C is not muddled with object-orientation, it will teach you about data structures and data types, and all the necessary bits and bobs that operate underneath all these languages like Python and Java.

    It's the best base for procedural languages. Once you learn C, then you can move on and appreciate the extra power newer languages give you.

    C is great for learning how innards work, but not so much for a beginner to programming. In particular, the concept of static typing is often so alien to people that they get very confused. Combined with C's lack of function overloading and "quirky" syntax, students often start to think "I don't know what this bit does, but I'll copy-paste it anyway just to be sure".

    Janin on
    [SIGPIC][/SIGPIC]
  • Options
    ASimPersonASimPerson Cold... and hard.Registered User regular
    edited June 2007
    My first programming course (1999, freshman year of high school) was in Pascal.

    I would stay away from C++. If you want object-orientedness in a C-like enviroment, hit up C# or Java instead. (Besides, learning one of the C-like languages makes it easy to learn the others - you just have to remember the quirks of that particular one.) As a former TA, I've taught both C and Java to freshmen/sophomores in college... I honestly think learning the ins-and-outs of how a computer works it worthwhile, and this is something that C can teach you. (That said, jmilikin's concerns are valid.)

    If you really want to change the way you think about programming, pick up Scheme as someone else suggested. I think people should learn at least one non-BASIC/non-C-like language at some point.

    I guess my ultimate point is that it matters little. Learning a language makes it easier to learn any other language, so it's hard to go wrong and people hardly agree on this. My alma mater used Scheme as a introductory language in the past, though they now use Python. Some schools use Java. Some even use C. Like I said, back in HS I was brought in on Pascal. So, yeah, just pick yourself one, get yourself a compiler, and go to town.

    ASimPerson on
  • Options
    aperlscriptaperlscript Registered User regular
    edited June 2007
    My vote would be for C as well, because:

    - it teaches memory management
    - you learn the difference between pointers, references, and values
    - compiler will bitch early and often
    - it's the root of so many other languages

    Those first 2 will be concepts that you take with you into every other language you might use later, and are concepts you just don't get as fully in a higher language. The 3rd point will initially piss you off, but it's far better than having a loose environment that allows for mistakes. Yes, there are ways around this in the higher languages, but there are strict rules in C that compilers enforce by default which catch mistakes very quickly.

    Once you've got a good background in C, you're free to branch out to any other (useful) language. My personal recommendation is Perl, because it's the duct tape of the Internet, and you can do everything from command-line scripty stuff to full-blown programming projects in it. Plus it's just fun to program in. Not to read once you've written it, to be sure....but writing it sure is fun. :D

    aperlscript on
  • Options
    devoirdevoir Registered User regular
    edited June 2007
    Plus it's just fun to program in. Not to read once you've written it, to be sure....but writing it sure is fun. :D

    Jesus. Quoted for truth.

    I wrote some basic scripts for the monitoring server when I first got my ISP job two years ago. Screwed if I can figure out what I meant to do now.

    devoir on
  • Options
    MrIamMeMrIamMe Registered User regular
    edited June 2007
    C is my recommendation.

    It is hard. It is grueling. It is not forgiving.

    Once you learn how to make C do what you want, you can do virtually anything with any language. I learned java to an intermediate level in 3 days (god java is forgiving, no memory leaks FTW).

    C also sits just above assembler, hell you can actually embed assembler in it, and the compiler will understand it. Assembler is a bitch, and you don't want to know her. Shes the tall blonde at the bar, in the red short dress. She looks damn fine, but shes big trouble - you will wake up one kidney short if you aren't careful.

    Memory management is so freaking important to learn early and hard. Pointers ditto. You can make C object-orientated easily enough.

    I have to suggest C# or Perl after that, depending if you want to be a internet/network engineer or a coding guru.

    I currently work with DSLAMS remotely doing VC rebuilds and tunnel resets, so its rare that I need to do much coding, more in terms of recoding and monitoring, so take the above with a grain of salt. When I work on the auth servers, thats all SQL-based.

    MrIamMe on
  • Options
    DrFrylockDrFrylock Registered User regular
    edited June 2007
    Becoming a well-rounded programmer means understanding a set of programming language concepts and constructs, not all of which exist in the same language. The problem is that if you look at the learning resources for, say, an OO language, you're going to get OO shoved down your throat from the get-go. If you pick Python, you're going to get dynamic programming shoved down your throat instead. Yes, it is POSSIBLE to learn Java without dealing with the OO stuff, but I bet you that Chapter 3 of any Java book is going to have OO stuff creeping in, just like Chapter 3 of a C book is going to have pointers, etc. I vote for starting with a simple language and then expanding your horizons.

    Ideally, you should be interested in learning (at some point, in rough order of ascending complexity):
    • Basic structured programming elements (loops, conditionals, functions, passing parameters, call by reference, call by value, and so on). Pascal
    • Pointers, pointer arithmetic, and manual memory managment. C, C++
    • Object-oriented programming. Java, C#, C++
    • Functional programming. Scheme, Lisp.
    • Multithreading and parallel programming. Java, C#
    • Dynamic typing. Python, Ruby
    • Reflection. Java, C#, Python, Ruby
    • Logic programming. Prolog.
    • On the metal. Assembly

    The languages listed after each concept are the popular ones that best embody that concept. Of course, you will need your basic structured programming constructs in any language, and you can write OO programs in C and Pascal if you're really careful, and you can write functional programs in Java too. But that's not what those languages are designed for.

    If you're looking for a bottom-up approach, you really want to start with Pascal.

    Pascal has all the constructs needed to do good structured programming, and not much else. You will understand conditionals, loops, functions, in-out arguments, and so on with Pascal. You can use pointers in Pascal but it's not as necessary as it is in C or C++. Plus, you can learn all this without having to understand object-oriented programming.

    You can learn pointers and memory management in either Pascal or C, although the pointer gymnastics you will see regularly in C code are far more involved than anything you'll see in Pascal code.

    You can learn OO stuff in Java or C#, which (for all intents and purposes) are the same language. Java and C# have a cleaner OO model than C++.

    Python is a fine language, but it's dynamically typed. I always think it's hard for a new programmer to understand why this is a good thing and the real power of the language until they can understand statically typed languages. The opposing viewpoint says that dynamically typed languages are more natural ways of thinking about the world and static typing poisons your brain.

    Perl is a mess and shouldn't be learned by anyone.

    DrFrylock on
  • Options
    mrcheesypantsmrcheesypants Registered User regular
    edited June 2007
    Read either SICP which is the book used to teach Into to programming at MIT or if it seems a little bit too hard to understand read HTDP

    Both books teach via scheme.

    mrcheesypants on
    Diamond Code: 2706 8089 2710
    Oh god. When I was younger, me and my friends wanted to burn the Harry Potter books.

    Then I moved to Georgia.
  • Options
    Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    edited June 2007
    There's an Accumualted Forum Knowledge thread called "Best Programming Language For Games?" >HERE<

    I stick with the advice I gave in that thread. Pick Python for now. Also pick a good tutorial, this is very important, programming language is subservient to good learning. I have not personally used but have heard good things of the "How to Think Like a Computer Scientist" tutorials. The thing you are wanting to learn is concepts not details. Programmnig is a about problem solving, by learning to program you are learning to craft solutions to problems. Python is an appropriate tool to learn about solving problems programmatically as it does many part of the tedious heavy lifting for you.

    I strongly disagree with using C as the language to learn how to program with. Let me be clear, C is a fine language, I have nothing against C. If I want to write a device drive, I will pull out the C compiler, just you try and stop me. If I want to teach someone to progam I will leave C well the fuck alone. No-one needs to learn about memory managment or raw pointer arithmetic to learn the fundamnetals of good programming, which as I've pointed out above, is learning how to solve problems. That stuff just gets in the way. No harm will befall a programmer if they use Python's lists before they learn about how linked lists are implemented at the machine level.

    To be a pragmatic programmer you should learn a new language every year, each language approaches problem solving from a different angle, the more differnt angles you learn the better you will become as an all round programer. Learn a funtional language like Haskell, learn C, familiarise yourself with Java. Each one is best suited to a differnt class of problem butlearning ech one will make you a better programmer overall.

    Alistair Hutton on
    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • Options
    mindlarmindlar Registered User regular
    edited June 2007
    If your eventual goal is to become a developer your best bet is to learn C/C++. The most important thing to learn from these languages is how to use pointers and memory management. While most programming languages that have come out in the last decade have hidden most of that from the developer, it is still a very useful thing to be able to understand. Do not give up on understanding pointers... it is one of the more difficult concepts to grasp as a budding programmer.

    If you don't see yourself looking to become a developer, it depends a lot more on what you want to do. With some feedback from you, we can give some better advice.

    mindlar on
  • Options
    HalberdBlueHalberdBlue Registered User regular
    edited June 2007
    I recommend Processing. Its very easy to get into because you can get visual feedback immediately, instead of the text prompts you'd most likely be programming for awhile with C or C++ for example.

    HalberdBlue on
  • Options
    AbelsAbels Registered User regular
    edited June 2007
    Scheme/LISP

    Abels on
  • Options
    SceptreSceptre Registered User regular
    edited June 2007
    You guys sure don't make it very easy for me to pick one, do you. I downloaded Python to try and see if I could pick some of it up, but I was very confused with the way it worked. Instead of it being a text document or such that I edited, it seemed to be dynamic, and I could not for the life of me figure out how to go to the next line to do something, without it already processing the first line.

    Sceptre on
  • Options
    DrFrylockDrFrylock Registered User regular
    edited June 2007
    Yes, python is interpreted and it also has an imperative mode, as you've noticed. The python program is an interpreter, by the way - not an editor. You edit in an editor and then run your program in the interpreter. Really, you're not going to learn much of anything about programming from downloading things, farting around, and reading halfassed Web tutorials (and they all are). Head over to Borders, find a book that you like on a language of your choice, and buy it. Read it up through about the third or fourth chapter without touching a computer. Things like basic compilation and execution should be covered in chapter 1.

    DrFrylock on
  • Options
    LewishamLewisham Registered User regular
    edited June 2007
    DrFrylock wrote: »
    Head over to Borders, find a book that you like on C and buy it. Read it up through about the third or fourth chapter without touching a computer.

    I will not be convinced otherwise on this issue! :mrgreen:

    Lewisham on
  • Options
    telcustelcus Registered User regular
    edited June 2007
    I'd argue that a Pascal is a better starting language then C, seeing as it was specifically designed as a teaching language. However, C is a lot more useful to know that Pascal.

    If you're looking to learn object orientation, Eiffel is a teaching language, so it's like Java except without the need to catch exceptions everywhere. However, once again, because it's a teaching language, its use outside of a learning environment is not that great.

    If you're interested in web programming, PHP is a good place to start, it's nice and easy, and the online documentation is really top shelf.

    I agree with getting a book on the language you wish to learn, maybe even seeing if there's a course on somewhere at your local adult learning institution.

    telcus on
    [SIGPIC][/SIGPIC]
  • Options
    DrFrylockDrFrylock Registered User regular
    edited June 2007
    Lewisham wrote: »
    DrFrylock wrote: »
    Head over to Borders, find a book that you like on C and buy it. Read it up through about the third or fourth chapter without touching a computer.

    I will not be convinced otherwise on this issue! :mrgreen:

    *sigh*

    Yes, a lot of people know C. Arguably, that makes it useful. Yes, understanding pointer arithmetic and such is also useful. Is it a good way to learn to program? No, I don't think so. I know C quite well, and I know many other languages well too. When I'm wirting code (and I don't think I'm unique in this regard), I develop a mental model of what the program is doing. And the mental model I develop when I'm coding in C looks VERY different than what it looks like in Java or Python. The mental model in C looks mostly like blocks of memory, broken up into words, broken up into bytes, with little colored sections holding data or pointers. When I'm coding in Java or Python, I have much higher level data structures, algorithms, and other things much closer to the problem I'm solving in my head. The C++ mental model is a strange mix of the two and that's why you should avoid C++.

    When I'm writing device drivers or somesuch, the C view of the world is very useful. When I'm solving tougher problems, the C view of the world is not.

    DrFrylock on
  • Options
    jothkijothki Registered User regular
    edited June 2007
    Abels wrote: »
    Scheme/LISP

    That's a fairly good way to learn how to program something that doesn't actually resemble a computer in any way, shape, or form. It's certainly useful for some applications, but it tells you nothing about how a real computer works.

    jothki on
  • Options
    JaninJanin Registered User regular
    edited June 2007
    Sceptre wrote: »
    You guys sure don't make it very easy for me to pick one, do you. I downloaded Python to try and see if I could pick some of it up, but I was very confused with the way it worked. Instead of it being a text document or such that I edited, it seemed to be dynamic, and I could not for the life of me figure out how to go to the next line to do something, without it already processing the first line.

    If you're going to try Python, use the Python tutorial. You can also use the integrated IDE, IDLE, if you want to code in a file-oriented way. If you'd like to use another editor such as Notepad, then save your programs to a .py file and run it from the console.
    jothki wrote: »
    Abels wrote: »
    Scheme/LISP

    That's a fairly good way to learn how to program something that doesn't actually resemble a computer in any way, shape, or form. It's certainly useful for some applications, but it tells you nothing about how a real computer works.

    On the contrary, I think Scheme or Common LISP is one of the best languages for learning. Rather than getting tangled up in memory management or pointer arithmetic, you can concentrate on the point of programming - writing mathematical equations to be executed by a computer. The only reason I don't recommend it for learning is because the community tends to be somewhat insular and xenophobic.

    EDIT: An essay on why Python makes an excellent first language. Some of the points:
    A language that requires significant notational overhead to solve even trivial problems forces the language rather than the techniques of problem-solving to become the object of study.

    To the extent possible, the language should also provide safety for experimentation. We should favor languages that guard against mysterious crashes from pointer or array-bounds errors. Students at this level are just learning techniques for tracking down and fixing errors; the language should help them learn, not frustrate them.

    In general, scripting languages are much simpler than system languages like C++ and Java (Laird & Soraiz, 1998b). Python has a simple, regular syntax. Statements are terminated by end of line, and block structure is indicated by indentation. Python programs look like executable pseudo-code. This eliminates a host of troublesome errors for beginning programmers, especially placement of semi-colons, bracketing and indentation.

    Janin on
    [SIGPIC][/SIGPIC]
  • Options
    DocDoc Registered User, ClubPA regular
    edited June 2007
    Python.

    Doc on
  • Options
    mindlarmindlar Registered User regular
    edited June 2007
    A lot of my coworkers that went to MIT were forced to learn Scheme/LISP as the programming language of choice. Now that they are in the real world (i.e. industry) have commented that it is used at MIT as a teaching language because no one else in the world uses it except for former MIT students. If you don't learn concepts while using scheme, you end up with no useful knowledge.

    Every single one of them was forced to learn a language that is used in industry (c/c++, java, perl, python) after graduating from college before they could start doing anything useful. Fortunately they are all relatively intelligent and like most computer scientists can pick up a new language relatively easily.

    Back to the OP's question, the languages that you are likely to get the most bang for your buck in learning are c/c++, java, perl, and python.

    C is very good for learning the basics of memory management and pointers. It has the lowest development velocity of any of the languages, but gives you the most control over what your program does.

    C++ as others have mentioned is the OO version of C. Not quite as clean, but more open to some more common modes of programming. With C you are given a lot of rope to hang yourself with, C++ gives you even more rope.

    Java is primarily about learning how to use libraries. For the most part if you are writing a common data structure yourself or implementing a common algorithm you are doing something wrong. In C it is fairly common to write your own hash; C++ sometimes you do, sometimes you don't depending on how much you trust the library; with Java people will think you are brain damaged.

    Perl and Python I have relatively little experience with. A lot of people swear by them because it is what they use on a regular basis. I personally find perl to be nearly incomprehensible to read regardless of how well written/commented the code is. Others in H&A can certainly talk about the benefits of each of these.

    mindlar on
Sign In or Register to comment.