Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Barney63

macrumors 6502a
Original poster
Jan 9, 2014
799
1
Bolton, UK.
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
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
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)?
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,561
6,059
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.
 

ChrisA

macrumors G5
Jan 5, 2006
12,581
1,697
Redondo Beach, California
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

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.
 

Barney63

macrumors 6502a
Original poster
Jan 9, 2014
799
1
Bolton, UK.
If I go for Java, can you recommend a book to get me started.

Is Java not just used for websites?


Barney
 
Last edited:

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,561
6,059
Is Java not just used for websites?

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.
 

AdonisSMU

macrumors 604
Oct 23, 2010
7,298
3,047
If I go for Java, can you recommend a book to get me started.

Is Java not just used for websites?


Barney

He said javascript. Javascript is used for websites and hybrid apps currently. It will be replacing AppleScript in Yosemite.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
Oh really? I missed that entirely.
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.
 

hhas

macrumors regular
Oct 15, 2007
126
0
JavaScript for Automation Release Notes

I was kind of surprised myself, since Apple dumped Ruby and Python as first class scripting languages

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.

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

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.
 

hhas

macrumors regular
Oct 15, 2007
126
0
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).

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.)

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.

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.
 

Barney63

macrumors 6502a
Original poster
Jan 9, 2014
799
1
Bolton, UK.
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
 

hiddenmarkov

macrumors 6502a
Mar 12, 2014
685
492
Japan
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

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.
 

hhas

macrumors regular
Oct 15, 2007
126
0
I have been doing some Maple at uni this year as part of my Maths degree too.


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/
 

hhas

macrumors regular
Oct 15, 2007
126
0
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.

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
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,561
6,059
maybe they just enjoy creating endless complexity and OCD micromanaging make-work for themselves... :p

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.
 

mrxak

macrumors 68000
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.
 

Barney63

macrumors 6502a
Original poster
Jan 9, 2014
799
1
Bolton, UK.
@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
 

hiddenmarkov

macrumors 6502a
Mar 12, 2014
685
492
Japan
@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

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.