106
submitted 1 week ago* (last edited 1 week ago) by CoderSupreme@programming.dev to c/programming@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] skulbuny@sh.itjust.works -1 points 1 week ago

All static typing means is that types don't change, eg you can't declare a var as a string and later assign a number to it.

[-] JackbyDev@programming.dev 4 points 1 week ago
[-] skulbuny@sh.itjust.works 0 points 1 week ago

Name one statically typed language that doesn't have that property. Name one non statically typed language that has that property.

[-] JackbyDev@programming.dev 1 points 1 week ago

It's much more involved than that. For example, static type systems involve checking that the functions you call accept the types of parameters you're supplying then. It's a necessary part of static typing but alone is not sufficient.

If this code were a valid program in some hypothetical language but only failed at runtime then that would be an example of dynamic typing because the types cannot be verified statically (e.g., at compile time).

var a = 1
a = "a"

But you're right, I don't really know of any languages like that. I could've sworn I heard this called strong typing but I can't easily find a source. And strong/weak typing are a mess of definitions nobody agrees on.

this post was submitted on 05 Oct 2024
106 points (94.9% liked)

Programming

17195 readers
367 users here now

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



founded 1 year ago
MODERATORS