Best language for n00bs

Please compose all posts in Emacs.

Moderators: phlip, Prelates, Moderators General

Best language for n00bs

Postby EvanED » Fri Apr 04, 2008 9:31 pm UTC

Okay, I did some searching and surprisingly didn't see any thread devoted to this topic. Considering that this has broken out in two threads in coding in as many days, I figure it probably deserves a thread here.

Where to start learning? Something very high-level like Python, Lisp, or Ruby; the standard educational choice of Java; the old workhorse C; or it's younger brother, C++? [List not meant to be exclusive]
EvanED
 
Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Best language for n00bs

Postby Berengal » Fri Apr 04, 2008 9:44 pm UTC

All of them. You should know at least three languages after six months.

As for the very first, I'd go for a dynamic interpreted language like python that lets you do the simple "Hi, what's your name?" stuff and various algorithms without getting too much in the way. Don't dwell on it too long, however, and switch to a statically typed language soon. Stick with it for a while. You don't want to become too spoiled, and the bondage and discipline inspires rigor. Do both "enterprise application" and "problem solving" type excercises. One teaches development and design, the other, uh ... problem solving.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby Micron » Fri Apr 04, 2008 10:21 pm UTC

It really depends on the noob and what they want to learn.

For a young child or even someone who really doesn't understand computers the right place to start might be Lego's visual programming blocks used with Mindstorms or something equivalent. A very simple tool that introduces simple ideas like loops and counters.

For someone who wants to know how a computer works the right tool might be to start with C or an assembly language so they learn what the processor and memory are actually doing.

For someone who wants to be able to manipulate a UI the right tool might be a high level language with easy GUI creation tools or an environment like Flash which allows them to get visual results quickly.

For someone looking for an introduction to computer science I'd suggest starting with a high level language which allows them to focus on algorithms and the basics of data structures. Have them switch languages as frequently as they can to get them away from one specific syntax and introduce, functional, procedural, and object oriented languages.

I would actually favor starting on a statically typed language because it allows you to inspect the types you are working with and what they contain. I think dynamic languages just add confusion at first because it is not clear to a new programmer why a statement works sometimes and not others if they are not aware that different types are being used. I'd also want someone to start with an editor that can show them when they make a mistake and not have to wait until run time to find an error if possible.
Micron
 
Posts: 319
Joined: Sat Feb 16, 2008 1:03 am UTC

Re: Best language for n00bs

Postby You, sir, name? » Fri Apr 04, 2008 10:22 pm UTC

C. Because it's only after you've suffered through mastering C you thoroughly appreciate a higher level language.
I now occasionally update my rarely-updated blog.

I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.
User avatar
You, sir, name?
 
Posts: 6539
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City

Re: Best language for n00bs

Postby EvanED » Fri Apr 04, 2008 11:03 pm UTC

You, sir, name? wrote:C. Because it's only after you've suffered through mastering C you thoroughly appreciate a higher level language.

So your idea of a good approach to learning to code is to make sure that you appreciate a high level language by making it deliberately difficult?
EvanED
 
Posts: 4133
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Best language for n00bs

Postby Berengal » Fri Apr 04, 2008 11:19 pm UTC

In case some newbie actually looks here for advice, I find it best to provide some help, and not just a language fight arena:

How to determine the best language for me, a non-programmer, to learn as a first language:
What better way to determine the first programming language than to do a programming language to do so for you? This is a step-by-step guide on how to do that.

