[ prog / sol / mona ]

prog


How can we make C worse?

3 2023-10-14 15:43

>>2
It seems like maybe the OP was not worded clearly. You are making fun of Lisp for being "better," AKA "worse," than C, which is "worse" and thus "better," but the object of this thread is to make C even "worse" than itself, and thus "better." Do you understand yet?

An example I thought of just now of C worsitude would be how it automatically casts between integers and floats with no way to opt out. This could be taken a step further by automatically casting from a struct to an int/float by taking the value of the first field, or perhaps the first N bytes of the struct.

Passing a pointer to a struct where an int is expected should go even further and try to dereference the pointer (to cast the contents of the struct to an int/float as described above) unless it is null, in which case the result should be zero.

This would introduce all kinds of footguns, which are a "good" thing, in keeping with the essential character of C.

9


VIP:

do not edit these