If you have absolutely no experience programming, start with Python. There are three things to learn when programming: 1) language syntax, 2) concepts (conditionals, logic gates, loops, etc.), and 3) how to solve problems.
What makes python a good choice is that you don't have to spend too much overhead learning language syntax in order to implement concepts, and you'll easily be able to keep the learning of those two items separate.
Once you have a strong foundation in concepts, you can much more easily pick up a different language. The biggest downfall there is that if you decide to later learn Ruby or JavaScript, you might approach a solution as, "This is how I would do it in Python." Don't fall into that trap. Learn the features each language provides and how to use them.
I always recommend Lua as a first language. It's about as straightforward to learn as Python, but it's smaller and simpler, with fewer "gotchas". Once you've learned Lua, moving to Python is about as easy as moving to Javascript.
I don't recommend Python or Javascript because while having a rich set of third party modules is great for actual development, it's a detriment and distraction for beginners. When you're learning the nuts and bolts of programming, it's easy to be misled by how easy some common task is to perform via API call and think you understand it when you haven't really been exposed to it. This becomes a big problem when moving to some other language, where library functions work in a different but equally straightforward way. When it comes to things outside the core standard library, you should really learn to implement them yourself before becoming accustomed to using third party libraries.
Python is a great second language, but the way you write things for a beginner programmer is very different from the way you write things when you're trying to be clever and squeeze a lot of behavior out of a few characters or a few cycles, and python has too much of a mixture: searching for information on how to solve a problem in python will get you equal numbers of people who don't know how a for loop works and people who prefer to do everything by passing lambdas around.
Lua is not a bad choice: the docs are good and once you get the basics down https://love2d.org/ is great for writing Tetris and having having something you can point to and go "I did that"
I disagree with some of these points. Specifically, programmers should necessarily be left unable to understand everything they use. Packaging systems are excellent for providing you with functionality without the mental cost of having to understand how that functionality works. They're not a distraction, they're how people get things done.
And Lua is not a great first language. If you know how to use it, it's a great language; but its 1-indexing, tiny standard library, inability to distinguish between hashmaps and arrays, confusing "metatables", and lack of external libraries really make it tough for me to recommend as a first lang.
This comes from someone who used LuaJIT often with Love2D to prototype games.
I don't know that hiding complex ideas is necessarily helpful for a beginner. Admitting "by the way we're writing 'public static void' every time for a reason, but we won't worry about it yet" or "yes technically you could complete this assignment on one line, but trying to learn that right now is not useful" don't seem like bad ways of confronting the idea that programmers don't always know everything and that's okay. Keeping them completely insulated from those kinds of things could make them seem scarier than they really are.
Of course learning is complex and the "best" way totally depends on who is learning and their goals.
Don't learn a programming language. Learn how to accomplish projects.
Pick a project, whether it's a blog or an automated tea brewer or 3D model viewer or something... and then pick a language that suits your needs.
So many beginners fall into this trap of learning just for the sake of learning; I've found that people with projects and with clear goals make the most progress.
If you want to learn a programming language, read any of the other comments. (I agree with Python being first on the list.) But if you want to learn to program, don't fit yourself into a category just yet. Be pragmatic and use whatever's best for the job.
This is really great advice that jibes with my own experience. A small thing I would add is that when you do this, the following main goals are possible:
1) To finish the project.
2) To learn a language.
3) To finish the project, but also learn a language.
4) To learn a language, but also finish the project.
My $0.02 is that: 1) tends to lead to short term hacks; 2) and 4) tend to lead to dwindling motivation; 3) is ideal. And if it's your first language, do the project while you read a good generic programming book like 'code complete'.
C, on a Unix system like Linux or BSD. It'll make you learn how your computer works, which is an essential skill to have and will help you understand everything else you learn.
That's how it is done in universities. That's how I started. My professor even did not allow compilers which can specify errors. We were supposed to find out errors on our own. And you know, I had to learn vim first to be able to write anything. He just wanted to make it impossible to have any aid. The recommended book was by Ritchie and Kernighan.
I learned C when I was 11, an uncle gave me a book as dense as a dictionary covering all the aspects of the language, as well as algorithms. He called it "The Bible".
For 1 year I woke up at 5:00am every saturday and sunday, to use the only computer we had at home before other people were up so I could do every single exercise of the book (there was about 20 per chapter, 10 first trivial, and the rest were small projects of increasing difficulty).
I consider that this experience is what made me the best programming student even at college, and an excellent developer when in the workplace. The lessons I learned from C are still priceless even though I mainly develop in managed and OOP languages today.
This will teach you basics that will never fade, there're certain Google searches you will never make again.
The important thing when you start is to know how a computer works, and how lines of code are interpreted and executed by the computer, as well as how to express and solve real world problems with computer instructions. You don't need to know every detail, but the less magic it feels, the better.
>The important thing when you start is to know how a computer works, and how lines of code are interpreted and executed by the computer, as well as how to express and solve real world problems with computer instructions.
And C is both low-level enough and high-level enough to allow you to do all of this at the same time.
It might be worth pointing out that your ability to do this (learn C from a book at 11 years old) is at least uncommon, if not extremely rare. This may have worked very well for you but is likely to be difficult, discouraging, or down right impossible for most other people.
Its a beautiful language well worth the effort and it has a HUGE ecosystem behind it. You'll never lack for resources. It is powerful and I found it doable to learn it all on my own.
It will aid in the transition to making dynamic websites because it is used in Rails.
In the early part of my learning I found that the break in compatibility between python 2 and 3 was irritating and confusing to me. Some of the good books were on python 2 and I had been informed the world was moving on to 3. Ruby has major versions (1.9 vs 2) but no break.(I started out by trying to learn python but switched midway to ruby)
The only caveat is if you want to do math heavy stuff or machine learning - python excels at that.
Python is frequently recommended by people with a CS / computational background. I did not have that.
Some people do not approve and I understand. But this was my experience. YMMV.
Ruby is a terrible first language. Too many ways to do things and looking at other peoples example code will only confuse people new to programming. Also too easy to fall into bad habits.
Imagine you're an alien who just arrived to Earth. You are trying to decide what language to learn.
One hipster tells you "You need to learn Esperanto! That's totally cross platform and the most ideal language ever!"
Another hipster tells you "Learn latin! That's the most legit language ever. All other western languages are based on it!"
But all you want to do is live in the US and make some friends. Will you go learn Esperanto or Latin, instead of learning English? Don't listen to these hipsters.
I agree with another guy on this thread saying don't learn a language for the sake of learning it. Because you will probably become a mediocre dabbler that way. Only learn if you want to accomplish something because only by using it in a practical context you become proficient at it. Otherwise you can maybe tell your friends "Hey I know Esperanto!" but does that really matter? There are thousands of other more valuable things you can do with your time than learning Esperanto, especially if you're looking for the "first language to learn"
Python is a good choice. I would argue that C, followed by C++, might have more applicability later on; a lot of languages are modeled on one of those two. They also are lower level and so give you a more in-depth understanding of how memory allocation works.
It's simple enough, completely ubiquitous and has an incredible amount of online resources. To start, just open developer tools in your favorite browser and type console.log("Hello, World!");. Congratulations! You've just written your first computer "program". Now go try one of the thousands of great javascript tutorials for absolute beginners.
Once you learn the basics you're now able to code anything from a basic website to an embedded machine. Your code will work on any operating system and can be distributed on a platform (the web) that makes it trivial to show off your work to your friends.
But even if you don't choose Javascript, please avoid some people's suggestions of learning systems languages like C, C++, Rust or a paradigm-specific language like Java, C#, Haskell. Yes, these are all fine languages in their own right, but you'll spend a month writing boilerplate you don't understand, which is both confusing and unhelpful. If you have any friends that can program and are willing to help you, following what they know may also be a good idea.
* Want to make webpages ? Learn JavaScript, HTML and CSS.
* Android apps ? Learn Java.
* iOS apps ? Learn Swift.
* No idea what you want to do, but strong desire to learn to code ? Learn Python. You could use Python for general purpose programming, small games and so on ...
1. Learn an "easy" general purpose scripting language (JavaScript because you can just type F12 in your browser now and start writing code, or Python if you want something just as simple but more "logical" and "sane", Lua ok too) until you feel you "grok" the basics: once you can write a simple text-based questions and answers game that uses a loop, and you know how to write a simple function that returns another function (called "higher order function" but do not be scared), it means you "grok the basics.
2. Pic the platform/domain of your first project and use the easiest language that is still a first class citizen of that platform. Easy guide:
- iOS -> Swift (don't pick Objective-C if you haven't touched C or C++ before)
- Android -> Java (don't pick JavaScript first, unleast you have serious *web development* experience, the zillions of all-slightly-wrong options and choosing a framework madness will make your brain explode even if the language is simpler!)
- web browser -> JavaScript
- web server -> anything *except* Nodejs (JavaScript) or PHP, you don't want to start by diving head first in callback hell and a zillion ways to do everything and you also don't want to learn all horrible worst practices accepted in PHP-land that you'll have to unlearn later: *Python* or *Ruby* or *Go* are ok here but avoid large frameworks (choose something like Flask for Python or like Sinatra for Ruby first)
- linux -> C
- desktop/console game using Unreal engine -> C++ & UnrealScript
- dektop/console/mobile game using Unity engine -> JavaScript and C# are both ok here
- windows desktop -> C# or JavaScript depending on your purpose
- macos desktop -> start with Swift, got to Objective-C if you can't get to your goal using Swift
- hardware hacking -> "Arduino C" as suggested by someone else or Python if the platform you're hacking supports it
- machine learning / AI -> Python
I like very much http://www.codeskulptor.org/ because of the small entry barrier: easy syntax, small ecosystem, no installation, good documentation, possibility to write small games.
If you are young, you can also motivate friends, emulation, ...
And for you second language you will probably know better why you want to leave codeskulptor:
- full python to have bigger ecosystem
- java if you want an IDE (eclipse or netbean)
- javascript, html, css if you want to build a "startup"
- haskell or scala if language is your interest
- C, unix if system interests you
- C++ if you are masochist
- Excell VBA
- ...
The language doesn't really matter much at the end of the day. I think I started with "high level" COSMAC VIP assembly (and I'm not that old... I needed something that would drive 5V electronics.)
First pick a project. Most people pick video games, or light electronics (simple robot, nest replacement, etc). Then, pick something with a strong community and lots of documentation geared at newbies. I strongly recommend a Raspberry Pi (but buy the ~$60 official kit with power supply and SD card -- they have crazy compatibility issues with SD cards and USB chargers). The Pi comes preloaded with beginner-oriented things like PyGame, a computer music language, and software to drive cheap breadboards for electronics projects. There are tons of tutorials online.
Alternatively, maybe download Unity, and watch the YouTube 2D game tutorials (the open source suggesions in other replies are also fine, and most of the language suggestions make sense for some project or another).
By all means, if you have an experienced programmer that is willing to help you, tell him/her about your project idea, and ask for help picking a language and setting up a development environment. A suboptimal language choice will be more than made up for by in-person tech support.
Like many others I don´t consider HTML and CSS programming.
To some PHP isen´t even a programming language it´s a scripting language.
But I ended up programming/scripting PHP.
I like it, I feel at home in it, and it does what I want to accomplish. Make stuff for the web.
14 years ago I started learning HTML, I wanted to make websites, after that I had delusions thanks to movies like Operation Takedown, Hackers and Antitrust about being a hacker. I learned the basic concepts in C++, C# and Java, but I diden´t know what I wanted to do, so I froze, and stopped learning in those languages.
There is a term PHP is forgiving and it is, some of what is natural to PHP might bite you in the ass if you go on to C# for instance or Java. But you´ve still got a bunch of programming concepts down that you can reuse. If you can find a drive, something you want to accomplish in the language, be it a web or desktop project. Then you will learn. I hope you find this useful. Whatever you decide to do good luck on your journey to becoming a programmer.
[+] [-] dutchrapley|9 years ago|reply
What makes python a good choice is that you don't have to spend too much overhead learning language syntax in order to implement concepts, and you'll easily be able to keep the learning of those two items separate.
Once you have a strong foundation in concepts, you can much more easily pick up a different language. The biggest downfall there is that if you decide to later learn Ruby or JavaScript, you might approach a solution as, "This is how I would do it in Python." Don't fall into that trap. Learn the features each language provides and how to use them.
Since you mentioned games, there's a couple of books on the topic that are free: http://inventwithpython.com/
[+] [-] enkiv2|9 years ago|reply
I don't recommend Python or Javascript because while having a rich set of third party modules is great for actual development, it's a detriment and distraction for beginners. When you're learning the nuts and bolts of programming, it's easy to be misled by how easy some common task is to perform via API call and think you understand it when you haven't really been exposed to it. This becomes a big problem when moving to some other language, where library functions work in a different but equally straightforward way. When it comes to things outside the core standard library, you should really learn to implement them yourself before becoming accustomed to using third party libraries.
Python is a great second language, but the way you write things for a beginner programmer is very different from the way you write things when you're trying to be clever and squeeze a lot of behavior out of a few characters or a few cycles, and python has too much of a mixture: searching for information on how to solve a problem in python will get you equal numbers of people who don't know how a for loop works and people who prefer to do everything by passing lambdas around.
[+] [-] Avshalom|9 years ago|reply
[+] [-] striking|9 years ago|reply
And Lua is not a great first language. If you know how to use it, it's a great language; but its 1-indexing, tiny standard library, inability to distinguish between hashmaps and arrays, confusing "metatables", and lack of external libraries really make it tough for me to recommend as a first lang.
This comes from someone who used LuaJIT often with Love2D to prototype games.
[+] [-] allemagne|9 years ago|reply
Of course learning is complex and the "best" way totally depends on who is learning and their goals.
[+] [-] striking|9 years ago|reply
Pick a project, whether it's a blog or an automated tea brewer or 3D model viewer or something... and then pick a language that suits your needs.
So many beginners fall into this trap of learning just for the sake of learning; I've found that people with projects and with clear goals make the most progress.
If you want to learn a programming language, read any of the other comments. (I agree with Python being first on the list.) But if you want to learn to program, don't fit yourself into a category just yet. Be pragmatic and use whatever's best for the job.
[+] [-] Tomminn|9 years ago|reply
1) To finish the project.
2) To learn a language.
3) To finish the project, but also learn a language.
4) To learn a language, but also finish the project.
My $0.02 is that: 1) tends to lead to short term hacks; 2) and 4) tend to lead to dwindling motivation; 3) is ideal. And if it's your first language, do the project while you read a good generic programming book like 'code complete'.
[+] [-] Sir_Cmpwn|9 years ago|reply
[+] [-] aq3cn|9 years ago|reply
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Eb...
I enjoy those days and happy that I scored A in his class. It has given me confidence for sure.
[+] [-] r2dnb|9 years ago|reply
For 1 year I woke up at 5:00am every saturday and sunday, to use the only computer we had at home before other people were up so I could do every single exercise of the book (there was about 20 per chapter, 10 first trivial, and the rest were small projects of increasing difficulty).
I consider that this experience is what made me the best programming student even at college, and an excellent developer when in the workplace. The lessons I learned from C are still priceless even though I mainly develop in managed and OOP languages today.
This will teach you basics that will never fade, there're certain Google searches you will never make again.
The important thing when you start is to know how a computer works, and how lines of code are interpreted and executed by the computer, as well as how to express and solve real world problems with computer instructions. You don't need to know every detail, but the less magic it feels, the better.
[+] [-] r2dnb|9 years ago|reply
>The important thing when you start is to know how a computer works, and how lines of code are interpreted and executed by the computer, as well as how to express and solve real world problems with computer instructions.
And C is both low-level enough and high-level enough to allow you to do all of this at the same time.
[+] [-] thisisforyou|9 years ago|reply
[+] [-] Lordarminius|9 years ago|reply
Learn Ruby.
Its a beautiful language well worth the effort and it has a HUGE ecosystem behind it. You'll never lack for resources. It is powerful and I found it doable to learn it all on my own.
It will aid in the transition to making dynamic websites because it is used in Rails.
In the early part of my learning I found that the break in compatibility between python 2 and 3 was irritating and confusing to me. Some of the good books were on python 2 and I had been informed the world was moving on to 3. Ruby has major versions (1.9 vs 2) but no break.(I started out by trying to learn python but switched midway to ruby)
The only caveat is if you want to do math heavy stuff or machine learning - python excels at that.
Python is frequently recommended by people with a CS / computational background. I did not have that.
Some people do not approve and I understand. But this was my experience. YMMV.
[+] [-] optimuspaul|9 years ago|reply
[+] [-] FalconNine|9 years ago|reply
[+] [-] cocktailpeanuts|9 years ago|reply
One hipster tells you "You need to learn Esperanto! That's totally cross platform and the most ideal language ever!"
Another hipster tells you "Learn latin! That's the most legit language ever. All other western languages are based on it!"
But all you want to do is live in the US and make some friends. Will you go learn Esperanto or Latin, instead of learning English? Don't listen to these hipsters.
I agree with another guy on this thread saying don't learn a language for the sake of learning it. Because you will probably become a mediocre dabbler that way. Only learn if you want to accomplish something because only by using it in a practical context you become proficient at it. Otherwise you can maybe tell your friends "Hey I know Esperanto!" but does that really matter? There are thousands of other more valuable things you can do with your time than learning Esperanto, especially if you're looking for the "first language to learn"
[+] [-] Ericson2314|9 years ago|reply
[+] [-] Spoom|9 years ago|reply
[+] [-] fitzwatermellow|9 years ago|reply
MIT Scratch: Create shareable stories, games and animations
https://scratch.mit.edu/
Minecraft: Hour of Code
https://code.org/mc
Processing: flexible software sketchbook for learning how to code within the context of the visual arts
https://processing.org/
Google Blocky: the library for building visual programming editors
https://developers.google.com/blockly/
[+] [-] n00b101|9 years ago|reply
[+] [-] newscracker|9 years ago|reply
[+] [-] hgeorgako|9 years ago|reply
It's got everything you need to succeed in the future.
[+] [-] tinalumfoil|9 years ago|reply
It's simple enough, completely ubiquitous and has an incredible amount of online resources. To start, just open developer tools in your favorite browser and type console.log("Hello, World!");. Congratulations! You've just written your first computer "program". Now go try one of the thousands of great javascript tutorials for absolute beginners.
Once you learn the basics you're now able to code anything from a basic website to an embedded machine. Your code will work on any operating system and can be distributed on a platform (the web) that makes it trivial to show off your work to your friends.
But even if you don't choose Javascript, please avoid some people's suggestions of learning systems languages like C, C++, Rust or a paradigm-specific language like Java, C#, Haskell. Yes, these are all fine languages in their own right, but you'll spend a month writing boilerplate you don't understand, which is both confusing and unhelpful. If you have any friends that can program and are willing to help you, following what they know may also be a good idea.
[+] [-] AlexeyBrin|9 years ago|reply
* Android apps ? Learn Java.
* iOS apps ? Learn Swift.
* No idea what you want to do, but strong desire to learn to code ? Learn Python. You could use Python for general purpose programming, small games and so on ...
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] FalconNine|9 years ago|reply
[+] [-] nnq|9 years ago|reply
2. Pic the platform/domain of your first project and use the easiest language that is still a first class citizen of that platform. Easy guide:
[+] [-] reacweb|9 years ago|reply
If you are young, you can also motivate friends, emulation, ...
And for you second language you will probably know better why you want to leave codeskulptor: - full python to have bigger ecosystem - java if you want an IDE (eclipse or netbean) - javascript, html, css if you want to build a "startup" - haskell or scala if language is your interest - C, unix if system interests you - C++ if you are masochist - Excell VBA - ...
[+] [-] Ericson2314|9 years ago|reply
The other advice might allow you to check off marketable skills faster, but these will make you a better programmer.
[+] [-] thesnowdog|9 years ago|reply
[+] [-] webwanderings|9 years ago|reply
Edit: never mind, just read the preface.
[+] [-] arnold_palmur|9 years ago|reply
[+] [-] hedora|9 years ago|reply
First pick a project. Most people pick video games, or light electronics (simple robot, nest replacement, etc). Then, pick something with a strong community and lots of documentation geared at newbies. I strongly recommend a Raspberry Pi (but buy the ~$60 official kit with power supply and SD card -- they have crazy compatibility issues with SD cards and USB chargers). The Pi comes preloaded with beginner-oriented things like PyGame, a computer music language, and software to drive cheap breadboards for electronics projects. There are tons of tutorials online.
Alternatively, maybe download Unity, and watch the YouTube 2D game tutorials (the open source suggesions in other replies are also fine, and most of the language suggestions make sense for some project or another).
By all means, if you have an experienced programmer that is willing to help you, tell him/her about your project idea, and ask for help picking a language and setting up a development environment. A suboptimal language choice will be more than made up for by in-person tech support.
[+] [-] Zalos|9 years ago|reply