Load up a python interpreter. In most Linux distributions it's already included, and you can just type "python" in the shell to start it. On windows, you'll have to download it yourself first. If you're too dumb to figure out where and how, you're too dumb to program.
Anyway, at the interactive prompt, write "from random import choice". Without going into too much detail (you haven't decided to specifically learn python yet), this means that you load the function "choice" from the module "random". A module is just a collection of similar functions that work on a specific problem domain (the "math" module, for example, contains many math functions, like square root, log or sin). The "random" module is just a module of random functions; things that didn't fit in any other modules. The "choice" function reads a list, and based on an internal database determines what exactly the choices are, and thusly what the question is. It then evaluates the choices, weighing them against each other, and returns the best choice. It might seem like magic, but really, it's full of holes. For example, when asked to choose between "Trance" and "Techno", it usually comes up with "Trance" (the answer might vary, depending on the music library on your computer) when clearly the answer should be "Death metal". When it comes to programming languages, however, it's pretty solid. After all, it's written by programmers, and if anybody has thorough knowledge about programming languages it's us. Therefore, depending on the list of languages you enter, it will determine what you're using this language for and figure out the best language for you to use in that specific case. The best first-language has been debated to death over the last forty years, so we're pretty sure about the answer at this point. You just need to provide a list of possible candidates. To do this, you just type "candidates = " into the prompt and NOT PRESS ENTER. You need to enter the candidates in as a comma-separated list first. Find a list of languages (this is a good source, wikipedia is too). Now enter every language in between two quote marks and separate them with a comma, like this <"language1", "language2"> (omit the <>). Now you have your list and it's safe to press enter, you just need to use the "choice" function. You do this by writing "choice(candidates)". The best language should be written to the screen. If nothing happens, not even a newline, this is choice's way of saying that you should probably find something else to do, like play table-tennis and go for long runs, as programming might not be for you. Don't worry, as you can always invest in Apple :) Now that you know the language you should start in, ignore it and find a python tutorial. You already know some of the basic syntax and have it installed.

TL;DR:
As mentioned in the wall of text, this is a good resource for beginning languages. Programs written in Malbolge are especially impressive, and is a unique experience to behold.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby TomBot » Sat Apr 05, 2008 1:12 am UTC

It really depends on why you are learning to program.

If you want to learn how computers work, you must start with C, then dabble in assembly, and move to C++ as you make larger projects. There are no substitutes for C here, because with C, especially with a passing knowledge of assembly, you can always see just what the computer is doing. C also provides a great platform for learning about object orientation, because the progression from C to C++ is so straightforward. The downside is that if all this understanding of what's actually going on doesn't interest you, you'll give up before learning much -- pointers are hard, let's go shopping!

If you don't care what's going on and just want to do something useful, you should learn Java or Python, or really any other high level language - choose whatever is best suited to the types of programs you want to write. You'll have no idea what the computer is doing, but you don't care. You'll also be introduced to OO in a sink-or-swim fashion, without really knowing why it's helpful, but again, your goal is to do something useful quickly, not to learn for the sake of learning.

If you're interested in the theory of computation, you need to learn some non-imperative languages. I personally like OCaml - clean syntax, and it actually performs okay. Type inference is really cool. You typically won't be doing practical things, and it's difficult to understand what's going on behind the scenes (hint -- lots and lots of singly-linked lists), but your programs will have a kind of elegance about them, and you might even understand lambda calculus.

Now, if you're in it for the long haul, you will ideally do all three. I put myself in category one, and while my first introduction was to QBASIC (an interpreted non-OO language), I moved on to C, where I actually started to understand how the computer worked. I've also done some things in higher level languages, and used OCaml at my university.
User avatar
TomBot
 
Posts: 228
Joined: Sun Jul 29, 2007 1:17 am UTC
Location: Illinois (UIUC)

Re: Best language for n00bs

Postby qbg » Sat Apr 05, 2008 4:32 am UTC

I think something lisp-like would be a good starting point--the machine would be abstracted away to a large degree so they can focus on programming. Later they can move to something lower-level to get a better feel as to what the computer is doing. Then they can move to Lisp :)
qbg
 
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Best language for n00bs

Postby headprogrammingczar » Sat Apr 05, 2008 12:50 pm UTC

