you are viewing a single comment's thread
view the rest of the comments
[–] [S] 73 points 1 year ago (7 children)

Java was also my first introduction to programming as it was included in Computer Science in final year of school (at college, we did the trusty C).

I think they have replaced Java with Python now in schools because of the latter's popularity and also because many would argue, Python is slightly easier to learn than Java.

  • source
  • hideshow 14 child comments
  • [–] 67 points 1 year ago (6 children)

    Python is easy, but it can also be infuriating. Every time I use it, I'm reminded how much I loathe the use of whitespace to define blocks, and I really miss the straightforward type annotations of strong, non-dynamically typed languages.

  • source
  • parent
  • hideshow 12 child comments
  • [–] 15 points 1 year ago (2 children)

    You can annotate types in Python, and it's actually pretty nice when used with Pyright/Pylance.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 8 points 1 year ago (1 child)

    Oh, I know you can, but it's optional and the syntax is kind of weird. I prefer languages that are strongly typed from the ground up and enforce it.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 1 year ago (1 child)

    Python is strongly typed, it's just not statically typed. Python with consistent type hinting is extremely similar to a statically typed language like C#.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago (1 child)

    I would argue that without consistent and enforced type hinting, dynamically typed languages offer very little benefit from type-checking at runtime. And with consistent, enforced type hinting, they might as well be considered actual statically typed languages.

    Don't get me wrong, that's a good thing. Properly configured Python development environments basically give you both, even if I'm not a fan of the syntax.

  • source
  • parent
  • hideshow 2 child comments
  • What's wrong with the syntax? It's just var_name: Type = value, it's very similar to Go or Rust. Things get a little wonky with generics (list[Type] or dict[Type]), but it's still similar to other languages.

    One nice thing about it being runtime checked is you can accept union types, def func(param: int | float), which isn't very common in statically typed languages.

  • source
  • parent
  • [–] 3 points 1 year ago (1 child)

    But nobody else does, and I need it more on code I am consuming than producing. In fact, many functions rely on being able to send various types for different behavior. Dynamic programming is crazy to me. It's like guessing. I don't know what type your code is accepting and I have to guess based on the name of read your code directly.

  • source
  • parent
  • hideshow 2 child comments
  • I don’t think weakly- or dynamically-typed languages are a good thing to base computer science curriculum around. Yes, it’s “easier”. But you will genuinely have a FAR better understanding the language and the logic you’re writing in it if you work in the scope of strong and static typing - or, at least have linters that force you to (e.g. mypy for Python)

  • source
  • parent
  • [–] 12 points 1 year ago (2 children)

    The argument I agree with is that Python is the best language to learn if it's your only language, and Java is the best first language if you're going to learn others. The syntax from Java is shared across so many other languages and it forces you to learn about things like objects and types. You could make an argument for C or C++ but Java's handholding is more beginner friendly imo

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 1 year ago (2 children)

    First learn C, then learn C++, then learn Java. In that order, each will make you appreciate what the previous one lacks. From there, you should pretty much be able to learn anything.

  • source
  • parent
  • hideshow 4 child comments
  • [+] 10 points 1 year ago* (last edited 1 year ago) (2 children)
  • [–] 3 points 1 year ago

    Imo people should start with C first since it is a lot simpler than C++ while still providing a lot of what you mentioned. C++ adds a lot of things like name mangling, templates, L & R value references that can quickly make things a bit more daunting for beginners.

    I also generally find error messages for C a lot more parsable for beginners than C++ ones.

  • source
  • parent
  • [–] 5 points 1 year ago (2 children)

    They did, but it makes me sad. Python is becoming the next JavaScript because of its ease of use.

    The Java guys simply don't understand how to code without the gang of 4 crutch to lean on.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 6 points 1 year ago (1 child)
  • [–] 9 points 1 year ago (1 child)
  • [–] 4 points 1 year ago

    Some of the GoF patterns over-emphasise inheritance, but by-and-large, you don't build large systems without either using or rediscovering software patterns, whether they're OO, FP, or what-have-you.

  • source
  • parent
  • [–] 4 points 1 year ago (1 child)

    Python is interpreted where Java is compiled. They aren’t going to be able to be used in the same cases all the time.

  • source
  • parent
  • hideshow 2 child comments