all 80 comments

[–]psi- 46 points47 points  (3 children)

No. Afterwards 99.999% of other languages (and associated "batteries") you'll happen unto will feel like utter crap.

[–]agscala 11 points12 points  (0 children)

Precisely what happened to me.


So what you're saying is that it's a good ultimate language?

[–]psi- 0 points1 point  (0 children)

Yes. But it spoils you.

And on the other tentacle one still very much need to be aware of the whole von Neumann machineness of hardware&software. Which means that you should dabble a little in some assemblerlike too (ie. explicit loops with conditional jumps, variable shuffling in registers, direct memory access..).

[–]miGlanz 24 points25 points  (0 children)


[–]oniram 5 points6 points  (10 children)

I'd say it is. I recommend you give it a try. And if you are into trying mood, give ruby a spin with this: http://tryruby.hobix.com/

NOTE: seems to be down at the moment. d'oh!

[–][deleted]  (9 children)


    [–]commonslip -1 points0 points  (8 children)

    I think new programmers should stay away from dirty, ad-hoc languages like Ruby and PHP. They have lots of gotchas and that, in my experience, frustrates new programmers. Ruby is a bit better than PHP is this regard, since it at least has blocks/first class function things.

    The only downside to python is that the way it handles scope is a little confusing.

    [–]chollida1 0 points1 point  (2 children)

    In what way would you consider Ruby to be an "ad-hoc" language"?

    Most people I know would consider Ruby to be a more powerful language than Python, though I'll offer than that is debatable.

    [–]commonslip 7 points8 points  (1 child)

    Power is not really closely related to ad-hocness. What I mean is that Python is the more "designed" language, in the sense that it is aesthetically relatively uniform.

    Arc would be ad-hoc, but Scheme is not. This does not mean that Arc is less powerful than Scheme or less productive (it might mean the very opposite), but it does mean that Scheme is carefully designed while Arc is, sort of, designed by use.

    A similar, but less extreme, dichotomy appears to exist between Ruby and Python.

    [–]chollida1 0 points1 point  (0 children)

    fair enough:)

    [–]mage2k 0 points1 point  (4 children)

    In what way do you consider Python's scope handling confusing? I've always considered, although I've heard it's being fixed in the next release, that having to learn the cases where block variables clobber local variable in Ruby quite confusing. You don't get that in Python, for sure.

    [–]commonslip 3 points4 points  (3 children)

    The short, sort of obnoxious, answer is that its not functional, lexical scoping as implemented in Scheme.

    The longer answer is that this does not work in Python

    In [2]: def make_c(x):
       ...:     def c():
       ...:         x = x + 1;
       ...:         return x
       ...:     return c
    In [3]: c = make_c(10)
    In [4]: c()
    <type 'exceptions.UnboundLocalError'>     Traceback (most recent call last)
    /home/toups/<ipython console> in <module>()
    /home/toups/<ipython console> in c()
    <type 'exceptions.UnboundLocalError'>: local variable 'x' referenced before assignment

    Whereas in Scheme:

    (define (make-c x)
            (lambda () 
                    (set! x (+ x 1))
    (define c (make-c 10))
    -> 11
    -> 12

    This may not seem like that big of a deal, buts once you get used to it, its hard to live without.

    [–]jbellis 0 points1 point  (2 children)

    the nonlocal keyword will allow this in python 3.0 (not sure about 2.6)

    [–]commonslip 0 points1 point  (1 child)

    I really prefer that this not need a keyword at all. I know lexical scope takes a second to get used to the first time you see it but it really is "the right behavior" and I don't see why Python just doesn't support it.

    Maybe backwards compatibility?

    [–]jbellis 1 point2 points  (0 children)

    python is lexically scoped; you just can't re-bind variables from a different scope without the keyword. in the first lexically scoped versions of Python (2.0-2.1?) you could, but guido had it taken out because he felt that the potential confusion outweighed the benefits.

    in current python versions you either have to use a global or a container object as a workaround. which is gross and I wish guido hadn't done that, but on the whole python is still better than the alternatives. :)


    Python is an excellent first language, and, unless you're a language junkie, it may be your only language. Scheme is another good first language. Of course, my first was BASIC (followed soon after by FORTRAN) so any language without required line numbers or 80-column punch cards is great for me. And the significant whitespace is a red herring, it's superior to {} blocks.


    Today's xkcd has something of tangential relevance.

    And yeah, I think Python is a great first language - it's easy to learn and you can get fairly non-trivial stuff done. It also has a fairly mainstream syntax and it looks as if the industry will adopt it pretty soon (or perhaps it will adopt a similar imperative, OO and dynamic language.)

    However, if you are really serious about CS, I would recommend Scheme (SICP).

    [–][deleted]  (11 children)



      I would become proficient in python itself first—not much, mind you, but enough to parse some text and enough for you to get to know object oriented aspects of python.


      If you can get by without needing to learn PHP, I'd recommend either Python or Ruby. Both are pleasurable and powerful. For portability, and a slightly more universal edge, a pragmatic recommendation would be learn PHP as your first language.

      And although it isn't a server-side language, knowing JavaScript well, or at least how to get around the jQuery/Prototype or other popular JavaScript libraries, is highly recommended.

      [–]Kaizyn 4 points5 points  (0 children)

      If you can hack HTML and CSS, then I would recommend you teach yourself JavaScript first. Since you're going to have to pick it up eventually anyway as it is the only choice for client side scripting, you might as well add this to your HTML+CSS knowledge. It will give you a good introduction to functional and object-oriented programming concepts as well. After you're fairly comfortable with the front end coding, then you can start to look at your choices for back-end technology. This will also give you more time to evaluate your back end options before having to decide.

      [–]ubuntuguy 0 points1 point  (7 children)

      i honestly would recommend PHP. the learning curve is very very shallow. once you get the hang of that, then move onto something more complex like Python or Ruby.


      I respectfully disagree. Python's interactive interpreter makes Hello World as simple as

      print Hello World 

      [–]foonly 0 points1 point  (0 children)

      print Hello World

      print "Hello World"

      Fixed :)


      >>> print Hello World
      SyntaxError: invalid syntax


      echo "Hello World";

      [–]tvshopceo 1 point2 points  (0 children)

      Thus proving his point. Python isn't that complex.

      [–]knowknowledge -2 points-1 points  (0 children)

      Actually it would be even simpler:

      Hello World

      If you really want to use echo it would have to be:

      <?php echo "Hello World"; ?>

      As much as I enjoy python, I would say that PHP is a better first language than python because it uses common syntax as C/C++/C#/Java etc so its easier to transition later. Sure its got its differences (like the $ token before variable names), but that's far easier to forget than the colon and tab-indenting differences of Python.


      That depends on what your objectives are. If you want to start implementing useful stuff as quickly and with as little pain as possible, then python is as good a choice as any. If you want to understand how computers work, learn C and an assembly language.

      [–]commonslip 7 points8 points  (0 children)

      I have sense moved onto greener (conceptual) pastures but I have to say Python is basically the BEST first language I can think of. It may not let you do the coolest Judo but its lets you do most of it and, best of all, when you need a library it will be there, basically hands down.

      If you don't need to do anything immediately, learning Scheme is a good idea. PLT Scheme is pretty Pythony in the sense that its got a fairly good set of libraries and it feels modern and usable. But Python is just better if you want to get right down to programming.

      [–]samg 10 points11 points  (4 children)

      Any language is a good first language. A first language is good. The second one is better, though, so get started!

      [–]surajbarkale 3 points4 points  (0 children)

      Except brainfuck?

      [–]koko775 3 points4 points  (0 children)

      I learned on Visual Basic when I was a kid. It took me three years to understand what curly braces were for in Javascript, I shit you not (I was utterly confused by the lack of 'endif'). Then again, this was a decade and a half ago, and there were precious few resources for a kindergartener to look except viewing the source of whatever javascript he could find before getting kicked off the dial-up.

      I suppose I'm just reinforcing what njharman commmented, but my point is that NO, some languages are particularly bad first languages.

      [–]njharman 0 points1 point  (1 child)

      "Any language is a good first language."

      It is true that having a first language is better than not having a first language so get started now.

      But, it very false that any language is a good first language. Some languages aren't good no matter when they're learnt.

      [–]samg 2 points3 points  (0 children)

      I disagree, assuming one doesn't have to get anything done with the language except learn it.

      Edit: of course, picking a language you like early on will save you time, but you'll also know fewer languages.

      [–]tootie 2 points3 points  (0 children)

      It totally depends on what your goals are. This thread on what language to teach your children might be informative. The highest rated comment actually said Logo beats Python for beginners.

      [–]moonwatcher222 6 points7 points  (3 children)

      Is python a good first language?

      Yes to Python.

      I don't know much about Django, so I won't express an opinion about it.

      [–]stp2007 3 points4 points  (2 children)

      Yes to both Python and Django.


      Emphatically, although I would start with just pure python unless you have a web background.

      [–]stp2007 1 point2 points  (0 children)


      [–]mhrnjad 1 point2 points  (1 child)

      Yes, start right here: http://www.diveintopython.org/

      [–]mletonsa 4 points5 points  (0 children)

      First thing they say: "Dive Into Python is a Python book for experienced programmers." Certainly good for someone looking for the first language. :P


      [–][deleted]  (1 child)


        [–]ibgeek 1 point2 points  (0 children)

        Updated version by Downey: http://www.greenteapress.com/thinkpython/

        [–]jamesbritt 2 points3 points  (6 children)

        Yes, among others.

        Scheme and Ruby come to mind as well.

        [–]Slipgrid -4 points-3 points  (5 children)

        Why recommend Scheme when it's not an imperative language? BASIC would be a good first language. Then C++. If you learn Scheme or Ruby, you won't be able to apply what you learn to other languages.

        [–]noisesmith 4 points5 points  (4 children)

        Scheme is multi-paradigm. Most of the scheme code I have seen is heavily imperative. And, thinking with the criteria you acquire from functional, or declarative, procedural, or object oriented languages, improves your code, even in a language that does not support those models natively.

        What can you apply in other languages, from C++ or basic, that is not present in scheme?

        The importance of learning a higher level language like scheme is exactly the fact that it has concepts that are not directly implemented in other languages, the value in learning a programming language is not in the rote memorization of a new syntax, but the models that language can help you apply.

        [–]Slipgrid 1 point2 points  (3 children)

        I know it's popular here, but I just don't get the functional programming. I know it's good for a few things. I build some amazing things in imperative and object oriented languages, but I have trouble doing easy things in Scheme. The only Scheme of Lisp I've ever seen is functional. I just don't see why it would be recommended to a beginner when all the code that he will ever see is going to be written in an imperative language. If there's imperative Scheme, I've never seen it, and I don't care to and don't look for it. It just seems like an odd thing to recommend.

        [–]noisesmith 2 points3 points  (1 child)

        Sorry, my hand slipped and I clicked report instead of reply at first.

        Objects are just a specialized kind of closure, a function call is a specialized call/cc (which in turn is built on top of assembly jmp statements, of course). What you need to understand to use scheme is a proper superset of imperative programming.

        A language without imperative features would be very hard to use (no variables, no input or output, actually the only way to know what the program did would be to disassemble or debug it from outside the program).

        Understanding a mixed paradigm language like scheme does not impede understanding a purely imperative language like assembler, and will actually help you learn coding habits that transfer quite well.

        [–]Slipgrid 1 point2 points  (0 children)

        Yeah, that's sort of what I though. I've done some basic problems in it, like display the first n fib numbers, and it is really good at that. Never realized it had variables, or spent much time with it. Thought it was just for quick math problems. I'll have to look into it more, and see if I can find a use for it.

        When I first used it, I had to download a virtual machine for Windows that it would run in. I wonder if it's installed on my server, or if lisp is. Could be useful.

        Still, it struck me as being completely different from everything else I've used. It's still neat. I thought of it like a logic problem I knew I should be able to figure out, but that really frustrated me.

        [–]joesb 0 points1 point  (0 children)

        I'm just guessing, but may be because you have been taught in imperative style first, that's why you have a hard time getting functional style.

        But if we teach someone who didn't have background yet, they probably could understand any paradigm given to them, they don't have any assumption settled yet.

        I'm not saying one paradigm is better than another here, though.

        [–]Kaizyn 1 point2 points  (0 children)

        As a first language, Python is better than some because it encourages good coding practices. Some of the traps you can easily fall into with other languages are avoided because much easier ways to do them exists in the language. However, this 'correctness' comes at the cost of the language being a bit less forgiving than others and being a bit harder to learn.

        [–]quhaha 0 points1 point  (0 children)

        depending on the version. 2.5 is ok.



        [–]Chun 0 points1 point  (0 children)


        [–]goalieca 0 points1 point  (0 children)


        [–]qwe1234 -1 points0 points  (3 children)

        python 1.5 was.

        since then they added a bunch of very neat time-saving features to enable people to finally write in what looks to be an obfuscated crossbreed of haskell and perl.

        [–]queensnake -1 points0 points  (2 children)

        1.5 lacked file handling shortcuts. When I tried it to do some file processing, the code came out pretty much the same as it would have been in C, and that put me off of it for some years.

        [–]qwe1234 0 points1 point  (1 child)

        [–]queensnake -1 points0 points  (0 children)

        yeah; open, close, readline. I was looking for something more like: for line in file: blah blah blah. Which came later. I like Python now, but at the time I was put off.

        [–]pkrumins -1 points0 points  (0 children)

        yes, it's perfect.


        Learn C first, it will help you understand what's really happening underneath with memory.

        If you want a good place to start here is the best tutorial I have ever found for beginners, and it's from how stuff works of all places.


        After that programming in interpreted languages like python, ruby, perl, php, etc... will be easier.