Which language to learn

Discussion in 'Mac Programming' started by Barney63, Jun 6, 2014.

  1. Barney63 macrumors 6502a

    Barney63

    Joined:
    Jan 9, 2014
    Location:
    Bolton, UK.
    #1
    I think I want to learn a programming language just for the sake of it.

    What language do you suggest?
    Why?
    What will I be able to do with it?


    Barney
     
  2. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    If you want to learn a language just for the sake of it, pretty much any will do. The choice of a language is probably more of a style issue than anything else, since most modern languages have similar capabilities (my current preference is Ruby, because the object model is similar to Objective-C, but the syntax doesn't drive me nuts).

    A better question would be what do you want to do with the language (assuming that you have any programming skills at all)?
     
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    Python is probably the easiest language to learn that people actually use (as opposed to say, LOGO which may be easier to learn, but nobody uses outside of the context of classrooms teaching the basic ideas of programming).

    But I'd say you're going about this all wrong. You shouldn't learn a programming language for the sake of learning one. You should have an end goal, something you want to make. Tell us what you want to make, and we'll suggest the best language to make it in. IE, if you want to make a game, I'd suggest Unity as that language was purpose made for games.
     
  4. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #4
    The language is small compared to the APIs you need the know to get anything done. But you do have to start some place.

    If I were teaching programming, I'd start with Java. It is nearly universal in that it runs on most every platform and it is VERY conventional so what you learn can be transferred to other programming languages. There is also quite a lot of good instructional materials available.

    One could argue for Python too. But I think Java is a better jumping off place.

    But it also depends one what you want to write? Are you controlling robots or making video games? If you are writing apps for IOS devices then Apple has just released Swift.
     
  5. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #5
    Javascript. You don't need anything but a web browser.
     
  6. Barney63, Jun 7, 2014
    Last edited: Jun 7, 2014

    Barney63 thread starter macrumors 6502a

    Barney63

    Joined:
    Jan 9, 2014
    Location:
    Bolton, UK.
    #6
    If I go for Java, can you recommend a book to get me started.

    Is Java not just used for websites?


    Barney
     
  7. aaronvan Suspended

    aaronvan

    Joined:
    Dec 21, 2011
    Location:
    República Cascadia
    #7
    Learn the pricinples of programming with:

    http://racket-lang.org

    DrRacket is a great IDE that lets you write code and run it in the same window.
     
  8. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #8
    You are likely mixing the entirely unrelated languages of Java and JavaScript.

    JavaScript is a language used for client side code on websites (code which runs on the computer visiting the website rather than the server that hosts the website).

    Java is a language which is used to write apps which run inside a JVM (Java Virtual Machine). JVMs are available for OS X, Windows, Linux, and Android... plus jailbroken versions of iOS, I would imagine. Up until recently, OS X even had a JVM preinstalled which made Java a pretty attractive language for writing apps when you wanted it to be able to run on any computer.

    There's also a Java plugin for browsers, which allows websites to have you download and execute Java code when you visit them. You'll recognize them because a box on the website will appear with a loading indicator and the Java icon. Often this coincides with a popup notifying you that a newer version of Java is available. These kinds of plugins used to be more common, but it seems to me that they've been going away and being replaced with JavaScript instead.

    Python is a language which is used to write apps which can be run with the Python Interpreter. Python Interpreters are available for OS X, Windows, Linux, and probably other platforms, too. OS X and most (probably all) variants of Linux come with a Python Interpreter preinstalled, making another pretty attractive language for writing apps when you want them to be able to run on any computer.

    I should note that Windows comes with neither a JVM nor a Python Interpreter preinstalled. This is amongst the many reasons that I describe Windows as the most incredibly useless OS you can possibly install, and I honestly wonder why it takes any time to install at all when it comes capable of doing nothing. I'd argue that a default installation of Chrome OS is more useful than a default installation of Windows.

    Racket is a pretty cool language for learning how to program, but I'm not sure that it's very practical outside of academia.
     
  9. AdonisSMU macrumors 603

    Joined:
    Oct 23, 2010
    #9
    He said javascript. Javascript is used for websites and hybrid apps currently. It will be replacing AppleScript in Yosemite.
     
  10. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #10
    It will be added as a first class OSA component, but that doesn't make it a replacement for AppleScript.
     
  11. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #11
    Oh really? I missed that entirely.
     
  12. AdonisSMU macrumors 603

    Joined:
    Oct 23, 2010
    #12
    Ok fair enough. I misunderstood.
     
  13. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #13
    JavaScript for Automation Release Notes

    I was kind of surprised myself, since Apple dumped Ruby and Python as first class scripting languages - maybe they just looked at them long enough to get some ideas for Swift (the time frame looks about right).

    AppleScript gets its ass kicked compared to just about everything else, but I don't see it going away anytime soon.
     
  14. hhas macrumors regular

    Joined:
    Oct 15, 2007
    #14
    They're not dumped: OS X continues to ship with Perl, Ruby, Python, and other 3rd-party interpreters, and that isn't going to change short of OS X one day becoming a locked down platform a-la iOS. (Unlikely though, since without differentiation there wouldn't be any point in maintaining two separate OSes.)

    They don't put any effort into promoting them though (not that they ever did), they did stop bundling templates in Xcode (you can still add them yourself, though they were never good anyway), and IIRC don't include a RubyCocoa binding for Ruby 2.0 (but that's more because the open source folks aren't keeping up). They only really significant wind change was reversing their plans to provide MacRuby (around the same time as Swift became noticed inside Apple, natch), but it wasn't a public API at the time they abandoned it.

    In any case, folks who develop much in Python, Ruby, etc. generally add and maintain their own installations, since OS-supplied distros are rarely at the latest version due to the different release schedules.

    This is true, except in one field where AppleScript kicks the absolute tar out of every other supported option: controlling scriptable (i.e. Apple event-aware) applications. For a company that invented and owns both AppleScript and Apple event technologies, they're really rather rubbish at implementing and supporting it themselves.

    Scripting Bridge was introduced 7 years ago in Leopard, promising to open up application scripting to ObjC and Python, Ruby, and every other language with ObjC bindings, and there's fewer Python/Ruby/ObjC folks doing Apple event automation now than before 10.5 was released.

    Unfortunately, JS4A's Apple event support doesn't appear to be anything like as good AppleScript's, and I'm not even sure if it's equal to SB's, so they've kind of snatched defeat from victory once again. :(

    ----------

    Oh, and to respond to the OP: if they've never programmed before, I'd really like to suggest Logo. It's very simple to learn - gets straight to the heart of what programming's about: abstraction - and (being essentially a Lisp without Lots of Irritating Silly Parentheses) is very, deceptively, powerful. However, I don't know of any modern, particularly thriving Logo distributions so can't give a real recommendation there. (The more I learn about programming, programming languages, and programming pedagogy, the lower my opinion of the mainstream goes.)

    If the OP already knows one or more mainstream procedural/OO languages, I would really recommend getting out of that largely unexciting imperative box and exploring the vast and varied world outside of that. The non-imperative world is a blast. So many different idioms and ways of thinking and problem solving to explore. Spend some time teaching yourself functional programming c/o Haskell or ML. Explore some Scheme, Forth/Joy, Erlang, Smalltalk, Wolfram. It'll really broaden your perspective on what you can do.
     
  15. hhas macrumors regular

    Joined:
    Oct 15, 2007
    #15
    The problem with Logo is the lack of good, rich, varied collections of libraries (outside those for turtle drawing, of course), and dated, crude Logo editing/runtime environments that don't employ more recent research in HCI and end-user programming, or even look especially enticing. (Heck, even Swift will now allow you to observe the live state of your program as it runs, easily advancing state of the mainstream art from mid-1960s to mid-1970s.)

    I don't think there's anything wrong with curiousity for its own sake. But having a project that really interests you is a great practical way to engage with the subject and test and practise your developing skills.
     
  16. Barney63 thread starter macrumors 6502a

    Barney63

    Joined:
    Jan 9, 2014
    Location:
    Bolton, UK.
    #16
    The only programming that I have done is a bit of Visual Basic about 10 years ago where I did a few program's for decoding car stereos. I have been doing some Maple at uni this year as part of my Maths degree too.


    Barney
     
  17. hiddenmarkov macrumors 6502a

    Joined:
    Mar 12, 2014
    Location:
    Japan
    #17
    Did you like the maple programming? Or the focus in the the scientific/math/engineering realms?


    Reason I am asking is this could help find languages to work with. It generally helps if your langauge is suited to your interests.

    If you like this aspect you could have python, r, julia (if you like the thrill of learning in beta) as top picks. Python has a few libraries for this area. R... well we could argue if its a true language but that be semantical at many points lol. Julia is in beta and missing some nice features like a debugger that is not cryptic as I understand it (if you make new coder mistakes its not forgiving the take away...of course as I am reading it neither is swift lol).

    Not putting obj-c or now swift out of the picture but....you'd be getting more use/help in the universal langauges. If this an area of interest ofc.
     
  18. hhas macrumors regular

    Joined:
    Oct 15, 2007
    #18

    Are you aware of Wolfram Language? It's the language portion of Mathematica, tidied up and repackaged. Core language looks very compact, mad amount of libraries included; you may have to wade through Stephen's gushings which can get a little tiring at times, but it's the product that matters and it seems to show promise. It's currently at preview - not sure what the final release date will be, but Raspberry Pi includes a free copy to play with for non-commercial work, and they're dirt cheap to pick up.

    If math and symbolic manipulation are your thing, you might want to look into that or the venerable, yet sharp as ever, Scheme. Or maybe NetLogo (parallel Logo) if stuff like emergent phenomena are an interest. Scheme and Logo are both Lisp family, so the core language is basically a few datatypes and abstraction facilities, and everything else is recursively built on those. Look past the boring, dated surface presentation and there's a wealth of great concepts to explore. They have their own weaknesses and imperfections, but just realizing that 90% of "core" features in the Algol descendents (C, Pascal, Java, VB, Python, etc) are nothing of the sort: they're just bloaty, artificially-limiting crud that's inextricably welded in because their authors were lazy, ignorant or hopelessly rigid at thinking.

    If you're learning purely for its own sake, I think you should pick something that'll broaden your awareness of what's possible. Mainstream imperative languages are most practical for mainstream product development work simply because they're the most popular so have the broadest library and tool support, but they're deeply mediocre as tools for thinking with, partly for their own ignorance (they don't know how crude and constrained by their own limitations they are), partly because they all try to be all things to all people, so generally end up largely unfocused and do no one thing particularly well.

    These days I find the declarative programming world much more varied and interesting place to explore. Once you actually plan and pick your constraints, e.g. pure functional programming = no side effects, you open up new possibilities for thinking and working. e.g. No side effects turns programming from micromanaging endless step-by-step instructions (low-level thinking) into establishing relationships between your inputs and outputs (high-level abstract thinking), and you can leave the machine to work out the time and order in which to perform the operations required to solve your requests.

    Standard imperative languages may claim to support FP too, but they really don't: they may crib a few shallow trivial features like map() and filter() and maybe first-class functions, but they have none of the thinking or control to ever rise above just banging the rocks together.

    Exploring the rich, if understated, non-imperative field (even if you don't understand the half of it at first) will help make you a much more flexible and creative thinker than spending your life down the C/Java/Python coal mine, even if you do end working the latter as a practical day job.

    HTH

    p.s. Worth a bookmark: http://lambda-the-ultimate.org/
     
  19. hhas macrumors regular

    Joined:
    Oct 15, 2007
    #19
    To which I meant to add:

    But the core Logo language itself is like Alice down the rabbit hole: it looks so ridiculously simple you think it can't do anything of worth. And it is ridiculously simple: but it's that very simplicity that makes it virtually open-ended. Once you know how to build abstractions - which is the third thing it teaches you [1] - you can recursively build up the base language into whatever powerful, expressive, focused, problem-solving vocabulary you like. And that's what programming's truly about: tool building, not mere rote tool use.

    Get your head in that mindset, and you'll already be doing better than a good percentage of trained professional programmers today. :)

    --

    [1] Here's how you teach Logo:

    1. This is a word.

    2. This is how you run words.

    3. This is how you add your own words.

    Compare to the 200-page whargarble you have to wade through just to tour the core of a C/Python/JS/whatever language, and you wonder what mainstream programmers are smoking. Or maybe they just enjoy creating endless complexity and OCD micromanaging make-work for themselves... :p
     
  20. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #20
    You're quite confused. Here's how you do most stuff in a good language:

    1 - Use the standard tool.
    2 - Test.
    3 - Debug if necessary.

    In a language like logo, on the other hand, you:

    1 - Write a tool.
    2 - Discover your tool needs another subtool, so write that subtool.
    3 - Write a subsubtool for your subtool.
    ...
    ? - Test your subsubsub(subsubsubsub?)tool.
    ?? - Debug
    ??? - Test
    ???? - Debug
    ...........
    n-2 - Use your tool.
    n-1 - Test.
    n - Debug.

    Of course this can happen in any language - you'll eventually run into a problem that the standard library lacks a tool for if you write enough different programs in the language no matter how comprehensive the library is - the difference is that in a language like logo, this will happen in nearly every program you ever want to write.
     
  21. mrxak macrumors 68000

    Joined:
    Apr 16, 2004
    Location:
    Drifting through space in a broken escape pod
    #21
    I just started learning Python this week as a summer project, myself. I am enjoying it quite a bit already. Granted, I have a strong computer science background and numerous other programming languages under my belt, but Python definitely seems very easy to learn. What's more, it seems quite powerful, with some really fantastic standard libraries. I wouldn't say it's the greatest language in the world, but if somebody new to programming wants to pick up a language to get started on, I would wholeheartedly endorse Python both from what I've read about it, and what I know firsthand after only a few hours of coding.

    I've actually formed a sort of a Python learning group with some friends, and we're all doing it together to keep each other motivated and help each other out. A bunch of them have no programming experience whatsoever, but they seem pretty excited to be learning it. It's too early to relay their experiences, but enthusiasm has to count for something.
     
  22. Barney63 thread starter macrumors 6502a

    Barney63

    Joined:
    Jan 9, 2014
    Location:
    Bolton, UK.
    #22
    @ArtOfWarfare
    I think I will have a look at Python.
    What do I need to get started?
    I have seen a couple of eBooks for beginners, what else do I need?



    Barney
     
  23. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #23
    Codecademy has a course on Python. Check it out!
     
  24. hiddenmarkov macrumors 6502a

    Joined:
    Mar 12, 2014
    Location:
    Japan
    #24
    http://learnpythonthehardway.org/


    I found it nice intro to python. Author has an interesting writing aspect to his work, I find it refreshing to read. He has a personality and not scared to show it is a way to put. Now whether you like that personality....that is on the reader lol. Actually makes even reading preface/intro interesting even, usually breeze through or skip these. I liked reading his tbh.
     
  25. dollystereo macrumors 6502a

    dollystereo

    Joined:
    Oct 6, 2004
    Location:
    France
    #25
    I learned Python with the MIT course in iTunes U
     

Share This Page