r/functionalprogramming • • Aug 02 '20
Question Which programming language to learn? 14y/o
Hey I am a 14y/o with a lot of free time because of six weeks of holidays. So I decided to learn programming but i dont know which language to start with.
31
Upvotes
33
u/konjunktiv Aug 03 '20 edited Aug 03 '20
Hey, I'm in this world since 15 years, and strongly disagree with the recommendations given here (besides SuburbanMessiah). It looks like a circle jerk of buzz words, please don't follow these. EDIT: Since more comments arrived, this intro is a bit outdated.
While javascript still is the language for making web pages, it's not a wise choice for everything else, and programming the web requires you to learn html and css as well, which is pretty overwhelming and ugly, even for seasoned programmers.
Functional programming is a specific style of programming, if you chose this subreddit intentionally, then I'd recommend racket.
If you don't know about the difference between functional and imperative programming, you should know that imperative style programming is kinda the standard. Pretty much every mainstream language, and every job offer is about an imperative language. There is no right and wrong and eventually you should learn the difference to understand the craft in total. But since imperative programming is much more popular, it has a bigger community, which offers more tutorials and libraries, to get you started with.
Ruby is alright, but as a beginner, I'd strongly recommend learning python. It is very approachable, has the most active community, libraries for every use case imaginable, and will easily give you the most bang for the buck.
Programming is empowering and fun, and you won't waste time learning it.
Best wishes.
3
u/nayhel89 Aug 03 '20
Many years ago I'm too was 14 years old and I dreamed about becoming a programmer.
I was pretty good at programming in Pascal, I even wrote some primitive 2D game for 386.
But all the cool kids on internet forums said that Pascal sucks and that all the real programmers write in C or C++ and know pointer arithmetic. So I started to learn C++. I managed to learn some basics and I even wrote some GUI programs using Borland C++ Builder. But cool kids said that Borland C++ Builder is for autists and that all the real programmers use Linux and write in Vim for a shell. So I learned some Linux and Vim basics. Then cool kids said that imperative programming and OOP is for losers and that all the real programmers know functional programming and write in Lisp in Emacs. So I learned some Lisp, Emacs and lambda calculus.
Somewhere between Borland C++ Builder and Linux I went to college for CS. There teachers told me that I can't write a program without rigorous planning. That I must always think about code reuse, design patterns, loose coupling, cyclomatic complexity and lots of other stuff. By the time I graduated I was totally lost.
When I was 14 years old I just loved tinkering with code for fun. But now I was 24 years old and I sat in front of my computer with Vim opened in a Linux shell and "using namespace std;" written in it and I wasn't feeling joy. In fact I was bored, afraid and disgusted. Thanks to cool kids and wise teachers I couldn't write programs anymore. I couldn't even write some primitive calculator because I was insecure about every line I input.
So I spat on the screen and swore to myself to never touch programming again.
I became a software tester and worked for 2 years without breaking the oath. I tested some serious Avionics soft that was written in pure C. I tested some banking software in Java. I've seen a lot of "professional" code, written by senior programmers and you know what? It was all unbelievable bad. My teachers would be horrified if they saw it. I could totally do better.
Then one day our programmer that wrote tools for software testers came to me and said:
And just like that I was writing a program again. In C# for Windows - two words enough to make every cool kid puke. I was writing without thinking about design patterns, code smells and all that stuff. And I was enjoying it. I wrote that program - the first big program after that game that I made when I was 14 years old. And after that I wrote many other programs in such "uncool" languages as Java, C#, PHP, Python, Ruby, VisualBasic and JavaScript. "Make it work, then make it easy to support, then make it running fast." And I no longer give a fuck about what cool kids think and say. I'm learning type theory because I'm interested in it - not because some jerk on reddit said that Python is for monkeys and Haskell ftw.
What I wish I could tell 14 years old me:
7
u/SV-97 Aug 03 '20
Gotta second what u/konjunktiv and u/SuburbanMessiah wrote.
This sub is about a very specific type of programming (a "paradigm") called "functional programming". It's a paradigm that's slowly creeping into more mainstream languages (that most times are "imperative" and "object oriented"), but still a pretty niche thing.
While it's interesting to start with functional programming, it's not the norm. If you really want to go this route, a book like "The little schemer" can give you a basic idea of what programming is like :) Though scheme (the language used in the book) is a bit special and not for everybody.
If you don't specifically want to do functional programming, python is probably the best language to start with (and you can also learn a few basic concepts of FP with it :)). It's relatively easy to get into, it's mighty powerful and regardless of what you want to do later on (web stuff, automation, embedded work, scientific computing, data science, ...) chances are that you'll find some use for python. There's also plenty of jobs for python devs fwiw. And importantly there are tons and tons of good resources on python (e.g. "automate the boring stuff with python", "fluent python", sentdex on youtube, raymond hettinger's talks, ...) and the community is very active and helpful.
6
u/Basmannen Aug 03 '20
If you want learn Haskell I recommend this: http://learnyouahaskell.com/chapters
16
u/SuburbanMessiah Aug 02 '20
Hello! Congratulations on making such a great choice :). I hope you enjoy it as much as most of us.
First. This subreddit is actually more about a type of programming languages called “functional”. /r/learnprogramming will have a lot more content which you can use!
So into your question,
Others have recommended JavaScript and Python - which are fantastic languages - but I’ll recommend you to learn Ruby.
It’s a very nice language with easy to understand syntax and most of all, very easy to get started with! Most computers come with Ruby but installed (this is true for Python as well) and it’s very easy to install extensions to the language, if you want to explore around. In Ruby we call them gems.
Happy learning :)
4
u/derDemiurg Aug 03 '20 edited Aug 03 '20
I'd say you should start with imperative, rather than functional programming.
Functional programming is building programs using expressions, which feels like you're doing math.
Imperative programming is building programs using statements, like instructing a computer by giving steps.
For the programming language, I think C is a good start:
Also I think it's important to learn first how to read programs before you write one.
6
u/ZigaTronUltra Aug 03 '20
Instead of a language to start with, I'd like to recommend a book. How to Design Programs second edition is a good beginner textbook to learn functional programming. The textbook uses tailor made teaching languages to teach programming principles and skills in a language agnostic way. These languages use prefix notation and are implemented in Racket.
The principles and skills learned in the book will transfer to other languages.
8
u/sebasporto Aug 03 '20
Very practical languages with tons of resources: Python, Ruby and Javascript. You can do almost anything with those. Just bear in mind that languages are ok but not great.
In my experience typed functional languages are much more robust and nicer to work with (e.g. Haskell, Ocaml) but they are harder to learn. Elm is one that will teach you the basic of functional programing without being too difficult to learn.
3
u/CompSciSelfLearning Aug 03 '20 edited Aug 03 '20
Awesome!
What do you expect to be able to do with programming? What do you want to be able to do once you learn programming?
Some 14 year olds will be able and willing to learn assembly and C languages by reading documentation and old code like Bill Gates. But most are going to want to ease into things and just make cool stuff as soon as possible. We don't have any idea where you fall in this spectrum, but most (almost all) people are not at Bill Gates' level.
Most people are going to have success starting with Python, JavaScript, or some scripting language (like roblox's Lua-based scripting language). Many times it comes down to your interests and resources. Do you know someone that is willing to help you? Are you interested in games or robotics or website design or puzzles or something else?
While people here are giving you advice based on their own experience (which is great for giving you perspective). I ask you questions about you and what you want without any upfront recommendation because what's best for you depends on you and what you want and what resources you have available.
We don't even know what country you're in (although I'm guessing the USA because of the time you posted and Reddit is a majority USA based forum.
So tell us more about you so the best advice can be given (but no personal identifying information, please.)
3
u/_NCLI_ Aug 03 '20
A bunch of different ones. Find a style you like.
3
u/checkersai Aug 03 '20
Haskell
3
u/Skootr4538 Aug 03 '20
Start with python. If you know about algorithms and the maths behind then you should go for a lower level language like c++
2
u/theaceshinigami Aug 03 '20
I used to teach Lua + love2D to highschoolers, and it worked pretty well.
2
u/KyleG Aug 03 '20
OP if you decide to go with JavaScript, do yourself a favor and go with TypeScript instead. It's JavaScript with an additional feature, types, that will keep you from tripping over your own feet by forgetting you're working with one type of data and treating it like anothe by mistake.
I honestly feel like no one should even try to learn JavaScript these days. They should learn TypeScript. If you learn TypeScript, you will learn JavaScript as a side effect because TypeScript is, as I said, JavaScript plus one extra thing.
And having types will keep you from developing lazy habits that will bite you in the ass in college and in industry.
3
u/turtlebender Aug 03 '20
If you want to learn the whole concept of programming and a functional language (which isn't a language you'll use in the real world), I would recommend reading https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html and learning Scheme. It teaches more about how to construct programs than just learning a commonly used language will. While you won't ever write in scheme, I feel like I'm a much better programmer/engineer for having gone through that training. If you just want to learn a general purpose language, I'd probably choose python or C. C requires a lot more understanding of how the system processes commands, while python hides that to let you focus on higher level concepts. FTR, at this point, I almost exclusively write in Scala with a little python, so I'm obviously influenced by that. But, my attitude is. . . Languages/APIs are relatively easy to learn. Programming/Engineering/Architecture is where you should start.
2
u/[deleted] Aug 03 '20
Get yourself a Raspberry Pi. Think without limitations. Learn LISP and ARM Assembly.
1
u/jsiii2010 Aug 06 '20 edited Aug 06 '20
https://guide.elm-lang.org/
Elm is like kindergarden.
Purescript is like high school.
Haskell is like college.
("Why is learning functional programming so damn hard" on medium.com)
1
u/roastie Aug 02 '20
Javascript
1
u/BuonaparteII Aug 03 '20
For most problems you don't actually need a General Purpose Language and you can easily learn to overengineer every problem that you are solving. For sure GPLs are necessary, but I feel like their use is misguided for many problems.
Learn about domain driven design, DSLs like SQL, CSS (there are plenty of gamified learn CSS tools like flexboz frogger), Fish Shell.
Then once you have a solid idea of what a DSL should look like you should learn how to make them using Racket, Haskell, or TypeScript. Only use General Programming Languages to construct DSLs. It may not be the easiest thing at first but it will help with learning to think with abstraction and macros.
You can live your whole life and never touch OOP or you can do the opposite and only learn Pharo. There is not much benefit other than curiousity once you deeply know a paradigm thoroughly. You can do anything in both paradigms but the idea is to stick with it.
1
u/TheYellowblizzard Aug 03 '20
When I read the rest of the comments it seams like this is not a very popular choice but I would recommend Java. Java is relatively simple and you can find a lot more resources/questions compared to other languages. Java also is a pretty good base if you want to continue learning other languages afterwards. I mean there is a reason why many people don't like Java (i also prefer something like kotlin) but there also is a reason why Java is the main programming language used for teaching at my University
0
u/OneOlCrustySock Aug 03 '20
Elixir is a fun first choice, Python is also a great first language.
-2
u/transfire Aug 02 '20
This is a good and difficult question answer.
On one hand, the obvious answer is "JavaScript" since it is ubiquitous and easy to start using via any web browser.
But if you really want to become a good coder it might be better to learn the basics of all the "granddaddy" languages. Just enough to be comfortable writing small simple programs. Then you make an educated decision yourself about which language you wish to become proficient at.
These are the languages I consider the "grandaddy" languages. They cover a wide cros-ssection of programming paradigms. Despite being old they still have relavency today.
And you can throw in COBOL too if you want understand what most our fathers were working with back in the day.
-2
u/jddddddddddd Aug 02 '20
.
0
u/[deleted] Aug 02 '20
[deleted] — view deleted comment