I learned to program in BASIC on the TI-83 first. The programming syntax was the same as the mathematical syntax on the main screen. This, and the fact that it was an interpreted language, made it easy to write little formula-helpers and cements the concept of programming as statically typed math. For the first few days/weeks, keep the manual around, because the error catcher is very unhelpful. The combination of the weak error handling, clunky manual, and simple syntax, teaches you how to debug programs without it listing every mistake, as well as teaching you to get it right the first time. All variables are initialized by default, and variable identifiers are limited to single letters. Lists are 5 letters prefixed by a subscript L, so you can learn to make a program without having to fight the program. It also lets you initialize variables outside the program, introducing the concept of file IO, again without fighting the language/OS/other processes. The last benefit is that it is abominably slow, so newb programmers don't get too ambitious, or if they do, they can still see what is happening.
I personally learned to program like this, then learned how computers work before learning a computer language (Java in my case).
It effectively teaches you to program without teaching you a language, so when you do learn a language, you can start with some knowledge of programming, as well as having a few of your own programs for you to practice translating.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you
User avatar
headprogrammingczar
 
Posts: 3024
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Best language for n00bs

Postby Skateside » Sun Apr 06, 2008 10:20 am UTC

Micron wrote:It really depends on the noob and what they want to learn.

I second this.

My first ventures into programming were with BASIC and I got nowhere with it. It wasn't until I stated making websites for fun and played around with JavaScript that I honestly considered myself any good at programming. I absolutely loved being able to think up problems and solve them, and being able to see my results pretty quickly. Plus, the knowledge I got from JavaScript helped me considerably when we were taught Visual Basic at uni. I didn't bother studying for written VB test because I already knew JavaScript and I could work my way through the code :)

I think, more than the n00b or what they want to learn, it depends more on what they want to do. Learning C or Python would seem completely useless if they wanted to make websites. Equally, JavaScript or PHP would seem pointless if they wanted to build executable files
Skateside:
Spoiler:
Mercurius wrote: = internet forum hero
studyinserendipity wrote: - impressive!!
krynd wrote:: awesome
d3c31t wrote:... you are amazing
Daria wrote:Shall I attempt further heights of ego-enflation?
User avatar
Skateside
 
Posts: 267
Joined: Tue Oct 23, 2007 8:59 pm UTC
Location: I'm not here, I'm somewhere else, and I'm not coming back

Re: Best language for n00bs

Postby Polaris » Mon Apr 07, 2008 4:53 pm UTC

I have to agree with Berengal that if you want to be a programmer, you need to be insatiable in your thirst for languages (assuming a baseline for quality thereof; brainfuck would not count). However, the first language you learn is indeed crucial to how you learn other languages.
Allow me to put all languages in the following categories:
  • Procedural. Assembly, C, C++. (I don't count 1-method static void main's to be "procedural")
  • Object Oriented. Java, C++, C#
  • Functional. Lisp, SML, F#
  • Scripting. PHP, Ruby, Python

I strongly encourage everyone to know at least one language out of each category and as a minimum, two to three in the category of their preference.

Getting back to the topic at hand, I would choose a language that is flexible enough to be able to setup test apps and act as a base of knowledge for learning other languages. Most importantly, however, the language should engender strong fundamentals of computer science in the learner that a pervasive through every aspect of our trade.

Along these lines, I consider recursion to be an intermediate-level topic (unless the learner has strong fluency with recurrence relations or automata theory [but then you should know other languages anyway]) and so I would not suggest a functional language to start with.
Similarly, I do not find scripting languages to be quite as vigorous as I would like in the CS department. Python probably would be the best of the bunch, but I don't know it well enough to make a definitive suggestion.
Procedural languages are not a bad choice, but I find that starting with a language like C or C++ can be overwhelming to new coders (assembly is definitely not an option..) which would be counter-productive to learning other languages.
So, to me, this leaves us with OO languages. I would again exclude C++ due to its complexity and lack of safety. I personally gained much of my CS experience from Java and don't regret any of it. However, after learning C#, I have to admit that the C# paradigms, practices, and structures are much more consistent; rather than having to explain the difference of primitives and classes, everything inherits from System.Object. Type checking and intelligent compiler errors allow for a quicker learning curve and the Visual Studio IDE, is, in my opinion, the best IDE on the market. For students, the full software is free via MSDNAA and also the Express edition is free to everyone else. C# also lends itself to functional languages through its own recursion and .NET allows you to mix project types of different languages in the same assembly, which would allow you to call methods in F# as if they were written in C#.

