|
|
|
|
|
by norir
842 days ago
|
|
C is horrible for exploratory programming but is acceptable if you already know how to solve the problem. If one uses enums for errors, then the compiler can check for you that all edge cases are handled. You can log an error and exit(1) for unhandled cases during development which makes it feasible to turn on -Werror but not have to implement every edge case up front. You can do the same thing with tagged unions to implement a poor man's sum types. It is significantly more verbose than in a language that has syntactic support for this, but you get similar compile time safety guarantees. |
|
Completely opposite experience here. C is great for explorative coding because it's just structs and functions.
There's no agonizing about whether some piece of code should go here or better there, wrapped in this or that concept or high level abstraction.
Instead you start with an empty screen and incrementally build your ideas from small building blocks, much like in Lisp or Forth.