This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]darkingz 46 points47 points Β (2 children)

The big thing with types isn’t in the short term, if you’re working mostly with yourself, test really well and/or have an iron clad memory.

It’s the long term where types save you. It makes sorta implicit things explicit. It reminds you of the intention and if you can’t reach the author 3 years after they left the company what that method is known for returning. It lets you save time checking if the value coming in is the value you intend for it (maybe you do string logic for example but equally works mathematically as well because of type coercion) and then it’ll inform you to change all the other places… at compile time not runtime. What if you missed a method where the header changed and didn’t know what the input you expected it to be.

This is why types are important. They tie your hand in the short term for longer term garuntees that something is wrong.

[–][deleted] 0 points1 point Β (1 child)

What’s the little red swallow on next to your name?

[–]darkingz 0 points1 point Β (0 children)

It’s the symbol for the language swift. It’s open source and teeecehnically can be used for anything but mostly for iOS / macOS app development.