4 ms·
Yes, exactly. When I hear people brag about how functional languages don't allow side effects, I always wonder, what's to stop you from just writing your progra
by tvural 10y ago
Yes, exactly. When I hear people brag about how functional languages don't allow side effects, I always wonder, what's to stop you from just writing your program without side effects in an imperative language? And occasionally it will be more natural for your program to have side effects than not.
I have a similar gripe with type systems. Types are restrictive metadata - they never reduce a program's complexity, and sometimes they increase it.
- Jtsummers 10y agoTypes absolutely do make programs easier. I work in embedded systems. Our primary programs operate on messages, binary data. Type less like you suggest would mean always grabbing contents by way of offsets. Then never knowing if they are ints, doubles or what. Even the basic type infrastructure of C is useful here. We map the blobs to structs. We can then grab the contents and manipulate them as ints, doubles, or strings. Removing types would make this a horrific task.
- nightski 10y agoThey aren't a restrictive metadata, they are a verifiable language for communicating intent.