3 ms·
I love C with all my heart, but minimal in the syntactic sugar department it ain't. Other languages of its day like Fortran or Pascal would not let you write an
by KKKKkkkk1 10y ago
I love C with all my heart, but minimal in the syntactic sugar department it ain't. Other languages of its day like Fortran or Pascal would not let you write an atrocity like
while (*++targ = *++src)
;
- Nursie 10y agoWell, that's up to you whether you write that way or not. Kinda like with everything else related to C!
- imagist 10y ago> Well, that's up to you whether you write that way or not. The problem is, it's also up to the programmers who worked on my codebase before I did. I would never write that atrocity, but I've come across that atrocity quite a few times in code I needed to modify.
- Nursie 10y agoI'll.never claim there aren't a ton of terrible coders out there. They exist in all languages, but perhapd C gives them the tools to be really, extra awful..
- imagist 10y agoIt also doesn't give you very good tools for refactoring to clean up the awfulness. Unit testing tools and the type system in C are such that it's fairly difficult to ensure that your refactor hasn't broken anything.
- jstimpfle 10y agoperfectly readable :) (but usually generates compiler warning without an additional set of parentheses)
- jjaredsimpson 10y agoNot really an atrocity. More like an idiom.
- 3chelon 10y agoClear and concise, and a thing of beauty! Unless the data is user-generated, in which case you might have a security issue on your hands... :)