Basic procedural languages and scripting languages should not go unnoticed either. I find that scripting languages tend to be more compatible with functional ideas because of their dynamic typing. I also strongly support "getting close to the metal" with C/C++ and assembly.

The most important thing is making sure you have a lot of tools in your belt to choose from because for every project there are several options, but only one right choice, and having experience in every option makes making that choice a hell of a lot easier.
Polaris
 
Posts: 0
Joined: Mon Apr 07, 2008 4:15 pm UTC

Re: Best language for n00bs

Postby quintopia » Mon Apr 07, 2008 5:11 pm UTC

You forgot to mention Smalltalk in the OO list, which I find odd, considering it is the most "pure" OO language, and was originally designed with the beginner in mind. That said, I probably wouldn't recommend it, as it has never been well-implemented, and it gives an extraordinarily skewed view of programming.
User avatar
quintopia
 
Posts: 2790
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Best language for n00bs

Postby Dark Shikari » Mon Apr 07, 2008 6:57 pm UTC

I learned C when I was in third grade. Its an easy language simply because it has so few syntax elements and libraries. Now, doing complex things in it can be more difficult--but the basic concepts can be summed up in a couple pages.

I'd say the best three newbie languages are C (NOT C++), Java, Python, and Scheme, depending on how you want to approach the problem of learning programming.
Dark Shikari
 
Posts: 113
Joined: Mon Jul 16, 2007 7:03 am UTC

Re: Best language for n00bs

Postby bridge » Mon Apr 07, 2008 8:47 pm UTC

You, sir, name? wrote:C. Because it's only after you've suffered through mastering C you thoroughly appreciate a higher level language.

C requires knowledge of the OS, unless you don't give a crap about efficiency.
He's trying to learn to program and probably don't care about what paging or spacial locality are...
Excuse my Super Mario accent
User avatar
bridge
 
Posts: 195
Joined: Sun Feb 03, 2008 2:24 pm UTC
Location: Zurich < x < Rome

Re: Best language for n00bs

Postby zenten » Mon Apr 07, 2008 10:37 pm UTC

I'm going to have to go with Python.

It was designed to be both easy to learn, and to teach good programing habits. It's interpreted, meaning you don't run into the sorts of confusing errors compiled languages can give. It also is used in many real world applications. For the average person wanting to get into programming it's the best first step, and it can produce very useful results if it also is the only language learned.

