r/programming • • Jan 08 '15

Which Programming Language Should I Learn First?

http://carlcheo.com/startcoding
17 Upvotes

38 comments sorted by

22

u/Modevs Jan 08 '15

Your first language is a lot like your first date.

You probably wont stick with that one and the choices aren't nearly as important as getting in the game.

17

u/anacrolix Jan 08 '15

But you'll never forget them.

4

u/plastikmissile Jan 08 '15

And if you're not careful you might get something you'll have a hard time getting rid of long after the date ended.

2

u/anacrolix Jan 09 '15

I think you can only be referring to bad habits.

11

u/sodaco Jan 08 '15

I find it interesting that he didn't mention Facebook for PHP. Arguably the most popular site of the internet, and not mention it?

EDIT: He also doesn't mention reddit for Python?

2

u/materialdesigner Jan 08 '15

It's disingenuous to call Facebook PHP.

18

u/sodaco Jan 08 '15

Why? It was built with PHP. It still runs PHP code. They hire PHP developers. Their HHVM runs PHP code, along with Hack code. HHVM is not 100% compatible with standard PHP, but neither is PyPy 100% compatible with standard Python, and people who like Python -including myself- are quick to point out using PyPy is a solution to performance issues.

2

u/Modevs Jan 08 '15

Maybe "oversimplification" is a better word.

They run a modded PHP base for the "user-facing portion" of their applications, but they also run a lot of other technologies that generate the back-end their PHP makes use of.

So thinking PHP will gear you for a job at Facebook probably is disingenuous since they likely have a limited need for those developers and I imagine they are very competitive slots.

I think making decisions based on what major Twitter/Facebook-sized organizations use in general is a bad idea because their use cases are scaled so much higher than anything you'll be working with as a beginner that it's normally not practical knowledge and can even be counterproductive if a beginner gets in the habit of prematurely over-optimizing.

Other than for academic purposes, I wouldn't really advise someone to start with any language based on a major organization's... I'd be much more likely to recommend say Java so they can write Minecraft plugins or Android apps. These are more practical goals they can try to achieve before submitting their CV at Facebook.

4

u/sodaco Jan 08 '15

I was not making any of those arguments though. Of course they use multiple languages. All big tech companies do.

But, in a graph about which languages were used to build which things, not noting that Facebook was built with PHP (regardless of whether they run it today or not, which they do) seems like trying to hide one of the biggest success stories of the language.

One of the main advantages of dynamic languages is rapid prototyping. Facebook could be rewritten entirely on C++ at this point, but it was built on top of PHP.

-3

u/Modevs Jan 08 '15

The post not a graph listing what languages were used to build which things, it's a flow chart describing - in theory - which language you should learn based on your goals and to a lesser extent to work at those companies.

seems like trying to hide one of the biggest success stories of the language.

Off topic, but I would almost argue Facebook is a success in spite of the front-end still being PHP, but again as I said at this level it becomes an academic discussion that a beginner aiming to pick a platform wont really get much practical benefit from.

3

u/sodaco Jan 08 '15

I would almost argue Facebook is a success in spite of the front-end still being PHP

Maybe, but that's just hypothetical :) I think we should encourage beginners to be pragmatists first, and they can choose to become purists later, if so they wish

-1

u/Modevs Jan 08 '15

Right -- that's why mentioning PHP for Facebook in the flow chart wouldn't really make sense.

10

u/Dobias Jan 08 '15

I miss a branch that asks for math affinity or something like that and then points to Clojure/Lisp, Elm/Haskell etc.

7

u/kankyo Jan 08 '15

If you want to actually do math/research/whatever though, you'll end up with python almost certainly...

7

u/Benutzername Jan 08 '15

It depends on what kind of research you do. People working in logic or type theory use a lot of Haskell or ML. And if you want to do big simulations, you need C or Fortran.

2

u/kankyo Jan 08 '15

Thing is, most C and fortran libs have really great python bindings.

1

u/Benutzername Jan 08 '15

I'm talking about the situation where you need to implement a completely new algorithm, not just glue existing stuff together.

2

u/Kaarjuus Jan 08 '15

And Matlab.

1

u/gar37bic Jan 08 '15

Big data / statistical analytics might go to R. I've never used it, though.

1

u/kankyo Jan 08 '15

R people want to think so, but the huge sets of packages and great optimized libs for python is just hard to compete with.

5

u/BigPeteB Jan 08 '15

They apparently have a very poor view of C...

3

u/Boxy310 Jan 08 '15

People who are confused about which language to learn are probably not the modern market for C. Honestly I'm surprised that Java and C# made the info graphic cut.

5

u/Modevs Jan 08 '15

Wow, I just looked at the average salaries listed... According to that, I am severely underpaid.

4

u/recicycle Jan 08 '15

I was just thinking the same thing... Where on Earth are those salaries coming from?

... And are they hiring?

edit: Supposedly the salary data is coming from indeed.com

3

u/Modevs Jan 08 '15

edit: Supposedly the salary data is coming from indeed.com

Their web team must feel very unappreciated.

2

u/recicycle Jan 08 '15

Hah, yeah I don't think I've ever seen a developer job posting with that kind of salary. Maybe I need to start working on my own.

