this post was submitted on 31 May 2025
357 points (95.9% liked)

Technology

70716 readers
4229 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 71 points 5 days 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.

[–] [email protected] 67 points 4 days 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.

[–] [email protected] 31 points 4 days ago

Most overrated language imho. I actually enjoy Java more.

[–] [email protected] 15 points 4 days ago (2 children)

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

[–] [email protected] 8 points 4 days ago (1 children)

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.

[–] [email protected] 3 points 3 days ago (1 children)

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#.

[–] [email protected] 2 points 3 days ago (1 children)

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.

[–] [email protected] 0 points 3 days ago

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.

[–] [email protected] 3 points 3 days ago (1 children)

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.

[–] [email protected] 1 points 3 days ago

I have the opposite experience, a ton of libraries I use provide optional types, and the handful that don't often have a good reason for it (e.g. numpy). Our projects at work have types almost everywhere, and it's pretty nice to work with.

[–] [email protected] 1 points 3 days ago

Try 'Nim'. It is Pythonic language with static typing.

[–] [email protected] 1 points 4 days ago

I hated something about Python, and avoided it, until encountering Tcl which for me fulfills the same role that Pythons seems for many people, but Tcl is really much more pleasant. IMHO.

[–] [email protected] 1 points 4 days ago (1 children)

use bython, python with braces XD

[–] [email protected] 2 points 4 days ago (1 children)

Hasn't been updated since 2018. Does it still work?

[–] [email protected] 1 points 3 days ago

i honestly don’t know. i’ve read about it here and there but never actually tried it

[–] [email protected] 1 points 4 days ago

Preach it! 🙌⛪

[–] [email protected] 29 points 4 days ago

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)

[–] [email protected] 12 points 4 days 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

[–] [email protected] 9 points 4 days ago

Python isn't really strict enough to be a good learning language and Java has too much accidental complexity that literally matters in no other language.

[–] [email protected] 3 points 4 days 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.

[–] [email protected] 4 points 4 days ago

Help. I've been stuck learning c++ for almost 10 years. :(

[–] [email protected] 2 points 4 days ago

You can't learn C++. Some parts of it maybe.

[–] [email protected] 10 points 4 days ago* (last edited 4 days ago) (2 children)

I learned C++ as my first language and it was a great way to understand the core issues of a programming language — like memory allocation, memory freeing, the difference between memory addresses and the memory contents themselves, threads, system calls, etc. Java obscures these nuances to a degree, but Python is too friendly and makes it hard to understand them at all.

I believe if you learn C++ you can easily learn any other language. After C++, I learned Python, JavaScript, and Java in a few days each without formal instruction. If you learn Python first, you’re probably going to struggle learning those other languages because you haven’t grasped the lower level concepts yet and may never if you’re not in a formal setting that forced you to learn them.

No one disagrees that Python is easier, but if your goal is to get a foundation in programming that allows you to easily pick up other languages, you should start with C++.

[–] [email protected] 3 points 4 days 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.

[–] [email protected] 2 points 4 days ago (1 children)

C++ is a monster. I'd suggest C instead to learn about these basic ideas.

[–] [email protected] 1 points 3 days ago* (last edited 3 days ago)

C++ has classes though and if you start with C and then try to go to other Object-oriented languages you’ll be a little lost. But, by learning C++ first, you’re pretty much learning C at the same time, you just need to avoid using classes.

[–] [email protected] 5 points 4 days 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.

[–] [email protected] 4 points 4 days 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.

[–] [email protected] 6 points 4 days ago (1 children)
[–] [email protected] 9 points 4 days ago (1 children)
[–] [email protected] 4 points 4 days ago* (last edited 4 days ago) (1 children)

That makes more sense in context. Another Gang of Four (that I err, know more deeply for some reason) is(read:was) a political grouping in mid 70s in China.

[–] [email protected] 4 points 4 days ago (1 children)

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

[–] [email protected] 0 points 4 days ago

Not true. They use the same model, executing compiled bytecode. It just feels like directly running a script because Python compiles it to bytecode on the fly, and because it is embarrassingly slow.

[–] MrRazamataz 2 points 4 days ago

In a first year computer science course at uni I can say they teach us Python, Java, and C, all with slightly different use cases.