←back to thread

The provenance memory model for C

(gustedt.wordpress.com)
224 points HexDecOctBin | 5 comments | | HN request time: 0.69s | source
Show context
smcameron ◴[] No.44424882[source]
Ugh. Are unicode variable names allowed in C now? That's horrific.
replies(5): >>44424985 #>>44425020 #>>44425869 #>>44426140 #>>44426336 #
mananaysiempre ◴[] No.44424985[source]
“Now” as in since C99, twenty-five years ago, yes. (It seemed like a good idea at the time.)
replies(2): >>44425080 #>>44425758 #
1. kevincox ◴[] No.44425758[source]
Being able to program in languages that don't fit into ASCII is a good idea. Using one-character variable names is a bad idea.
replies(2): >>44425908 #>>44428235 #
2. adrianN ◴[] No.44425908[source]
Using variable names that are different but render (almost) the same can be a bad idea.
3. RossBencina ◴[] No.44428235[source]
Mathematics is a language that doesn't fit into ASCII and commonly uses one-character variable names. If you are implementing a documented mathematical algorithm (i.e. one with a description in a paper or book) then sticking to the notation of the paper (i.e. using one character variable names) makes sense to me.
replies(2): >>44428392 #>>44428481 #
4. mananaysiempre ◴[] No.44428392[source]
Unfortunately, many of the things of this nature that you’ll want to implement use indices, which are inevitably going to start at 1. So you’ll still got plenty of hours of unpleasant debugging ahead of you, and a non-obvious correspondence to the original paper at the end of it.
5. kevincox ◴[] No.44428481[source]
I find math far easier to read when the authors use proper names for variables. But I understand that it isn't the idiomatic style and agree that it can be useful to match the paper when re-implementing an algorithm.