Now, if you're an electrical engineer for instance I'd recommend C (but only after you've learned an assembler), and there are other special cases that make other languages look better, but yeah, Python is the general answer.
zenten
 
Posts: 3797
Joined: Fri Jun 22, 2007 7:42 am UTC
Location: Ottawa, Canada

Re: Best language for n00bs

Postby SummerGlau » Mon Apr 07, 2008 10:57 pm UTC

Game Maker Language. It's the language for this program called Game Maker. It actually sets you up for coding really easily, it has everything you need, it's also more motivational cause you can create your own computer games. So it prepared me for C++ a lot.
-Summer Glau


P.S. Don't forget to check out the next season of The Sarah Connor Chronicles this fall on FOX!

P.P.S. I can kill you with my brain.
User avatar
SummerGlau
 
Posts: 11
Joined: Mon Apr 07, 2008 9:06 pm UTC

Re: Best language for n00bs

Postby Xanthir » Tue Apr 08, 2008 1:28 am UTC

I'm with one of Scheme, Python, or Ruby, leaning toward Python just due to the libraries that exist for it. Hell, it'll train you on non-language issues like respecting a coding style too.

After that, though, I recommend as many languages as possible. You'll want to know something low-level like C, because it's cool (if a bit messy) and useful for unix programming (plus math geeks like to pretend it's faster). You'll want something high-level like OCaml or Haskell or Lisp. You'll want to get *good* with at least one of these, because really wrapping your brain around a non-imperative language is excellent mental exercise. You'll want at least one of the web languages like PHP or Ruby because it's really useful and fun to do web apps! A few of the utility languages that go along with that (sql, html, css, etc) are really nice to have as well.

So, that's a lot, but you work through them gradually. I learned most of what I know about coding from the internets. I learned what *not* to do with coding from the internets too!
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4310
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Best language for n00bs

Postby evilbeanfiend » Tue Apr 08, 2008 11:36 am UTC

any of the modern scripting languages make a good starting place for a high level language, they offer the chance to see instant results and do something that a beginner can appreciate quickly (gui toolkits ftw!). you also want to look at a low level language (maybe not straight away but don't leave it too long) C is an obvious choice, but there are also a variety of assembly langauges that are much simpler and easier to learn and may be better if you are finding the high level language slow going.

implementation +environment is as, if not more important than language choice. e.g. if you want to learn C its worth making sure your compiler gives decent errors and warning. some very good, in terms of optimized executables, compilers skimp a bit on the diagnostics. also you will need some sort of ide and/or editor, its worth thinking about this as well as if its new to you you will need to learn that at the same time.
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Re: Best language for n00bs

Postby Hammer » Wed Apr 09, 2008 4:09 pm UTC

Smalltalk stuff moved hither.
"What's wrong with you mathematicians? Cake is never a problem."
User avatar
Hammer
Because all of you look like nails.
 
Posts: 5491
Joined: Thu May 03, 2007 7:32 pm UTC

Re: Best language for n00bs

Postby TheAmazingRando » Wed Apr 09, 2008 7:01 pm UTC

I don't think the efficiency and effectiveness of a beginner language really matters much, because if you're going anywhere then of course you're going to branch out to more complicated and useful languages. I think the main point of a beginner language should be that it's easy to code and understand and builds a passion for programming that can be taken towards a more confusing language, as well as introducing a lot of basic concepts. The point isn't to immediately pummel the new programmer with functionality and usefulness, because if they're going to be programming seriously they'll get to that in time.

To that end, I think C and Assembly (especially Assembly) would both be terrible places to start because the confusing aspects could turn off someone new to programming. Something like Python is friendly enough to tell the potential programmer "see, programming can be fun" which should be enough to motivate the new programmer towards learning more complicated things. But I don't think anything could turn off a potential programmer more than a complicated (even if incredibly powerful) language that makes learning programming a chore.
User avatar
TheAmazingRando
 
Posts: 2305
Joined: Thu Jan 03, 2008 9:58 am UTC
Location: San Diego, CA

Re: Best language for n00bs

Postby Berengal » Wed Apr 09, 2008 7:49 pm UTC

TheAmazingRando wrote:more complicated and useful languages.

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).
Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby zenten » Wed Apr 09, 2008 8:08 pm UTC

Berengal wrote:
TheAmazingRando wrote:more complicated and useful languages.

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).
Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.


Well, sort of. I wouldn't call Pascal more powerful than C++.

For that matter I wouldn't call C more powerful than C++.
zenten
 
Posts: 3797
Joined: Fri Jun 22, 2007 7:42 am UTC
Location: Ottawa, Canada

Re: Best language for n00bs

Postby niko7865 » Wed Apr 09, 2008 10:34 pm UTC

I can't stand python. I do not like the use of whitespace, I want to use brackets dammit!
21/m/athletic/white&nerdy/washington/straight/???
Image
User avatar
niko7865
 
Posts: 536
Joined: Sun Jan 21, 2007 11:47 am UTC
Location: All over washington state, USA

Re: Best language for n00bs

Postby Berengal » Thu Apr 10, 2008 11:51 am UTC

Code: Select all
>>> from __future__ import braces
SyntaxError: not a chance (<pyshell#0>, line 1)
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby ash.gti » Thu Apr 10, 2008 4:45 pm UTC

Starting with a multi-paradigm language IMO would be a good idea.

So, If they are really into it, they can try to implement the same thing in different ways to learn the advantages and disadvantages of each paradigm.

IMO learning a language like Java and/or C++ near the beginning of you programming life is a good idea because it shows you the different ways of doing things. Then you can move towards a language (or stay with those) that has more of the features you like.

I loved the Object Oriented aspects of C++ compared to say writing the same program from a imperative standpoint.

C++ was the second language I learned (after BASIC) and IMO the language that taught me the most about programming. Now a days I prefer languages like Ruby, Smalltalk or Pyhton to C++ but depending on what I am doing I'll use C++ still.
# drinks WAY to much espresso
User avatar
ash.gti
 
Posts: 404
Joined: Thu Feb 07, 2008 1:18 am UTC
Location: Probably a coffee shop.

Re: Best language for n00bs

Postby zenten » Thu Apr 10, 2008 5:16 pm UTC

ash.gti wrote:Starting with a multi-paradigm language IMO would be a good idea.

So, If they are really into it, they can try to implement the same thing in different ways to learn the advantages and disadvantages of each paradigm.

IMO learning a language like Java and/or C++ near the beginning of you programming life is a good idea because it shows you the different ways of doing things. Then you can move towards a language (or stay with those) that has more of the features you like.

I loved the Object Oriented aspects of C++ compared to say writing the same program from a imperative standpoint.

C++ was the second language I learned (after BASIC) and IMO the language that taught me the most about programming. Now a days I prefer languages like Ruby, Smalltalk or Pyhton to C++ but depending on what I am doing I'll use C++ still.


Given that you can use Python as if it were imperative or functional, it still wins :)
zenten
 
Posts: 3797
Joined: Fri Jun 22, 2007 7:42 am UTC
Location: Ottawa, Canada

Re: Best language for n00bs

Postby ash.gti » Thu Apr 10, 2008 6:02 pm UTC

zenten wrote:Given that you can use Python as if it were imperative or functional, it still wins :)


