Question

This question is for experiences programmers. Do you have a set process that you follow when approaching a new language that you want to learn?

I wish I had an efficient method or a to-do list that I could follow to make the learning process more streamlined.

Do you prefer learning alone or with a buddy? Is there any place where you can easily get the grammars for the new languages? Do you make a specific sort of cheat sheet where you quickly write down the control structures, and important keywords?

Are there any specific things that you memorize?

What sort of libraries do you make sure to learn? How do you know that you've learned something and at what point do you feel as if you know the language?

Whenever I pick up a new language, I mostly waste time fumbling through books which are half for beginners and never for experienced developers.

Was it helpful?

Solution

Personally I find that I need a substantial project to implement in a new interesting language. You can read a book at become familiar with syntax, and be exposed to interesting features, but a nothing gets you thinking in a new language like a project.

OTHER TIPS

I don't set out to merely learn a new language. I find a project that requires (or would be a good fit for) the new language and start coding.

The resources depend on the language, but either an online tutorial or a good "learning the language" book is very helpful. I don't try to memorize anything, just keep the documentation close and search for the solution to each piece of code I need to write. Algorithms don't change much between languages, so most of the time it's just a matter of looking up the syntax for the particular structure I need.

Also, I may never KNOW everything about a language. I just keep consulting the documentation on things that I need and eventually I don't need to look most things up anymore. However, even on the language that I've worked with every day for years, there are still things I have to look up on occasion because I've never used them before.

It's a mad dash.

First I have to make sure I know how to do things the "old" way, meaning the way I'm used to in other languages.

But I don't want to fall into the trap of (for example) writing my Python code as if it were C code, so I read up on all the stuff the new language gives me that more familiar languages don't.

Here's what I normally do:

  • Read to get familiar with the new language syntax
  • Find an existing open source project I am interested in
  • Port it to the new language
  • Repeat as necessary

I read a good manual, and compare it to a language I already know. So i just learn the diff between them.

a very popular way to learn a new language is to create a simple project for yourself and implement it in your new target language.

I would create something I've already done before, so I can focus on the language itself, and not the design or the subject of the project.
I would also put some time in searching for (this place is a good starter ;-) and reading a good book about the language.

For the rest it's practice practice practice (like about everything out there isn't it).

The basics of programming require very few constructs - A good programmer will be able to write great code with only a small fraction of the available language features.

A book is often a good way to learn the basics of a new language and get an overview so you know what areas of that language could help you when you need them later, but then the best approach is to just write programs to do the things you need to do, and learn what you need to know as you go.

The great thing about this is that you know where to look when you want to do something new, and you do things well, but you don't bother to learn loads of junk that you'll never actually use.

I would read some FAQ/book about the big concepts of the langage.

Then i would try to find comparisons between the langages I already know so as to avoid applying in langage X a concept used in langage Y. Each langage as its way to get things done, you shouldn't mix them even if they look similar at first glance.

This would be the first steps.

On a longer basis, I would follow the section dedicated to this langage on a forum or SO. I would read the answers to many threads over the days, so as to grab advanced concepts, tips and most commonly used librairies. This would also helps me to notice when I'm starting to get fluent in the langage : when you start being able to answer to many random questions on a specific langage that means you're getting quite good at it.

I usually start off with a few basic programs. Typically samples from the book I'm reading and then modifying them slightly to be more complex and round off the rough edges.

After that, I head over to Project Euler and start rattling off problems. It's a great way to get comfortable with a new language and the basic constructs.

I usually install the runtime. Then I run some common commands from the command line at the compiler or interpreter. I look online for forums to find out what other think about it. Then I investigate how to work with external parameters such as psvm(String[] args) in java. I guess to sum it up, I am always interested in the languages power on the command line due to my sys admin background in solaris.

I assume you learn a new high-level programming language which supports OOP. Examples of such langages are: Java, Typescript, Perl, C#, C++ etc. You are an experienced programmer as well, so you already know some other object-oriented langage.

I wish I had an efficient method or a to-do list that I could follow to make the learning process more streamlined.

You should create a project covering the following topics.

Syntax

  • comments
  • namespaces
  • statements
    • if else
    • loops
    • switch case
  • functions and classes
  • include / import / use

Class-specific:

  • static
  • const/final
  • override methods
  • create interface and implement
  • inherit
  • nested class

Data structures

  • array
  • collections:
    • list
    • map, queue, stack
    • operations on them:
      • deletion
      • insertion
      • search
      • iteration
  • strings

You can manipulate with strings in many ways:

  • replace
  • match
  • join
  • split

Operators

Assignment operator = is tricky sometimes. You have to check, if it creates shallow or deep copy.

How does == works? Maybe there is an alternative like obj.equals(other)?

Concatenation: s1 . s2 or s1 + s2?

Can you overload operators?

Programming techniques

  • exception handling
  • lambdas
  • interaction with user (read, write)
  • unit tests

What are simple types like int, bool, char? Are they immutable? If this is weakly typed language, there might be difference between scalars, array and hash tables.

Functions.

Is a parameter passed by value or reference?

Miscellaneous

  • regex
  • threads
  • data formats:
    • JSON
    • XML
  • files and streams
  • HTTP methods
  • dates and hours

    You should get familiar with popular libraries like Math, algorithm.

If you do not have a chance to join a project and learn it and apply it from scratch. You can get help from open online courses. "Edx.org" is a great platform for instance. There are plenty of courses about computer science and software development. i.e. Here is a course for Data Structures and Software Design.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top