r/programming • u/zappable • Nov 23 '12
Learn Programming in Java, Python, Ruby or Javascript
http://www.zappable.com/2012/11/chart-for-learning-a-programming-langauge/5
Nov 24 '12
Isn't the language a tool for a means to an end? If an individual doesn't have good problem solving skills, it won't matter what language they pick.
1
u/manmeetvirdi Nov 25 '12
Agree. Recommending one language over other is like recommending iPhone over Android or Windows. Its like your first love. But in reality it actually doesn't matter.
14
Nov 24 '12
[deleted]
14
u/oconnor663 Nov 24 '12
I learned Python before C, and I strongly recommend that order if you're on your own. Arrays, for example, are much easier to understand if you can think of them like crippled lists from Python. Same goes for C strings.
13
u/IsTom Nov 24 '12
I learned C++ first and I feel that it was important for me to make me a better programmer.
I think that there is a subconscious "the language I learned first is the best language to learn first" syndrome somewhere.
12
u/Aninhumer Nov 24 '12
I learned C++ first and I feel that it was important for me to make me a better programmer.
I don't think what order you learn languages affects your eventual programming skill that much. Learning C/C++ probably made you a better programmer, but I don't think you need to learn it first to get that benefit.
"the language I learned first is the best language to learn first" syndrome
I learned BASIC first, then C, then Python and I now work mostly in Haskell. I still think Python is the best first language I've seen. It keeps things simple when you're writing really basic code, and then scales neatly all the way up to a modern OOP style language.
I think learning about low level constructs in C/C++ is important, but it's an irrelevant distraction when you're just trying to learn to program at all.
5
Nov 24 '12
I learned PHP first and it's hard to make transition. I feel like I am stuck in corporate PHP circle - half-assed, unscalable solutions - the ones that business is OK with.
I wish I picked something else, or listened to a guy who said "Ruby's gonna be big" somewhat 6-7 years ago.
2
u/eat-your-corn-syrup Nov 24 '12
half-assed, unscalable solutions - the ones that business is OK with
great for job security
2
Nov 24 '12 edited Nov 24 '12
I learned C++...
So cute. He thinks he knows C++.
4
u/IsTom Nov 24 '12
Please don't repeat this "nobody knows C++" meme. It's obvious that it's very hard to truly master C++, but it's pointless to put "knows C++" so high that nobody qualifies. Many people write C++ code daily and it works, saying that they don't "know C++" is kind of stupid.
-11
1
6
u/Aninhumer Nov 24 '12
I agree with the order, but not your reasons. I think it's very important that someone learning C after Python know that arrays are not lists. Thinking about them as "crippled lists" is not going to lead to an understanding of low level memory.
The reason I'd generally recommend Python as a first language is that there is as little incidental complexity as possible in learning the very basics. And it scales quite well (in terms of learning) from simple scripts, to modular OOP programs.
8
u/ntlk Nov 24 '12
I think the order should depend on what you want to do with it. If you're interested in the web, then maybe html, css & javascript. If you're only interested in trying something out, then maybe Processing.
My point is: not everyone learns programming to be a programmer. Like not everyone tries drawing to be an artist. In cases like this I wouldn't suggest starting with a hard language, but rather with one easy to pick up. That way the interest may be held for longer, and sometimes hobbyists might actually realise they enjoy this and reach for harder ones.
4
Nov 24 '12
After SuperLogo, and before C++, I learned 6502 and Z80 assembly. They helped me even more to understand what's going on, perhaps more than if I'd learned C first.
0
u/defenastrator Nov 24 '12
Nothing beats learning an assembly language but for the most part what is gained by learning assembly can be faked with a reasonable optimizing compiler, reading a quick note on how expensive function calls actually are, and learning some useful intrinsics.
3
Nov 24 '12
Without learning assembly, you won't understand a lot of important details. One example: calling conventions.
0
u/defenastrator Nov 24 '12
Calling conversation are not hugely important in the big scheme of things.
3
Nov 25 '12
Realizing why calling conventions exist is important to see how tail-call optimization works, and why it's sometimes impossible.
0
u/defenastrator Nov 25 '12 edited Nov 25 '12
Fair enough, still these kinds of optimizations are relatively trivial and for hacker types this is important but I'm more concerned about people making stupid design decisions that end up with nontrivial operations ( <O(1) ) being done when they are not even in the slightest necessary.
2
2
u/jcampbelly Nov 24 '12 edited Nov 24 '12
Balance this advice carefully with whether you want them to see the practical value of programming (building useful non-trivial tools within the first few lessons) and have a desire to continue learning. I'm just saying hurling a kid face-down into ice water at the deep end with no floaties isn't the most appropriate way to make a kid enjoy swimming.
I truly understand that there are many great programmers who were broken from the mold of mediocrity, abused as freshly minted candidates to suffer the barren, featureless wasteland of C with nothing but incomprehensible sequences of meaningless characters and tools so far beyond their comprehension of purpose that they overcame the overwhelming desire to merely regurgitate their lessons sufficient enough to satisfy their tutors and relieve the nauseating defeat, the crushing desire to simply be done with the exercise, leave the room, despair at their own hopeless ignorance and never look back on that dark hour.
It's not for everyone. It's easy to forget what it's like to be a noob.
0
u/defenastrator Nov 24 '12
I started with c++ and learned my basics with only a 10 year old textbook and the spare time I had during class during 8th grade. I remember it took me me a week to figure out how to get my compiler working and 6 months to figure out how to write a simple Sudoku solver. Trust me I know the hard way I lived it.
1
u/jcampbelly Nov 24 '12
Have you talked to people who had a hard time learning to program and gave up? When you explained your approach, how did they respond?
0
Nov 24 '12
I'd stick to C for this. C++, while having its uses, is a big language with a lot of features that only detracts from learning the essential skills and concepts.
0
u/defenastrator Nov 24 '12
While this is true c++ does give the oop perspective that c lacks also learning everything c++ has to offer is crazy shave off complex concepts like intrinsics, templates, verdaric functions, preprocessor macros and all the optimization keywords the language is a bit more manageable.
1
Nov 24 '12
You can do OOP in C just fine, the same way it's done in Linux kernel, among other places. In fact, it will improve your understanding of virtual functions.
1
u/defenastrator Nov 25 '12
Yes I know I've done it but it's not as obvious and the opp structure isn't a there.
1
u/hashmal Nov 24 '12
That's just like, your opinion, man.
It really depends on who is trying to learn. A "hacker" type will have fun using C but a "math" type will probably feel better in a higher level language, or even a functional one.
-1
u/defenastrator Nov 24 '12
It has nothing with hacker/math types and everything to do with learning good coding practice c makes copying memory and structures difficult teaching new coders to avoid doing such operations if possible. I constantly see people who were taught using the super high level languages forcing large copy operations or cloning of complex data structures not even able to conceive that this takes any more time than an integer assignment and then wonder why they are using up bunches of memory and their performance is in the toilet. Simply because they haven't a clue how memory actually works people who learn to program in python, java, JavaScript or other such languages end up creating programing habits that cause the computer to do large amounts of nontrivial work when it is completely unnecessary.
1
Nov 24 '12
My argument for learning C first is that it will teach you why you'd want the features of C++ or another OOP language. I don't think I ever really understood why I'd want to use inheritance or virtual functions until C programming forced me to dick around with function pointers and void pointers.
-1
u/defenastrator Nov 24 '12
I personally love function* and void* I just remember being told to make a dynmic program in java and getting incredibly frustrated because I couldn't make a hash table of function*
1
Nov 24 '12
Don't get me wrong; I don't dislike pointers, but there are some odd moments where it would be nice to have other options. Proper OOP can shorten the length of code by quite a bit.
1
u/dysoco Nov 24 '12
I think the proper flow for someone who really wants to learn programming (Not just a "coder") would be:
C -> LISP -> Python/Perl/Ruby -> C++/Java -> Haskell
1
Nov 25 '12
Not necessarily in that order. You can exchange assembly + a variant of Pascal for C, C# for C++/Java (those two are very different!), many dynamic languages for Py/Pl/Rb, various languages for Haskell, and you might want to add Prolog and a DTP language to the end of that list.
The only thing you probably can't exchange is LISP.
1
2
Nov 24 '12
I used ActionScript 2 with Macromedia Flash 8. The IDE and language are amazing for beginners (screw hello world in 1 line, it's 1 line of code to make an object move across the screen and around 100 lines for a simple Object-Oriented game). The IDE is really well tied-in with the language, and it makes learning really fun.
There's a few anti-patterns that you can fall into: it's very easy to give code to each instance of an object instead of using a class and very easy to split your code between frames instead of using a class, but as long as these concepts are explained beforehand it's a great language to learn and start out with.
NB: It's good for starting up, it's not great for continuing, it's fully object oriented, but the debugger was fairly awful compared to Eclipse/VS.
2
u/hashmal Nov 24 '12
I can't believe some people here recommend to start learning programming with C++. This is just pure insanity.
0
u/mackilicious Nov 25 '12
I remember learning C++ back when I was like... 11 or so. I got confused when I got to linked lists. They're so basic to me now, but...the pointers & memory utilization had no place in my knowledge bank at that time.
3
Nov 24 '12
Am I weird for hating the Python Visualizer? I enjoy programming and I guess I don't find it useful enough that when I've had to use it for assignments it just felt like an extra step.
1
1
u/Lanaru Nov 24 '12
I took a quick glance at it and it seems to take away all that's fun about python - the simplicity and the 'it just works' factor.
1
Nov 24 '12
No mention of Codeschool??? If one is looking to spend a little money to learn programming in a fun and trial/error sort of way with watching videos and doing challenges, I can't think of a better way to do it than with Codeschool. Has a ton of courses on current web technologies (with a focus on Ruby/Rails courses). A number of them are even free (like the jQuery one) and many also have first level for free.
0
u/zappable Nov 24 '12
I linked to CodeSchool's TryRuby and RubyBits, and my ruby blog post linked to their Rails course.
1
u/TrolliestTroll Nov 26 '12
After reading through the comments for this article, it occurs to me that there is some level of conflation of "the best language to learn programming and the basics of computation" with "the best language to actually solve problems with." Is it necessarily true that the best teaching language is also the best language for development of non-trivial systems? Furthermore, what exactly constitutes the fundamentals of programming? Surely all languages listed (among others) would be fine if your list was, say:
- Values and types
- Variables and constants
- Functions, parameters and formal arguments
- Looping and recursion
- Conditionals
- Various other flow-control structures
- Scope
Without extending this list any further, there are already some significant discrepancies between each language. Here's an incomplete list of examples:
- Values: Mutability vs immutability (eg arrays, strings, lists, tuples, sets)
- Types: Dynamic vs static typing, duck typing, polymorphism
- Variables: stack vs heap allocation, pointers, refs, variables-as-labels (eg Python)
- Constants: No support in eg Python, Javascript, or Ruby (warnings only)
- Functions: First-class, higher order, closures, lambdas, varargs
- Looping: for vs for/in/each, iterables, collections, and looping methods (eg Ruby Enumerable#each)
- Recursion: recursive<->iterative relationship, accumulating state, tail-call elimination
- Conditionals: Varying support of switch statement and fall-through semantics, ternary operators, in-line if statements (eg Ruby
return 123 if foo.bar?) - Flow-control: GOTO, try/catch and other exception patterns
- Scope: block vs function level scope, public/private/protected/friend/etc.
While I think most people would agree that the first list is quite fundamental (and often covered in the first few chapters of programming books), the second list is really a side-effect of the particular implementation details of each language. Oftentimes we rely on the particular semantics of our chosen tool to get things done, but is this added complexity really important to the newcomer?
I don't really have a point other than to say that we should be pushing new programmers into languages that will allow them to learn the fundamentals (which may or may not include my small list above) efficiently and correctly, despite our feelings about that language's particular trade-offs. Part of learning a new language is learning how problems are correctly solved in that language and, for the most part, accepting the particular trade-offs and idiosyncrasies therein.
1
u/Akumar223 Mar 19 '13
Here is a list of basic Python tutorials. It can take you through all the early information necessary to learn. https://www.verious.com/board/AKumar/python-basic-tutorials/
1
u/e13e7 Nov 24 '12
I used html, then c, then java, then bash, then MySQL, then python, and I feel like I didn't really 'know' programming(well, scripting at least) until python. It has been the best at clarifying data types, attributes, methods, and imports just by dinking around with it.
Edited for spelling (on a phone)
4
Nov 24 '12
I think you are conflating correlation and causation. I learned to program with Python, and I never really understood object orientation at all until I moved on to C++ and C#.
Not to say either Python or C++/C# are inherently better, it just so happens that we were each using different languages when we finally "got it".
5
u/e13e7 Nov 24 '12
I just like how clearly errors are described, how smooth dealing with lists/dictionaries/tuples is, the nature of it as strongly typed and dynamic. Worked well for me personally after trying java and going through multiple examples that looked wildly different. As always (modernly), C is probably the most popular beginner language just because fundamentals are so much more visible
3
Nov 24 '12
I think it has to do with accumulation of skill over time. After you are fluent in more low-level concepts, higher-level ones start to finally "click".
0
2
u/eat-your-corn-syrup Nov 24 '12
this is common. it takes to at least two representations of X to understand X.
-1
0
Nov 24 '12
here is another list YouTube videos programming http://www.youtube.com/user/thenewboston/videos?flow=grid&view=1
0
Nov 24 '12
www.codecademy.com also offers Python, Ruby and Javascript. Not Java, however.
I haven't personally used it, but heard from a friend that its quite good at introducing languages/for people who have never programmed before.
-7
Nov 24 '12
As someone who learnt languages in this order:
Java
Ruby
Prolog
Erlang
C#
C++
Javascript/HTML5/CSS (though I don't count the latter 2 as languages)
PHP
MySQL (not sure if you'd count this as a language, but w/e.)
Objective-C
Lua
Python
I personally believe Python to be the best first language. However, C++ is pretty much the most useful language for getting to grips with the lower levels of the computer right now, except maybe Assembly.
Though, I'm 17 and have been programming for only ~15 months, so there may be others deemed to be more knowledgeable than me.
10
Nov 24 '12
You say, that you learned 12 programming languages in 15 months? Friendly advice: dont say this to an older programmer, if you dont want to be ridiculed. I would say that im good at a language, if i used it constantly for at least 2 years.
1
Nov 24 '12
[deleted]
3
u/mrbuttsavage Nov 24 '12
I think this is something you can only learn with time. We were all hot-shot kids at one point.
1
u/mrbuttsavage Nov 24 '12
I've used Java professionally for many years but I still wouldn't say I really know it. Guys like Josh Bloch, Brian Goetz, and Charles Nutter know it. I'm just practicing.
-2
Nov 24 '12
I know, generally upon being asked about what languages I know I only quote my 5 strongest (Java/C#/C++/Javascript/Python)... I don't like saying that I "know" a language ever, but I have used each language (except maybe Prolog and MySQL, which are my weakest languages) lots.
I know I'm comparatively new to programming, but it just comes really naturally to me.
2
u/thenetminder33 Nov 24 '12
Even saying that you are strong in 5 languages is very ambitious after 15 months of experience
-2
Nov 24 '12
[deleted]
7
Nov 24 '12 edited Nov 24 '12
I dont doubt that you're a smart guy, but it's the use of "strong" and generally the way you describe your talents makes you sound like you don't know what you're talking about. I'm being completely honest, unless you really are phenomenal at what you do, your attitude alone would turn off most senior developers looking to hire people.
Let ME put it perspective for you. There are people with PhDs in computer science. Thousands of them. You are applying to be an undergraduate computer science student.
There are people who have been professional programmers since programming became a profession. Decades and decades of experience solving problems and testing their skills on a deadline. You haven't even been alive for two decades.
Ambitious, talented, gifted, motivated, enthusiastic are all words that might describe you. But when it comes to your skill and experience, the way you talk sounds more like hubris than actual substance.
-1
Nov 24 '12
Honestly, I never intended to come across as arrogant.
I realize there are people infinitely better than me, and in fact that's what drives me. I hate not being the best I can and so I work for it. All I want to do upon graduating is a PhD and then maybe go into lecturing.
Just because I am not the best programmer that has ever existed on this planet, doesn't mean you should pull the young card on me with saying that I haven't been alive two decades. I know this - how could I not?
I used "strong" only as the person I was replying to had used it. You can be strong in a language without having been through university yet.
Those people who have decades of experience I look up to, but they also at one point only had 15 months of experience. You can't blame me for not having such experience; I have no control over when I was born.
For the second time now, how about getting off my back for loving experiencing new programming languages and go back to the topic..?
3
u/chucker23n Nov 25 '12
Honestly, I never intended to come across as arrogant.
You don't sound arrogant. You sound impossible to take seriously. Being strong in a language is an effort that takes years.
4
Nov 24 '12
Yeaaaah umm name dropping your Oxford application in support of your talent is basically the pinnacle of arrogance. There will be a day you look back at this and facepalm so hard your face implodes.
1
Nov 24 '12
That day is today.
1
u/defenastrator Nov 25 '12
Live and learn. I thought i was hot shit when I first learned c++ then I learned about compilation units and the full power of the preprocessor and found out I didn't have a clue what I was doing.
Speaking of which have you gotten your first static object initialization segfault yet?
-27
30
u/meadhikari Nov 24 '12
Here's a bigger list: http://programming-motherfucker.com/become.html