So is every language I listed except Smalltalk...

*edit*
Okay, to be fair, I also mentioned BASIC which in its true form doesn't but in more recent implementations does.
# drinks WAY to much espresso
User avatar
ash.gti
 
Posts: 404
Joined: Thu Feb 07, 2008 1:18 am UTC
Location: Probably a coffee shop.

Re: Best language for n00bs

Postby TheAmazingRando » Thu Apr 10, 2008 6:53 pm UTC

Berengal wrote:
TheAmazingRando wrote:more complicated and useful languages.

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).
Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.

I didn't mean that the two go hand-in-hand. I probably should have said "more complicated and/or useful languages." What I meant was that a beginner language doesn't necessarily need to be either of those things. The purpose should be ease of use above all else, so long as the language has concepts that can carry over into more advanced programming.

What I think is great about Python is that it is easy AND powerful, so it's useful as a beginner language and for more advanced programming. I didn't mean to imply otherwise.
User avatar
TheAmazingRando
 
Posts: 2305
Joined: Thu Jan 03, 2008 9:58 am UTC
Location: San Diego, CA

Re: Best language for n00bs

Postby Berengal » Thu Apr 10, 2008 7:26 pm UTC

In that case I misunderstood, as I hoped I did.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby zenten » Thu Apr 10, 2008 7:48 pm UTC

