4
thamara
3y

The first programming language to learn should be:
A: Strongly typed
B: Weak typed
C: Untyped

Comments
  • 4
    Weak typed, but definitely make the effort to learn a strong typed language after.
  • 3
    it doesn't matter, even in weak typed you still need to know what type you are working with

    if you make a mistake on strong typed it wont work

    if you make a mistake on any other it also wont work :)
  • 2
    What's an untyped language?
  • 4
    D. Depends on your aims.
  • 1
    @korrat I would say that a language is untyped if you cannot define types at all like in Javascript
  • 2
    It's a question we discussed recently because our trainees learn php as one of the first languages which I would classify as a weakly typed language (please no php hate here. I'm working in an e commerce environment and php is the goto lang there).
    A few weeks ago our trainees start to learn golang which is strongly typed (after 1 year of experience with php) and it was really hard for them to get everything right and understand the differences between all types (e.g. int32 and int64). I think that it is definitely worth to learn a strongly typed language.
  • 5
    As someone who started with weakly typed and moved into strongly typed, it's a pain in the ass to transition over.

    Going the other way would have trained you into being specific and make the transition easier.

    But at the end of the day, do you. Not everyone e has to learn several languages in their career, but that does t mean you shouldn't.
  • 5
    @bosi I will try not to express my deep hate for php as I am forced into a situation similar to yours. Said so, I’d go with strongly typed as well:
    - it’s easier to manage
    - compiler will give you more practical hints
    - forces you to learn generics
    - interfaces and enums allow for awesome solutions
  • 7
    Strongly typed languages: "Here is a compiler error. You have fucked up at this specific place. Here is a suggested fix."

    Weakly typed languages: "I‘m not doing what you wanted because you fucked up somewhere. I won‘t fail because of this, but your program will just not work correctly. Also, have fun figuring out what you did wrong and where the problem is."

    I think the choice should be obvious.
  • 1
    @Lensflare I used to work with a guy that said weak types force you to read the code you're using instead of blindly using it. It's an opinion I don't understand.
  • 3
    If you are the law and order type of person:
    Go for statically and strongly typed. Java might be axactly what you want.

    If you are a mathematician:
    You want a strongly and statically typed language with a full-featured type system.
    So go for Haskell (lazy evaluation) or OCaml / F# (immediate evaluation).

    If you want to be as close to the CPU as possible:
    Go for one of the non-managed languages, where you have to allocate and deallocate memory yourself. Also learn at least some assembly language first, so you actually know what you are doing.

    If you just want to get shit done:
    Go for Python (dynamically typed with ease of use as primary design goal).
    If Python is too slow, google Cython and use it to write extensions to be used by your Python code.

    If you are new on a job right now and they expect you to improve existing code:
    Learn the language, the existing code is written in.
  • 4
    Strongly typed. The advantage of a weakly typed language is that you don't have to write out the types or express your complex transformations with generics, but when you're learning, thinking about what your function does to the set of all things that could be passed to it is great practice. A programmer worth their salt would do it instinctively anyway, but a strict type system is the only way to teach a newbie this fundamental technique.
  • 2
    Also, any language that isn't 1-error detecting is a bad teaching language. When you're learning a logical system so complex as this, you shouldn't be hunting typos that caused semantic issues; they should always be syntactic errors.
  • 1
    Weakly typed. Because then you'll have to build your own type system when you try to write a nontrivial program, which will be a good learning experience.
  • 2
    @bosi Yeah! I have been thinking a lot about this, as I'm starting to mentor fresh minds on programming. And, although I used to say that learning an untyped, or weak typed language first is the best, I have been questioning this.
    Specially if the person has something specific on mind, that would require strongly typed languages.
    Maybe it's worth the initial rustle of learning more "complex" languages and data types, then having to re-learn that afterwards.
  • 1
    @Oktokolo HAHAHAHA
    That's a great suggestion! I've been researching this to help people who are starting. When I first had to introduce a type to one specific person, this took a look more work than I anticipated. Because of this I'm re-thinking my approach.
    Your suggestions focused on the area are really great. I specially liked the "If you just want to get shit done" hahahaha
    And I didn't know Cython. Definitively will take a look!
  • 1
    D: in demand in the market and pays a high salary
  • 1
    @lbfalvy that is not the advantage of weakly typed languages. All mainstream strongly types languages have automatic type inference now, which solves the problem.

    And this is more related to strict/static typing than to strong typing.

    When it comes to types, anything that has weak/dynamic/unstrict typing is always a disadvantage.
    Those languages may have other advantages, but they are not type related.
  • 3
    @thamara
    Hey, just to be clear about it: "...just want to get shit done" actually means "for the quickest prototyping experience and best glue and scripting language".
    Especially data scientists and admins can profit from it a lot - as for them it can replace the horrible R and shell-scripting languages.

    As you get better at Python, you definitely should do full type annotations after the prototyping stage. Your IDE (most likely the good and gratis PyCharm Community Edition) will then show you some bugs you missed (but not as much of them, as the compilers of statically and strongly typed languages would).

    When writing software, there actually is no way around knowing your types. If you can't reason about them in your code, debugging will prove to be impossible for you in any language.
  • 1
    Start with weak typed to learn algorithms and then move on to a strongly typed
  • 0
    c#.

    All 3 in one.
  • 0
    strongly typed, cause if they start with something like python they don't know how to read parse errors (been there)
  • 0
    I think the most important thing is to consider the goals and needs of the programmer. If they're looking to learn a language for a specific task or industry, such as data science or web development, then a weakly typed language like Python may be sufficient. However, if they're looking to learn a language that will help them develop robust and maintainable code, then a strongly typed language like Java or C# may be a better choice. Additionally, if you're looking for help with writing a capstone project, I recommend checking out this post https://linkedin.com/pulse/... with useful resources. Ultimately, it's up to the individual to decide what their goals are and what type of language will best help them achieve them.
Add Comment