You are viewing a single thread.
View all comments
130 points

Dynamic typing is insane. You have to keep track of the type of absolutely everything, in your head. It’s like the assembly of type systems, except it makes your program slower instead of faster.

permalink
report
reply
26 points

Nothing like trying to make sense of code you come across and all the function parameters have unhelpful names, are not primitive types, and have no type information whatsoever. Then you get to crawl through the entire thing to make sense of it.

permalink
report
parent
reply
4 points
*
Deleted by creator
permalink
report
parent
reply
2 points

You can do typing through the compiler at build time, or you can do typing with guard statements at run time. You always end up doing typing tho

permalink
report
parent
reply
7 points

I’m not sure that’s a hot take outside early uni programmers.

permalink
report
parent
reply
1 point
*

I like it in modern PHP, it’s balanced. As strict or as loose as you need in each context.

Typed function parameters, function returns and object properties.

But otherwise I can make a DateTime object become a string and vice-versa, for example.

permalink
report
parent
reply
1 point

What happens when you coerce a string to a date-and-time but it’s not valid?

Where I’m from (Rust), error handling is very strict and very explicit, and that’s how it should be. It forces you to properly handle everything that can potentially go wrong, instead of just crashing and looking like a fool.

permalink
report
parent
reply
1 point

My point is, you won’t ever try. You’d only use “weak” variables inside the function you’re working on.

It’s explicit when you absolutely need it to be, when the function is being called and you need to know what arguments to pass and what it’ll return

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.5K

    Monthly active users

  • 1.6K

    Posts

  • 26K

    Comments