4 ms·
I'm not a big fan of types, either. As a C programmer I use types pretty much only as much as they are required (indicate to the compiler how information is rep
by jstimpfle 8y ago
I'm not a big fan of types, either. As a C programmer I use types pretty much only as much as they are required (indicate to the compiler how information is represented). It's mostly integers of various sizes, plus a few floats and structs and typedefs. Still, types in general convey more information to me than the variable name. For example, it's important to me to group fields in structures by their type to prevent superfluous padding and to get a feel of cleanliness. I tend to think of types as the relevant information that says what actually happens, and of names I tend to think as secondary information that gives an impression why it should happen.
- trixie_ 8y agoint[] UserIDs; If you had a choice of knowing the variable was an int[] or knowing it’s name was UserIDs the latter would be much more useful. This is why new languages are trending towards inferred types. Much easier to write and read (you get your padding taken care of for free as well when you use var) Also ‘what’ is happening is the actual flow and logic of the code. ‘Why’ it is happening is in your comments.
- jstimpfle 8y ago> (you get your padding taken care of for free as well when you use var) How so? Padding is inserted when the layout (order of fields) is bad. There are no language that reorder structures, are there? > Also ‘what’ is happening is the actual flow and logic of the code. ‘Why’ it is happening is in your comments. That's certainly one way to put it. But I was relating to the "show me your tables..." quote's kind of feeling. So, to be more clear, maybe more to the "what is possible" vs "what have the authors currently thought of / implemented".