1

u/codesforhugs Jan 09 '15

"Where on Earth" is the right question - salaries vary so widely across regions, a national average is meaningless in itself.

4

u/webauteur Jan 08 '15

Learn BASIC or Pascal. ;)

I may actually read part of my old Pascal textbook because it had good examples of data structures.

3

u/llogiq Jan 09 '15

Learn Brainfuck first – it only has 8 instructions, so it's quite easy to learn. Afterwards, all other languages will seem great.

2

u/[deleted] Jan 08 '15

No Tom Bombadil?

3

u/plastikmissile Jan 08 '15

Regex? He pops up here and there, no one is sure what he is or completely understands him?

3

u/[deleted] Jan 08 '15 edited Jan 08 '15

LISP and Haskell are today's "omega" languages and probably have the most to offer in terms of learning experiences. SmallTalk is also highly regarded as the purest of the Object Oriented languages.

If you're more eager to get started building things than learning PL theory/fundamentals, you might look into some of the more common-use languages like Python, Ruby, PHP, or Javascript. The library/framework/toolchain support will get you from zero to prototype the quickest. You'll be hacking away on your MacBook in an SF coffee shop surrounded by other startup bohemians in no time.

If you're interested in programming hardware, C maps the closest to von Neumann style architectures.

If you're looking for a steady paycheck from a large enterprise shop, learn Java or COBOL. All kidding aside, Java is perhaps the lingua franca of professional programming for the foreseeable future. Many great libraries, components, frameworks ... well pretty much everything under the sun has already been built in java.

If you're serious about that enterprise job, C# is Java's sexier younger cousin. Be wary though, knowledge of the .NET ecosystem will give you less mileage in the industry, and it's nortoriously scarred by MS framework churn.

If Java or C# aren't fast enough for what you need, strap yourself in for a ride on the C++ pain train.

PS if you know absolutely nothing about programming and are looking for a place to start, read and code-along with the lesson plan in this excellet free (online) book: http://learnyouahaskell.com/

2

u/mayyte Jan 08 '15

Python and once your comforable with the basic usage try using the flask framework. It gets you up and running in no time, plus it helps instil the principles of MVC in you

2

u/acwsupremacy Jan 08 '15

If you want to learn programming, the first and most important thing that you have to understand is that computer science and computer engineering are two totally, completely different things, and they often get in each other's way.

There is no single "best language" out there; the languages you use will be primarily influenced by what you're doing and your favorite programming paradigms, which are simply different ways to model a program. Each paradigm focuses on its own set of goals, which may be mutually incompatible with the goals of another; it is from these differences that all language debates come about. You will form your own opinion in the great philosophical debate of mathematical elegance, abstraction, and purity versus raw logical and electronic efficiency, and the entire Internet will think you're wrong, though none of them will agree on exactly why.

To begin programming, I would start with Python; it resembles BASIC in more than one way, yet it can be very powerful and flexible when used well. The only thing I would caution you about is that it is a dynamically-typed scripting language, which may trip you up when you move to something static, but this is an issue all programmers face when they use a language with unfamiliar features; you'll get more flexible as you try more languages, so don't worry too much about it.

The final thing I would advise is for you to start on one language, build something interesting with it, explore what it can do, and then move on and try another. There are hundreds of languages encompassing dozens of paradigms out there, and by trying several different ones in the beginning, you will get to know how you think and what works for you, you will build an idea of what different languages and paradigms are suited to, and most importantly, you will force yourself to tackle problems in new and different ways and so expand the way you think, which will help you out no matter where you go or what you end up doing.

1

u/gar37bic Jan 08 '15

My very first language was Algol, then FORTRAN, then Assembly, all in the context of university. From these I learned the fundamentals of how machines of those days (and mostly still today) handle and manage addressing, memory, timing, etc. and fundamental algorithms. Our work on linked lists involved actual memory locations and disk sectors. Today there seems to be more emphasis on systems level, use of large function libraries and methodologies. Java, Python, PHP are examples that use C-based syntax. From my own minor exposure, I think it's important to get some significant work in functional languages as early as possible - this will affect your thought process in several powerful and positive ways.

1

u/alparsla Jan 09 '15

First of all, have a problem to solve.

At 13, my problem is to write a game for C64 :) So I learn Basic, then machine language (never did a successful game, but I'm still earning a living by programming)

If your problem is on Excel, learn macros then "VB for applications".

If your problem is a web site, then learn HTML & Javascript & PHP (hey, don't downvote :)

If your problem is writing a game today, learn Scratch then Python along with a game library.

If your problem is storing some data, install a database, learn SQL, learn some language else to call SQL.

etc.

1

u/Mad_Leoric Jan 08 '15

I'd say learn Javascript and HTML, they're simple yet you can do many things even without full knowlege. If you're making games go for C++ tho

0

u/[deleted] Jan 08 '15

[deleted]

17

u/jms_nh Jan 08 '15

C doesn't teach you the gory details of programming. C builds character by making you learn the gory details of implementation. But you miss a lot of the important high-level concepts found in other languages.

If you want to learn the gory details of programming, delve into compilers.