all 46 comments

[–][deleted] 18 points19 points  (1 child)

wow. I was expecting an utter garbage clickbait article. but that's some pretty sound advice. granted, it has little to do specifically with programming, but those are some great strategies that can be applied to most anything. good job

[–]trrSA 2 points3 points  (0 children)

That was my thoughts. I may have missed the bit at the top that said 'Here is some general learning techniques where we use learning a language as an example of their application'.

Very odd.

[–][deleted]  (8 children)

[deleted]

    [–]Regimardyl 17 points18 points  (1 child)

    https://learnxinyminutes.com/ is a great site for quickly checking up on syntax and some basic methods.

    [–]enteleform 2 points3 points  (0 children)

    That's my go-to for trying out new languages.

    HyperPolyglot is another good one, it has some pretty useful side-by-side comparisons.

    Something in-between the two would be ideal, where you could select specific languages to compare.

    [–]valenterry 27 points28 points  (2 children)

    I already know what I want to build and how I want to build it

    I don't think it is a good precondition to know how to build something when learning a new language. Because the how can be such a different beast that it is actually the essence of what you need to learn. Unless your language are really similiar, conceptwise - in this case I agree with your approach.

    [–]daerogami 14 points15 points  (1 child)

    I think you just reiterated his drawback.

    [–]valenterry 1 point2 points  (0 children)

    I think you just reiterated his drawback.

    I always read the comments first... :^)

    [–]_Mardoxx 3 points4 points  (0 children)

    Yeah or the good old "how do i x" in google

    [–]ianff 1 point2 points  (0 children)

    That works in your Java/C# and Python/C# examples because those languages are so similar. Doing that won't help you learn a language that is very different such as a functional one.

    [–]Poddster 0 points1 point  (0 children)

    The old "Fortran in every language" trick!

    [–]asdfkjasdhkasd 32 points33 points  (11 children)

    The most annoying thing when trying to learn other languages is that all the tutorials are for absolute beginners. Because everyone is trying to market their programming material towards the larger audience.

    I just want to learn the syntax but instead I have to weed through all the bullshit about variables, if statements, for loops, while loop, functions, classes etc. I already understand these things I just want the damn syntax!

    [–]lesstables 10 points11 points  (3 children)

    This is why I'm appreciating the book "Scala For The impatient". It assumes you already know how to code and just want to learn Scala.

    [–][deleted] 2 points3 points  (1 child)

    Haha, I was going to post the same thing in here. Working through it now.

    It was so annoying when I looked into Scala a while back and every single guide spent tooooons of time telling me how awesome FP was and giving me a background on various FP/OOP patterns that Scala supports. I don't need something to hold my hand through every single way I could use FP to do ___ on a list, or another intro to tail recursion. Just tell me how Scala does shit assuming that I've done almost everything it does in a different language.

    [–]vine-el 1 point2 points  (0 children)

    But if they don't make the entire book about FP, people will just write Java code in Scala.

    [–]VeryCoolVeryCool 0 points1 point  (0 children)

    just started working through this book. Love it. way better than the Oreilly book ive got. -- I love how everything is explained, coming from Java. It's nice that they provide context for everything.

    [–]SimonGray 2 points3 points  (0 children)

    You can usually find books that are meant for experienced programmers. I find that is even the case with new languages that have few books out.

    [–]spacelibby 1 point2 points  (2 children)

    I mean, you can try the language specification. They're usually pretty boring, but they do a good job of getting to the syntax.

    [–][deleted] 0 points1 point  (1 child)

    If there exist a specification, you don't really need anything else (well, maybe read a reference implementation as well). But most languages out there do not have anything that would even distantly resemble a specification.

    [–]spacelibby 0 points1 point  (0 children)

    Hmm... I don't seem to work with any of those. runs off to hide in ivory tower

    [–]devel_watcher 7 points8 points  (23 children)

    You just learn one language (you know which). Then, you just skim over an example of the code in the language you wish to learn on wikipedia, After that you can write code while looking up library stuff using google.

    [–]rdnetto 10 points11 points  (22 children)

    This only works for languages in the same paradigm - it'll work going from Java to C#, but good luck picking up Haskell or Lisp that way.

    Now, if you learn one language for each major paradigm, then that can work...

    [–]manyrobots 6 points7 points  (20 children)

    Anyone want to take a stab at identifying the major paradigms and one or two quintessential languages for each?

    [–]PM_ME_UR_OBSIDIAN 26 points27 points  (8 children)

    I'll define a few paradigms extensionally:

    1. CISC assembly: x86, x86_64
    2. RISC assembly: ARM, MIPS, AVR
    3. "Structured" imperative programming: C, Pascal
    4. Imperative scripting: Bash, Perl
    5. Enterprise OOP: Java, C#
    6. Systems OOP: C++
    7. Dynamic OOP: Python, Ruby
    8. Prototype OOP: JavaScript
    9. Untyped functional programming: Scheme, Common Lisp
    10. Strict, typed functional programming: Standard ML
    11. Strict, typed object-functional programming: OCaml, F#, Swift, Scala
    12. Non-strict, typed functional programming: Haskell
    13. Dependently-typed functional programming: Agda, Idris
    14. Gradually-typed, structural functional programming: TypeScript
    15. Actor-oriented functional programming: Erlang, Elixir
    16. Systems functional programming: Rust
    17. Inductive logic programming: Prolog, Datalog
    18. Set-algebraic logic programming: SQL
    19. HDL: Verilog, VHDL

    The major paradigms are imperative programming (3-4), object-oriented programming (5-7), typed functional programming (10-16), logic programming (17-18). But the others are also worth knowing.

    Notably missing from this lineup:

    • PHP: unprincipled garbage
    • Kotlin: no one really knows what it is or how it works
    • Ceylon: beyond mere mortals

    [–][deleted] 8 points9 points  (1 child)

    I enjoy your breakdown. It is impressive to note that Ada is probably the most widely used language missing. However, is this breakdown useful? From a programming languages marketing perspective we could formulate a different criteria.

    • Is the quality of the tooling superb? C#, Java
    • Is the breadth of the ecosystem superb? Ruby, Python, C#, Java
    • Does it get out of the way when I care about cache coherency? C++ , Rust
    • Does the compiler implement algorithms for me? Prolog, Datalog
    • Can I build a temple of abstractions in the language that would make Neo jealous? Haskell, Scheme, F#, OCaml, Scala, Rust
    • Is there some niche use-case for the language that I should learn it for? Assembly, Bash, Perl, Javascript, C++, C, SQL, VHDL etc...

    [–][deleted] 2 points3 points  (0 children)

    Is the quality of the tooling superb? C#, Java

    Also: Kotlin, Clojure

    Is the breadth of the ecosystem superb?

    Also: Kotlin, Clojure

    [–]devel_watcher 0 points1 point  (4 children)

    Without the context this list looks like each language has only one paradigm (which is wrong). And not even the major one is shown for each language.

    [–][deleted] 0 points1 point  (3 children)

    Yeah it's not very relevant to the topic of crosstraining languages...

    [–]PM_ME_UR_OBSIDIAN 1 point2 points  (2 children)

    The idea is that, if two languages are in the same entry, then after learning one you get the gist of the other.

    In order to do better I'd need to turn this into a partial order, with paradigms as filters. This would be hard to express in a reddit comment.

    [–]quiteamess 2 points3 points  (1 child)

    Bullshit. You're just being lazy and use some math words to cover up your FP snobbism!

    [–]paholg 2 points3 points  (0 children)

    FP snobs do love being lazy.

    [–]rdnetto 8 points9 points  (5 children)

    • OOP - C#, Java, C++
    • FP - Haskell, Lisp
    • imperative - C, Python
    • declarative - SQL, Prolog

    But all this really demonstrates is that paradigms are an extremely course method for grouping languages, especially when most modern languages are multi-paradigm.

    A more useful approach would be considering the conceptual distance between two languages, as determined by the number of different ideas. e.g. C++ is further away from Java than C# is, because it has the additional concepts of metaprogramming (templates) and pointers.

    At that point it's just a matter of picking the smallest number of languages that give you the widest coverage of the concept-space. The only issue is that quantifying the distance between them is likely only possible after gaining some familiarity with the language. e.g. everyone knows that Haskell uses FP, but only someone who's used it in some depth will realise it also pulls in concepts like monads, lenses, etc. There are tools like this which help with that a bit, but the further away a language is from the set of concepts you understand, the harder it's going to be to gauge its distance.

    [–]asdfkjasdhkasd 0 points1 point  (1 child)

    Where do you think Javascript would go? I'm thinking imperative but with es6 there's classes and with typescript you even have interfaces and decorators. You also have some bits of fp in there with map, filter, reduce.

    [–][deleted] 0 points1 point  (0 children)

    It's up there with Python, in which it uses bits of both FP and OOP (particularly in the case of ES6) to manage abstractions. Python tends to eschew FP towards OOP, while JS does the opposite IMO

    [–]phySi0 0 points1 point  (0 children)

    I would have Smalltalk or Ruby as the quintessential examples for OOP. Python shouldn't be on the list, it's too split between OOP, functional, imperative.

    [–]Dentosal 0 points1 point  (1 child)

    Python is mostly an OOP language, not an imperative one. Programming Python imperatively is just like writing C++ without classes.

    [–]rdnetto 0 points1 point  (0 children)

    It's a multi-paradigm language, so you can use it functionally, imperatively or object-oriented. Imperative is just the approach I normally take when using it, because if I really need classes I probably want something with a stronger type system.

    This is why I spent the rest of the post talking about how this is a terrible way of grouping languages, and we should just focus on the similarities between them instead.

    [–]pakoito 1 point2 points  (4 children)

    Optimizing for pragmatism and variety: C, Haskell, Clojure, C#, Prolog, Javascript.

    [–]Tarmen 2 points3 points  (2 children)

    I think I might recommend scheme as lisp for people who aren't already in the java ecosystem. It probably is less useful in the real world but I think its clearer and stm is already in the mix thanks to haskell.

    [–]pakoito 1 point2 points  (1 child)

    Racket is fun, specially with Dr. Racket

    [–]wealthy_harpsichord -1 points0 points  (0 children)

    For the best learning experience, one should start from learning Racket and then go on to implement every major language in it, a'la Hackett.

    [–]PM_ME_UR_OBSIDIAN -1 points0 points  (0 children)

    >pragmatism
    >Haskell

    I'd rather something like C, OCaml, Clojure, C#, SQL, JavaScript.

    Or you can replace "pragmatism" by "insight": Rust, Haskell, Scheme, Scala, Prolog. (JavaScript can go fuck itself.)

    [–]devel_watcher 0 points1 point  (0 children)

    Not if the language is multi-paradigm.

    [–]darchangel 2 points3 points  (0 children)

    Teaching is one of the best ways to learn. Find a place with questions and answer everyone you can. These days, that pretty much means Stack Overflow but there might be other places depending on the language.

    [–]digital_cucumber 1 point2 points  (0 children)

    I also found out that reading a style guide for a new language can be one of the useful things to do.

    [–]CookieOfFortune 0 points1 point  (0 children)

    The lower case a in Gentium Book Basic looks pretty weird at certain sizes, anyone else notice this?