CodeWalrus

Development => PC, Mac & Vintage Computers => Topic started by: Araidia on February 05, 2016, 03:06:43 AM

Title: Best programming language to learn?(For beginners)
Post by: Araidia on February 05, 2016, 03:06:43 AM
So, I have a computer programming/game development class next term and I want to know what the best programming language is to learn to "get my feet wet".
So far, I've tried learning a little bit of python at codecademy.com (http://codecademy.com)
So am I choosing the right language to learn first? If not, what should I learn first and are there any good resources to learn it?
Finally, I made sure, and the topic closest to this is this (https://codewalr.us/index.php?topic=851.0)
Title: Re: Best programming language to learn?(For beginners)
Post by: Unicorn on February 05, 2016, 03:11:00 AM
I'd try to Learn TI BASIC, but that's a personal preference :P

In terms of a computer based language, I started with ruby. (it's a bit like Python in terms of base commands) I found it quite easy to use, and the libraries were also easy to get working. Though it does have some problems with creating .exe and .app if you don't have those platforms, it gets a bit hard.
Title: Re: Best programming language to learn?(For beginners)
Post by: DJ Omnimaga on February 05, 2016, 03:15:53 AM
From experience on forums, a lot of people start with Python, VB.Net, Lua or Java. Java used to be a nice language for 2D games and simple applications, but Oracle has ruined it with full of overzealous security protections. I can't really help much, though, because the only language I really dabbled into was VB, but it seems like those four, especially python, are the ones people start with the most. Some people also found Ruby to be easy to start with.

Also for Lua programmers there is LOVE 2D that is available for making 2D games.

What do you want to program, by the way? And for which computer platform? Some languages might be better than others at specific things.
Title: Re: Best programming language to learn?(For beginners)
Post by: c4ooo on February 05, 2016, 03:29:00 AM
Well, TI basic is a very good choice in my opinion. I would not recommend starting with an object-heavy language like java or c#. Javascript is a good option though if you are very new to programming. Personaly, the java 2D was a bit chalanging for me to get into untill i wrapped my head around abstract oop concepts :P Also, i dont see how oracle has 'ruined' it, as @DJ Omnimaga said :P

tldr: Javascript
Title: Re: Best programming language to learn?(For beginners)
Post by: bb010g on February 05, 2016, 03:32:32 AM
I fully recommend Haskell. Follow this. (https://github.com/bitemyapp/learnhaskell) Haskell will give you one of the best grasps of programming you can get from a single language, allowing for rather easy transition to most languages (virtually all the "major" ones). You may find it odd at first, but just stick with it. You'll thank me later when you can pick up a language you've heard is weird in a day or two. :)

About the other options, TI Basic is a language, but it's heavily constrained. You'll have to learn a lot of new stuff to move anywhere else and may have to unlearn habits that are bad anywhere else. JavaScript's main advantage is that it works in the browser, but there's GHCJS (https://github.com/ghcjs/ghcjs), Fay (https://github.com/faylang/fay/wiki), PureScript (http://www.purescript.org/), and Elm (http://elm-lang.org/) on that front coming from Haskell. Its design can detract from its concepts and would be more quickly learned by learning Haskell and then, say, Io (http://iolanguage.org/). OOP is really simple coming from Haskell's much richer and cleaner type system.

@DJ Omnimaga I don't get how Oracle "ruined" Java. If you're talking about Applets, then they were never that great. If you're talking about Java on the JVM standalone, it's better than it was before thanks to Java 8 making a bunch of things saner (using FP concepts, no less :D).
Title: Re: Best programming language to learn?(For beginners)
Post by: Ivoah on February 05, 2016, 03:45:32 AM
Quote from: bb010g on February 05, 2016, 03:32:32 AM
I fully recommend Haskell. Follow this. (https://github.com/bitemyapp/learnhaskell) Haskell will give you one of the best grasps of programming you can get from a single language, allowing for rather easy transition to most languages (virtually all the "major" ones). You may find it odd at first, but just stick with it. You'll thank me later when you can pick up a language you've heard is weird in a day or two. :)
https://xkcd.com/1312/

Anyways, I would recommend Python or maybe Visual Basic. Visual Basic is nice because it's super easy to make GUI programs, whereas Tkinter (Python's standard GUI kit) is pure evil.
Title: Re: Best programming language to learn?(For beginners)
Post by: bb010g on February 05, 2016, 03:49:28 AM
Quote from: Ivoah on February 05, 2016, 03:45:32 AM
https://xkcd.com/1312/

Anyways, I would recommend Python or maybe Visual Basic. Visual Basic is nice because it's super easy to make GUI programs, whereas Tkinter (Python's standard GUI kit) is pure evil.

https://www.reddit.com/r/haskell/comments/uved7/waldo_the_haskell_powered_codebase_behind_xkcds/
Seriously, Haskell is one of the best languages you can learn as a beginner because your brain hasn't had many presuppositions put into it yet, and Haskell teaches you tons about other paradigms, not just functional. FP isn't always the best choice, and Haskell lets you be flexible (without making you hate yourself, like Java). :P

Anyhow, why learn Visual Basic over C#? If you're looking for a quick GUI library, go with Racket (http://racket-lang.org/) or something.
Title: Re: Best programming language to learn?(For beginners)
Post by: DJ Omnimaga on February 05, 2016, 04:48:41 AM
Quote from: bb010g on February 05, 2016, 03:32:32 AM
I fully recommend Haskell. Follow this. (https://github.com/bitemyapp/learnhaskell) Haskell will give you one of the best grasps of programming you can get from a single language, allowing for rather easy transition to most languages (virtually all the "major" ones). You may find it odd at first, but just stick with it. You'll thank me later when you can pick up a language you've heard is weird in a day or two. :)

About the other options, TI Basic is a language, but it's heavily constrained. You'll have to learn a lot of new stuff to move anywhere else and may have to unlearn habits that are bad anywhere else. JavaScript's main advantage is that it works in the browser, but there's GHCJS (https://github.com/ghcjs/ghcjs), Fay (https://github.com/faylang/fay/wiki), PureScript (http://www.purescript.org/), and Elm (http://elm-lang.org/) on that front coming from Haskell. Its design can detract from its concepts and would be more quickly learned by learning Haskell and then, say, Io (http://iolanguage.org/). OOP is really simple coming from Haskell's much richer and cleaner type system.

@DJ Omnimaga I don't get how Oracle "ruined" Java. If you're talking about Applets, then they were never that great. If you're talking about Java on the JVM standalone, it's better than it was before thanks to Java 8 making a bunch of things saner (using FP concepts, no less :D).
Yeah I'M talking about this:

(https://codewalr.us/proxy.php?request=http%3A%2F%2Fimg.codewalr.us%2Fjava.png&hash=cd98dd91e9dfe6cb44549263ef0e03543d5b2bdc)

Basically, how most applets no longer run in any browser (especially Chrome it seems), even with Java security set at the bare minimum. There was a topic about this on CW a few months ago. I was sure that those security things also applied to standalone programs, though.


As for language difficulty, bb010g brings up a good point about habits that we learn from our first languages: Generally, if you try learning ASM after only 2 months of experience with TI-BASIC, then you will have a much easier time than if you spent 2 years using TI-BASIC. It is even more true if you have asperger syndrome or another form of autism that makes it much harder to adapt to changes. The same is true when switching from TI-83+ BASIC to anything that supports functions and variable returning, but not as bad.


EDIT: Also if you spend too much time using TI-BASIC, you get the bad habit of not closing your quotes and parentheses anywhere else, including when writing text. :P The language is still fine if it does everything you need, though.
Title: Re: Best programming language to learn?(For beginners)
Post by: Yuki on February 05, 2016, 04:56:14 AM
Well, it's true Java applets are encumbered by security shenanigans and are gonna die anyway (I heard it'll be removed from Java 9 (https://blogs.oracle.com/java-platform-group/entry/moving_to_a_plugin_free)), but Java outside applets is still going to be fine.

Anyway, Lua is a good starter, as well as Javascript. Ruby and Python aren't bad either. C# is also pretty good if you wanna learn OOP.
Title: Re: Best programming language to learn?(For beginners)
Post by: Max Leiter on February 05, 2016, 04:59:29 AM
A lot of people will disagree with me, but I personally recommend JavaScript (ES6, the newest standard). It runs on any machine, requires very little workspace setup (no complicated IDE required, compiler, etc), and there's loads of support of it online (in my experience more then any other language, just look at ##javascript on freenode)
Title: Re: Best programming language to learn?(For beginners)
Post by: DJ Omnimaga on February 05, 2016, 05:14:49 AM
But what about cross-browser compatibility?
Title: Re: Best programming language to learn?(For beginners)
Post by: bb010g on February 05, 2016, 05:52:37 AM
Quote from: Max Leiter on February 05, 2016, 04:59:29 AM
A lot of people will disagree with me, but I personally recommend JavaScript (ES6, the newest standard). It runs on any machine, requires very little workspace setup (no complicated IDE required, compiler, etc), and there's loads of support of it online (in my experience more then any other language, just look at ##javascript on freenode)
##javascript: 1202
#haskell: 1496
(While we're talking about IRC, #haskell-beginners (http://irc://irc.freenode.net:6697/#haskell-beginners) (280 present) is an amazing place for help when you're learning Haskell.)

Quote from: DJ Omnimaga on February 05, 2016, 05:14:49 AM
But what about cross-browser compatibility?
JavaScript is more cross browser than Java applets ever were.
Title: Re: Best programming language to learn?(For beginners)
Post by: DJ Omnimaga on February 05, 2016, 05:57:45 AM
Ok because I always seemed to run into JS code that had troubles running in at least one browser before. But agian that was a few years ago, back when Opera still used Presto engine and people still cared about getting their stuff working in IE6.
Title: Re: Best programming language to learn?(For beginners)
Post by: Araidia on February 05, 2016, 03:41:35 PM
Quote from: DJ Omnimaga on February 05, 2016, 03:15:53 AM
From experience on forums, a lot of people start with Python, VB.Net, Lua or Java. Java used to be a nice language for 2D games and simple applications, but Oracle has ruined it with full of overzealous security protections. I can't really help much, though, because the only language I really dabbled into was VB, but it seems like those four, especially python, are the ones people start with the most. Some people also found Ruby to be easy to start with.

Also for Lua programmers there is LOVE 2D that is available for making 2D games.

What do you want to program, by the way? And for which computer platform? Some languages might be better than others at specific things.
I probably want to program 2D games at first(because it's easier) and I'm gonna [most likely] be programming for windows

Thanks for all of the suggestions so far!
Title: Re: Best programming language to learn?(For beginners)
Post by: ben_g on February 05, 2016, 03:54:28 PM
Personally, if your main intention is to just get started with PC programming, I'd recommend Gamemaker Studio. I wouldn't recommend it for actually making your software (though apparently it has improved a lot since I actively used it), but it has an easy to use interface and lots of tutorials.
You can start simple by using the drag&drop functions so that you can easily get something working and experiment with how computers process stuff without having to write actual code.
It also has a built-in scripting language for when you're ready to start writing actual code, which is written in an included editor with syntax highlighting. Because everything is included in one package, it's also very easy to reference other objects and sprites. The object-oriented part is only very basic though, as each object is basically just a collection of variables (no functions), but that may actually be a good thing since it doesn't make things overly complicated.
The included programming language is basically a simplified javascript, so when you eventually want to start with a "real" programming language, it's not hard to move to javascript (though as soon as you're familiar with programming concepts, learning a different language usually isn't that hard).
Title: Re: Best programming language to learn?(For beginners)
Post by: Lionel Debroux on February 05, 2016, 04:08:39 PM
There are multiple families of programming languages, spanning dozens of languages each. It's important to know about the realm of possibilities and their relative strengths and weaknesses. I'll sketch a quick view, but the topic is much broader, and you can learn about it by yourself through Internet resources :)

1) Scripting, dynamically typed, usually interpreted languages: writing programs is easier, writing foolproof programs is hard, execution is slow (usually 10x-1000x slower than native code when not using a Just In Time compiler).
* nowadays, Python has displaced Java as the first programming language taught at school, and is generally considered a good choice for a learning language, despite being object-oriented. That would be my advice for a first programming language.
* JavaScript and PHP are very poor choices for a first language, they have lots of quirks and lend themselves to tons of bad habits because they're so lenient, even in ES6 and PHP 7 times. Just don't do that disservice to yourself and to others (should you want to become a professional software developers, like a number of community members) - really, only learn JS or PHP later, when you have more clues about not spitting loads of crappy, insecure code :)
* Lua's not that bad, TI put it on the Nspire with a crippled standard library and some proprietary layer of their own, but Lua is far from being as popular as Python and Java.
* TI-Basic is non-portable and has its share of quirks, it's not a good choice either for a first language. When TI calculators were the only programmable platform readily accessible to most beginners for a decade, until, say, a decade ago, alright, but... not any longer.

2) Compiled, more or less strongly typed languages: writing programs is harder, but a number of silly and less obvious issues are eliminated by compilers, and execution is very fast because most languages of that class are compiled to native code Ahead Of Time.
* the usual C/C++ are powerful multi-edged swords. With a good book (sorry, I don't have any to recommend, especially for non-French languages), C is great for imperative programming, and doesn't distort the mind from the get go with object-oriented programming, which should be introduced only later, IMO, when one's comfortable with imperative programming, or functional programming, as mentioned by bb010g. I started with C, long before university taught me any form of programming.
* Java is object-oriented, compiles to bytecode and is executed as a mix of interpretation and Just In Time compilation, so it's not quite as fast as good equivalent C/C++ on average. It's still very popular, but its popularity is waning somewhat, as it faces competition from improved C++ and powerful newcomers, such as...
* ... the Go / Swift / Rust triplet of efficient, relatively safe languages, compiled AOT. Go has a large popularity head start on the two others thanks to its portability, Swift isn't really portable yet (it expanded beyond the Apple ecosystem, which is a minority on both desktop and mobile platforms, only pretty recently), and Rust is far less popular than the two others but has safety features that the others don't have.

3) Functional programming: closer to math-oriented thinking, execution can even be fast when compiled to native code.
* I'm not really qualified about functional programming, but it's a fact that some of its fundamental concepts (map, filter, reduce, any, all, and friends) are useful in all other languages, and being completely ignorant about them is a bad thing. I'm using e.g. map and filter in a JS code base at work, because that's the appropriate thing to do.

4) Visual programming
* Scratch and friends. Good as well for beginners, but I'm incompetent about them :)

5) Other families
For instance, logical programming ala Prolog. To some people, that is the only language which makes sense, while most others find it highly specific (niche) and confusing ^^
Title: Re: Best programming language to learn?(For beginners)
Post by: alexgt on February 05, 2016, 05:22:03 PM
I just started learning Python today to ^.^

I started with TI-BASIC and with Java on PC but that is just me ;)
Title: Re: Best programming language to learn?(For beginners)
Post by: Dudeman313 on February 05, 2016, 07:33:41 PM
I'm a beginner, and I've found it easy to mess around with TI-BASIC programs.
Title: Re: Best programming language to learn?(For beginners)
Post by: alexgt on February 05, 2016, 07:37:03 PM
Yeah, but I think he meant PC languages :P

That is what I would start with on calc tho ;)
Title: Re: Best programming language to learn?(For beginners)
Post by: bb010g on February 06, 2016, 12:10:36 AM
Quote from: Lionel Debroux on February 05, 2016, 04:08:39 PM
2) Compiled, more or less strongly typed languages: writing programs is harder, but a number of silly and less obvious issues are eliminated by compilers, and execution is very fast because most languages of that class are compiled to native code Ahead Of Time.
Writing programs in compiled langs doesn't have to be hard. Look at Haskell, Crystal (http://crystal-lang.org/), or Ceylon (http://www.ceylon-lang.org/). Also, I think C and C++'s corner cases would like to talk to you about "silly and less obvious issues". :)
Quote from: Lionel Debroux on February 05, 2016, 04:08:39 PM
* the usual C/C++ are powerful multi-edged swords. With a good book (sorry, I don't have any to recommend, especially for non-French languages), C is great for imperative programming, and doesn't distort the mind from the get go with object-oriented programming, which should be introduced only later, IMO, when one's comfortable with imperative programming, or functional programming, as mentioned by bb010g. I started with C, long before university taught me any form of programming.
C++ w/ Core Guidelines will be a lot stronger language IMHO, but there's not too much out there resource wise yet.
Quote from: Lionel Debroux on February 05, 2016, 04:08:39 PM
* ... the Go / Swift / Rust triplet of efficient, relatively safe languages, compiled AOT. Go has a large popularity head start on the two others thanks to its portability, Swift isn't really portable yet (it expanded beyond the Apple ecosystem, which is a minority on both desktop and mobile platforms, only pretty recently), and Rust is far less popular than the two others but has safety features that the others don't have.
Rust is amazing for system programming too, and is rather easy to use and unsurprising after a bit. All of these listed are pretty nice to write too.
Quote from: Lionel Debroux on February 05, 2016, 04:08:39 PM
4) Visual programming
* Scratch and friends. Good as well for beginners, but I'm incompetent about them :)
Snap! (http://snap.berkeley.edu/) is actually pretty awesome for introducing people to programming.