ash.gti wrote:
zenten wrote:Given that you can use Python as if it were imperative or functional, it still wins :)


So is every language I listed except Smalltalk...

*edit*
Okay, to be fair, I also mentioned BASIC which in its true form doesn't but in more recent implementations does.


I'm pretty sure that C++ and Java can't be written as a functional language. They don't have anything equivalent to lambda for one.
zenten
 
Posts: 3797
Joined: Fri Jun 22, 2007 7:42 am UTC
Location: Ottawa, Canada

Re: Best language for n00bs

Postby ash.gti » Thu Apr 10, 2008 8:08 pm UTC

zenten wrote:I'm pretty sure that C++ and Java can't be written as a functional language. They don't have anything equivalent to lambda for one.


A simple Lambda intupritaion for C++ would be Boost.lambda

Or you can use http://okmij.org/ftp/c++-digest/Functional-Cpp.html as a guide for adding in a lambda function (basically it uses macro's and preprocessing to generate the lambdas before the code is compiled, so its not a true lambda but it functions like a lambda)

Java... beats me, but I hear in the next 'big' release of java they are adding lambda's as a built in component. They are also adding in lambda's to C++ in the C++0x standardization but no compilers follow it currently that I am aware. see http://en.wikipedia.org/wiki/C%2B%2B0x# ... xpressions
# drinks WAY to much espresso
User avatar
ash.gti
 
Posts: 404
Joined: Thu Feb 07, 2008 1:18 am UTC
Location: Probably a coffee shop.

Re: Best language for n00bs

Postby Micron » Thu Apr 10, 2008 8:15 pm UTC

ash.gti wrote:Java... beats me, but I hear in the next 'big' release of java they are adding lambda's as a built in component. They are also adding in lambda's to C++ in the C++0x standardization but no compilers follow it currently that I am aware. see http://en.wikipedia.org/wiki/C%2B%2B0x# ... xpressions


There are a couple of proposals for ways to add lambda expressions (closures) to Java. Unfortunately none of them are very good. There's an interesting discussion here you want to look into it or start a new thread here so we don't derail this one.
Micron
 
Posts: 319
Joined: Sat Feb 16, 2008 1:03 am UTC

Re: Best language for n00bs

Postby Berengal » Thu Apr 10, 2008 8:45 pm UTC

One hackish way to do lambdas in Java is to use anonymous classes:
Code: Select all
class LambdaCaller{
  public static void callLambda(Lambda lambda, Object... args){
    lambda.call(args);
  }
}

abstract class Lambda{
  abstract public void call(Object... args);
}

class Main{
  public static void main(String[] args){
    LambdaCaller.callLambda(new Lambda{
                       public void call(Object... args){
                         System.out.println("Hello world! I'm a lambda!");
                         for(Object arg: args)
                           if (arg != null)
                             System.out.println(arg);
                       }
                     }, (Object) "I'm an arg!", (Object) "Me too!");
  }
}


Don't ever do this, though, or snipers will kill you and your family.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby evilbeanfiend » Fri Apr 11, 2008 11:10 am UTC

yes template programming in c++ is pretty pure functional programming (the syntax sucks ass though). i really wouldn't go for java or c++ as 'my1stlanguage' though, they are just to big and in the case of c++ UB issues cause no end of learning difficulties.

if i had to recommend a syllabus for all beginners i'd go for python and an assembly (a simple one rather than one which people actually use). but, of course, there is no need to have 'a one true way', if someone is interested in programming language theory i would recommend tcl over python and maybe an esoteric language
in ur beanz makin u eveel
User avatar
evilbeanfiend
 
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Re: Best language for n00bs

Postby photosinensis » Thu Apr 17, 2008 11:54 pm UTC

This is really a question of age and whether you've learned algebra or not. Here's my (somewhat Python-like) bit of code to determine where you should start:

Code: Select all
from math import algebra, calculus
from knowledge import *

