this post was submitted on 10 Nov 2024
48 points (90.0% liked)

Technology

60386 readers
3791 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 content.
  3. Be excellent to each another!
  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, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 2 years ago
MODERATORS
48
The Pythonic Emptiness (blog.codingconfessions.com)
submitted 2 months ago by abhi9u to c/technology
you are viewing a single comment's thread
view the rest of the comments
[โ€“] thebestaquaman 4 points 2 months ago (1 children)

I have to be honest in that, while I think duck typing should be embraced, I have a hard time seeing how people are actually able to deal with large-scale pure Python projects, just because of the dynamic typing. To me, it makes reading code so much more difficult when I can't just look at a function and immediately see the types involved.

Because of this, I also have a small hangup with examples in some C++ libraries that use auto. Like sure, I'm happy to use auto when writing code, but when reading an example I would very much like to immediately be able to know what the return type of a function is. In general, I think the use of auto should be restricted to cases where it increases readability, and not used as a lazy way out of writing out the types, which I think is one of the benefits of C++ vs. Python in large projects.

[โ€“] [email protected] 3 points 2 months ago

Generally speaking, I like duck typing for function inputs, but not as much for function outputs (unless the functions are pure mathematics).