5 ms·
I am not a professional programmer, I use it as a tool and most of my stuff is written in high level languages, but I have some C in there. Having said that, I
by newswasboring 7y ago
I am not a professional programmer, I use it as a tool and most of my stuff is written in high level languages, but I have some C in there. Having said that, I feel like I am competent enough programmer that if I look at someone's low level code I get the gist of it almost immediately. I looked at this and it in no way was clear to me at all. I don't see the reason to shorten stuff like printf and main. Reducing key strokes adds something?
> if you try to read it like "normal" C and just jump into the middle it's definitely not going to be readable, but if you start at the top and "consume" the definitions first, it becomes surprisingly easy to understand.
I will take your word for this as you might know more than me about programming, but I feel like at least half of my colleagues need to get a gist of what is happening not what exactly is happening to the word. I make simulators for very complex machines. If we went around "climbing the abstraction ladder" every time something needs to be modified or added I think I will personally not get any work done.
- SifJar 7y ago> I don't see the reason to shorten stuff like printf and main. Reducing key strokes adds something? Bugs hide in the extra chars. On a more serious note, there are several (debatable) benefits to brevity (in programming & in general communication); - less code to keep in your head - less chance of stupid typos (e.g. prinft instead of printf) - more "expressive" in that each char has more meaning - to someone who is fluent in the "shorthand", it is quicker to both write & read
- newswasboring 7y agoAll these benefits don't seem like benefits to me. I don't want to learn a new short hand language when I already learned an extra language, English, to learn programming. Also I don't see expressiveness in terms of keystrokes, you don't store bytes in your head, you store tokens. I can have very different words for a character (char, "", etc.) but in my head they take exactly the same amount of space. Are simple typos that annoying? Writing a wrong function call will lead to either a compile time error or a wrong behavior, but latter happens when the function names are not chosen smartly. Also we have IDEs now, they are pretty good at handling typos. I don't understand how it is quicker to remember printf("hello world") than P("hello world").
- uryga 7y ago> I can have very different words for a character (char, "", etc.) but in my head they take exactly the same amount of space. how sure are you? given how little we know about the brain, i'd be cautious with asserting something like that as a fact. while i don't think we store bytes in our head, i'm not certain that the length of a "symbol" doesn't matter either.
- magicalhippo 7y agoMaybe different people do it differently, after all some have photographic memory, I don't. But I certainly don't think about all the letters involved in a variable but rather the concept of the variable, or what that variable represents. Doesn't matter if it's called "numberOfBurgersPerCustomer" or "nb" as such. But in case I forget, "numberOfBurgersPerCustomer" immediately tells me what is going on compared to just "nb". I guess the point is that I don't want to wade in definitions just to get the gist of a code. I want to jump in there, see immediately what's going on and where the problem can be.
- ithkuil 7y agopritnf is an awesome typo! When you're make it your compiler can catch it. "n" spelled instead of "m" is worse