6 ms·
Title and content dont really match do they? The article itself is basically this guys journey with C and the steps he takes to get something other languages no
by burnished 4y ago
Title and content dont really match do they? The article itself is basically this guys journey with C and the steps he takes to get something other languages now build in - ironically I think it was a stronger argument to write everything in Rust than any 'rust evangelism strike force' has put together.
Neat article, always interesting to take a peak at some ones highly idiosyncratic process.
- raverbashing 4y agoYeah true. "Oh he only finds C fun to work with" sorry, that sounds like maybe Stockholm Syndrome or maybe unchecked perfectionism > "The next reason is that during my time with C, I have developed a custom software stack designed around memory safety." Oh ok then. Again goes to show how C is deficient in some areas I get something being fun, but C ends up needing to worry about a lot of details where you could be actually improving the code in other languages
- simonh 4y agoFinding things fun = Stockholm syndrome? I don't think so. it just means there are other aspects of the language that make up for the deficiencies. Also if he already has a framework that solves that problem for him, then it's not deficient in that areas, for him, right?
- throwbadubadu 4y agoYes, like enjoying wood work == stockholm syndrome, why not go to Ikea?? Also to gp, title perfectly matches, pointing out why he believes in memory safety when using C, everytime also pointing out the flaws with his thinking, and why this only applies to him in his completely owned projects. Not sure what's wrong with the critics here.
- t43562 4y agoC is fun - there's elegance in writing good C code and the mental model you need to understand it is much simpler than the higher level languages. It's also fun to write data-structures yourself instead of being a mere user all the time. In C you can tell yourself that your take on how to do datastructures is worthwhile and unique (might be a slight stretch) but in other languages almost anything you can do is redundant.
- raverbashing 4y ago> C code and the mental model you need to understand it is much simpler than the higher level languages. Only if you manage simple buffers and do shallow processing with them String management, network connections, data structures, this is simpler literally everywhere else > It's also fun to write data-structures yourself instead True, but it's more fun in C++, warts and all. And not when time is money
- pclmulqdq 4y agoI think people use the word "simple" to mean different things. You mean "easy to do," while other people mean "easy to understand what's happening." C lovers love the second definition of simple.
- pjmlp 4y agoOnly if they happen to know by heart the 200 use cases of UB documented in the ISO C standard.
- Arch-TK 4y agoYou only need to know, by heart, _a_ list (even a subset) of the documented behaviour of C, you can simply refer to the standard whenever you happen upon something not in your list of known good (or known undefined) behaviour. It's entirely possible to, assuming you can keep this up honestly, write perfectly well defined C without hitting undefined behaviour. It is equivalent to writing brainfuck in a language which is a strict superset of brainfuck. As long as you pick a turing complete subset of C to know the semantics of off by heart, you can write perfectly safe C (the only obstacle being human fallibility). The idea that you need to learn all the documented undefined behaviours in C is a myth and is, in fact, fundamentally wrong on the basis that the documented undefined behaviours in the C standard are only an infinitesimal subset of the set of undefined behaviours in C given that anything not explicitly defined by the C standard is automatically undefined.
- 4y ago
- simplotek 4y ago> The article itself is basically this guys journey with C and the steps he takes to get something other languages now build in (...) Not really. The author describes he put together a framework for C that implements memory safety features. Isn't it intellectually dishonest to criticize the adoption of libraries that provide features that other languages may or may not have built in? What's the end goal exactly? Use safety features to write safer software, or attack anyone that hasn't mindlessly jumped onto a particular bandwagon?
- alexvoda 4y agoThe point in Rust and C# and Java and others is that memory safety is either mandatory or opt-out instead of opt-in. This means you have some guarantees about the whole ecosystem. Of course you can augment a language with libraries. But you are one developer and everyone else will make different choices.
- simplotek 4y ago> This means you have some guarantees about the whole ecosystem. Sure, you are free to make this sort of claims. But they are besides the point, aren't they? The cliche being discussed here is C's hypothetical ties with memory safety issues, and here we are commenting on a discussion on how someone writes C using a framework focused on memory safety and thus providing "some guarantees" about their whole ecosystem. Yet, we're still seeing comments mindlessly parotting myths in spite of the facts that are being dangled right in front of their nose.
- burnished 4y agoIm surprised you read that as criticism, it was intended to be a frank and neutral description.
- qwery 4y agoThe title is "Why I use C..." so the article being an account of the guy's journey using C seems highly appropriate.
- simplotek 4y ago> so the article being an account of the guy's journey using C seems highly appropriate. More importantly, it goes against the cargo cult narrative that the choice of programming language is the one and only factor determining memory safety, and consequently any use of languages such as C automatically leads to security issues. It's not a coincidence that we have people in this discussion coping with that concept by spinning the use of frameworks focused on memory safety in C applications as somehow representing writing code in an entirely different programming language.
- VBprogrammer 4y agoEven the author mentions that he intends to rewrite everything he ever writes in some memory safe language he's building. Despite the authors borderline obsessive efforts to write memory safe C code, it's interesting to note that his implementation of "bc" prominently contains a file documenting memory issues in previous versions. If that's what borderline obsessive gets you, how are us normies who are only programming to pay the bills, who have to work with other people who also just want to finish what they are doing or interact with blobs of code written by other people with less exacting standards supposed to write memory safe code?
- simplotek 4y ago> Even the author mentions that he intends to rewrite everything he ever writes in some memory safe language he's building. It's a framework. It's a set of C macros and C code. It's not a new language. Please stop.
- VBprogrammer 4y agoIf you are going to be snarky you should probably read all the way to the bottom of the article. > The final reason is the only one that justifies my decision: my code will be rewritten in a memory-safe language. > No, it won’t be Rust. It’s my own language. It’s called Yao.
- gonzo41 4y agoI've always liked saying. "there's memory safe languages and then there's languages people and airlines use"
- SubjectToChange 4y agoSafety critical code is its own beast. But hey, if you want to fly on a plane running on glibc, go ahead.
- defrost 4y agoNo need for glibc - not a lot of call for putc() or fprintf() in a well designed air control system. Even malloc | free aren't vital as memory is preplanned and can be retrieved from an RTOS in a single block at startup.
- SubjectToChange 4y agoI feel like you are missing the point. Using glibc in avionics software is insane, as is any other application software library. In other words, it’s asinine to pretend C is somehow more reliable because it’s used in safety critical applications. There simply isn’t anything in common with the C running on your servers and the C running on an avionics package.
- defrost 4y agoI don't run servers much, I mainly write for critical applications (a decade writing for geophysical airframes, telling pilots where to go and where the pylons are when 80m off the deck for millions of line kilometres, lot's of other stuff going back a long way). > Using glibc in avionics software is insane, As I said above .. there's no need for glibc et al. > I feel like you are missing the point. We seem to be in agreement here. > In other words, it’s asinine to pretend C is somehow more reliable because ... What most people call "C" is (preprocessor) + (actual language) + (stdc function library). What I call C (and hey, maybe that's just me) is just the language component, the "below the fold" library spec in the ANSI Std is easily disregarded .. it's more of a dated "proof of concept" of (for example) one of many ways of handling strings. C is a nice language - the preprocessor and stdlib have issues.
- bayesian_horse 4y agoI got a gist of "I can use the C because I'm smart and nobody else is so I'm working alone."
- wheelerof4te 4y agoSo many people write their side projects alone. Language doesn't matter.
- burnished 4y agoReally? That read to me a a self aware, even humble recognition of personal shortcomings. But I see communication as inherently more difficult than keeping an idea in one's own head.