def languageToStart():
    levelOfMath = knownStuff.math()
    if levelOfMath < algebra:
        return "BASIC, but not Visual Basic"
    elif algebra <= levelOfMath < calculus:
        return "Python"
    elif levelOfMath >= calculus:
        return "Some kind of Lisp"
    else:
        return "C" #you should never get here, though--C should really be a second language
While I clicked my fav'rite bookmark, suddenly there came a warning,
And my heart was filled with mournng, mourning for my dear amour.
"'Tis not possible!" I uttered, "Give me back my free hardcore!"
Quoth the server: 404.
photosinensis
 
Posts: 163
Joined: Wed Aug 22, 2007 6:17 am UTC

Re: Best language for n00bs

Postby poohat » Fri Apr 18, 2008 5:17 am UTC

I think Scheme/Lisp is the best choice purely because you get to use HTDP as your learning book (http://www.htdp.org/2003-09-26/ , read the preface for why its so good) but Python certainly isnt a bad choice either.

Things like C/C++/Java/C# arent good ideas imo, the former 2 because they are too low-level and ugly, the latter 2 because they are ultimately languages geared towards large-scale corporate development and hence come with a lot of machinery which gets in the way and annoys you when youre just wanting to write programs (eg having to use OO for everything whether its a good idea or not). Ideally you should understand all the code you write as you go along, and telling someone to write

print "hello world"

is infinitely more logical than telling them to write
Code: Select all
class HelloWorld { 
    public static void main(String args[]) {
      System.out.println("hello world");}}


ultimately though most languages are fine for beginners as long as they arent either a) too low-level, b) geared towards corporate use, or c) Perl. You wouldnt go wrong with Scheme/Lisp/Python/Ruby/OCaml, whatever.
poohat
 
Posts: 230
Joined: Mon Apr 07, 2008 6:21 am UTC

Re: Best language for n00bs

Postby btilly » Fri Apr 18, 2008 7:21 am UTC

Polaris wrote:Allow me to put all languages in the following categories:
  • Procedural. Assembly, C, C++. (I don't count 1-method static void main's to be "procedural")
  • Object Oriented. Java, C++, C#
  • Functional. Lisp, SML, F#
  • Scripting. PHP, Ruby, Python

Some day you will learn Prolog and you'll realize that your categorization breaks down. :-P

Anyways I don't think the scripting languages deserve to be in their own category. They are unusually expressive, sure, but they don't have any ideas that are not found in the other languages.
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.
btilly
 
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Re: Best language for n00bs

Postby Berengal » Fri Apr 18, 2008 7:33 am UTC

Besides, scripts can be written in any language. I've written scripts in java. Sure, it had to compile first, but really, how much of a hassle is that for a 20 line program?
And you can write programs in scripting languages as well. Just look at stuff like youtube and EVE online.

(I define script as any short, single purpose program, usually writeable in a couple of hours. Programs are longer, take longer to write, and consists of several files, not all of which need to be executable (libraries))

I thought the most-used categories were imperative, object-oriented, functional and logic programing. Object-oriented doesn't actually DO anything, so you still need to combine imperative/declarative structures to get something working.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Best language for n00bs

Postby Rysto » Fri Apr 18, 2008 6:53 pm UTC

btilly wrote:Some day you will learn Prolog and you'll realize that your categorization breaks down. :-P

Prolog either goes in the "Logic Programming" category or the "Turing Tarpit" category.
Rysto
 
Posts: 1443
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Best language for n00bs

Postby btilly » Fri Apr 18, 2008 9:03 pm UTC

Rysto wrote:
btilly wrote:Some day you will learn Prolog and you'll realize that your categorization breaks down. :-P

Prolog either goes in the "Logic Programming" category or the "Turing Tarpit" category.

Neither of which was listed in his categorization, :D
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.
btilly
 
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Next

Return to Religious Wars

Who is online

Users browsing this forum: No registered users and 3 guests