285 points · by saadadasd · 7y ago · 146 comments
Sure, there was a lot more to type. Debugging was harder. But there was a beauty to that. A simple mental model. A sense of control.
These days all jobs seem to be sort of online crap. Piles and piles of layers and complexity and heterogenous frameworks and tools. Being on call. Never being able to truly master anything because everything changes all the time.
/nostalgia
I still glance longingly at my dusty paper copy of The Linux Programming Interface (https://nostarch.com/tlpi)
/nostalgia
I got into C over 25 years ago. Didn't find it frightening back then, but I sure do now.
Still use it pretty often for firmware and kernel driver development, but I want to replace it with something safer. Then again, I also use assembler for same reasons... sometimes C just doesn't cut it for interrupt handlers when every cycle and/or code byte size counts.
Why is that? Security related stuff?
That's what you have ASM for :D j/k
:-)
Of course there are those who claim it is actually frightfully complex, when it is those same people who are re-interpreting the standards to actually create that very complexity.
I don't code professionally though, since i can't for the life of me find a job in C which doesn't have already tons of guys like you guys with a century of experience in the language lining up to take it :D
C/asm is awesome, can't bare anything else
I'm not a fan of adding GC to C. I've hard my fair share of stress caused by GC issues. It's great 99% of the time but when you run into performance issues caused by the GC it becomes a very very leaky abstraction.
C - static typing + closures and GC ≈ Scheme. If I wanted to write in that style, I'd just use Gambit and be done with it.
Each time a new "hotness" language, framework, pattern, or dev/devops process comes out you have a rush of professional gurus working hard to build their business (e.g., speaking fees/books/blogging/training) by teaching that this is the new true way.
In the late 90's I began to notice how the new kids kept advocating for the newest so-called best practices to do things that the bad-old practices could handle just fine. Seeing the writing on the wall, I dipped out of the game a few years later.
Unfortunately, the unhelpful tech churn has worsened. Similarly, the quality of the product produced has worsened, or at best, not improved.
Note, hyper-scale advertisement services, global human tracking, and digital Skinner boxes are not an improvement to anything.
Meanwhile 50 year-old programmers with deep general development knowledge cannot find jobs. I guess it is easier for young founders to justify using frothy tech if there are fewer old-timers around to suggest otherwise.
edit-to-add:
/get-off-my-lawn
And of course, the Web became widespread around that time, as well. Whatever you might think about "hyper-scale advertisement services, global human tracking, and digital Skinner boxes", Amazon first became prominent in the dotcom era, and it's quite massive today.
While some newer languages are interesting, the dev stacks today are a mess.
Also, While we have safe pointers and GC everywhere, the lack of technical discipline/professionalism in the industry is worse than ever. I recognize that the C-suite and VCs share in the blame for this, but devs are the ones building things and evangelizing the newest-hotness that comes onto the scene.
But I do have to remind myself that compared to traditional engineering tracks, software engineering is still in its infancy.
/get-off-my-lawn
EDIT: grammar.
Like this? https://andrewkelley.me/post/zig-stack-traces-kernel-panic-b...
I haven’t been able to think of a project to use it for, though, as all of my work these days is web related.
edit: What I meant by "cleaned-up" Pascal was addressing some of Kernighan's criticisms as seen in https://www.lysator.liu.se/c/bwk-on-pascal.html (also, the Pascal syntax is a bit bloated)
Pascal was a language I learnt in 1982 and love it for its elegance. The only thing i dislike and is still around its the begin... End and only because I'm a lazy typist and lazy reader.For me is hard to find Begin-end blocks... Harder than looking for stupid squiggles used in other languages. Go figure.
I don’t need to chase the latest framework... but I’m also on my own for almost everything. Pros and Cons, but I wouldn’t leave it for anything web related.
I'd like to see Rust happen, because I don't see C++ as the embedded future. At least Rust had the good sense to leave garbage collection out.
However... I'll believe it when I see it. And by that, I mean when STM and Nordic and NXP and others are pushing out their own Rust device support files on their sites. When Keil or IAR or Rowley or Atollic pushes out a full featured IDE that uses a Rust compiler. When Rust is not only supporting the latest run of chips but there is a way to debug them with code-overlay. But until then...
There's something to that, I think. And it's still an open question whether the newer languages that are in development at present will succeed in bringing some of that underlying "beauty" back. It's an important issue if we want lower-level programming to be more widely accessible.
(To clarify - the underlying machine model of C is beautifully simple, and newer low-level languages tend to be built on something very much like it anyway. The C language itself is frightfully complex - albeit less so than that other language in the C family that's often conflated with it.)
Startups using frothier tech are often (not always) toy companies building toy products (hyper-scale toys are still toys).
If you do this, it'll seem soon enough that the Javascript nightmare was just a dream. Takes balls though.
Can't stop smiling these days when I see people fighting over which language will rule them all. I spent tens of years searching for that language myself. Time I would rather have spent solving real problems using the best tools.
Lua is a great, easy to use, easy to apply, language -- with a healthy framework ecosystem, and it is very easy to put it to use in a legacy code-base, since its C-based, and we all know that C still makes the world go around. However, its not the fact of Lua, but the fact of 'put our own VM everywhere' that wins, imho.
A little too close to home.
Not so, there are a few specialized domains where having tracing GC easily available is genuinely useful. (Pretty much anything having to do with general graphs - the sort of stuff you'd traditionally use LISP for!) Go is a great fit for these use cases.
Rust is like something else entirely.
btw if you haven't check out Casey Muratori's Handmade Hero on youtube, it will fill you with joy.
Same here. I worked quite a lot on C on Unix and some on Windows (including working on a successful database middleware product on Windows, which was used in some VB+Sybase/Oracle client-server projects) before I got into other languages like Java, Ruby (and Rails) and now Python for quite a while. Great fun working in C, although of course frustrating at times too, debugging weird issues. Also, somehow, I never found working with pointers (at least for simple to intermediate uses of them) confusing, like some do. (I once taught a C programming class at a large public sector company; while I was explaining the int main(int argc, char argv stuff, and the pointer to pointer stuff, the head of their IT dept. who was in the class, said "now it is 'overhead transmission' :)". Maybe I didn't have trouble with pointers because I had some hobbyist assembly language programming background from earlier, including learning about different addressing modes, such as direct, indirect, indexed indirect (or vice versa) (on the 6502 processor), etc., plus used to read a lot on my own about microprocessors, computer architecture, and suchlike related areas, even though they were not directly relevant to my higher-level application programming work (hint hint, to kids learning computers today). Working close to the machine is good. Also, a bit off topic, I kind of independently discovered the concept of refactoring. I was in a nice relaxed state one afternoon, at work, after a good lunch, but not heavy, so not drowsy, working on some Unix C program (likely a CLI one), and over a period of time, I noticed that I had been making small (behavior-preserving) incremental improvements to the code, one after another. In a very relaxed way, without any tension, taking my time for each small change, so I was fairly sure that each small refactoring change did not change the meaning or correctness of the program. Thought that was a good technique after I realized that I had been doing it. Unfortunately did not keep doing it with other code. It was only some years later that I read about the term "refactoring" and about Martin Fowler's book on the subject. I'm sure others must have discovered the concept similarly. Anyway, interesting incident.
Unlike the rushed, tense way in which some (many?) projects are conducted these days (and plenty earlier too), with people playing whack-a-mole with bugs introduced by said rush, "because we have to ship last week".
I'll take debugging C over modern C++ any day...
I've gotten in several arguments with people about why I like C more than C++, and that's in no small part because I find C to be a lot simpler than C++. This is an example; I feel you can learn enough C to actually start doing stuff in a 45 page manual, where with C++ I did it for about a year and never really felt I had a real handle on all the idioms.
I know there are probably a lot of objective reasons to why C++ is safer or something, but I've always felt that if you embrace GCC's extensions, and glibc (and use of Boehm's GC for parts that need to be a bit safer), you end up with a language that's simple to learn, and has a lot of the features I actually use in other languages.
That said, this is coming from a very-much-not systems programmer, and I mostly do Lispey stuff nowadays.
With all the Modern C++ changes happening, it seems like the standards committee is actively making it harder for people who want to understand the language completely. I much prefer C to C++ for the same reason, although I think some features from C++ are genuinely useful, like classes.
However, modern C++ enables safer and clearer semantics than what raw pointers offer, such as references or smart pointers.
Which isn't ISO C any longer, rather GCC C.
I'm personally not opposed to breaking from ANSI/ISO in regards to using GCC or clang; these platforms are incredibly well-tested and supported, produce fast executables, and work on basically every platform out there.
Contrary to the languages listed by you, there are plenty of compilers across the industry.
The computing world isn't composed only of FOSS UNIX clones.
C takes the middle road -- variables may be declared within the body of a function, but they must follow a '{'. More modern languages like Java and C++ allow you to declare variables on any line, which is handy.
I know this is not the case in C11 for example, but is there a compile-time speed-up when declaring variables in this way, or any other benefit?
Introducing additional variables later, means that if you emit code "as you go", you'll be less efficient - which makes no difference today, but was a big thing in the days C was designed; Most compilers back then were single pass, emit-as-you-go. There are relatively simple ways to deal with that even under the single-pass constraint, but in those days and the common compiler construction techniques prevalent at the time, it was considered harder.
There was always an issue of fixups with scope-exiting control transfer like break and goto - however, they are simpler, and don't harm emit-as-you-go compilation to the same extent.
EDIT: Looks like beagle3 beat me to it while I got coffee.
I call it "char" because that's how it's spelled, though.
Like the first word of char *. The accent is generally on the first syllable."
Is it designed to work like that or an oversight?
https://news.ycombinator.com/newsfaq.html
However, links to the original discussion of an old article might be useful if people are interested in the topic but no discussion occurs on the current posting. Or, the previous discussion may have some interesting comments that are worth revisiting.
You can't be serious. How is this ambiguous in the slightest? Assuming that you actually know some rudimentary C.
The amount of dumbing-down that I've seen happen to programming is already beyond ridiculous. You should definitely look at APL, Lisp, or some of the other more expressive languages out there if you think anything beyond the equivalent of glorified Asm (one statement per line, one operation per statement, one use per variable...) is "dense and unecessary[sic] shortcut".
I think this a relevant article to start understanding the opposite point of view: https://news.ycombinator.com/item?id=13565743
Edit: the first example is clearly stepping through values in an array, and the other is flipping some bits and setting others... what's hard to understand about that?
a ^ c | d
mean (a ^ c) | d
or a ^ (c | d)
? The answer is unambiguous, and can easily be found by consulting the standard or any decent reference, but I've been using C for decades and I couldn't reliably answer without looking it up.I dislike some overuse of parentheses, but in this case I'd definitely use them.
Chances are you haven't been using C much for hardware/low-level stuff, because the ^ operator is seldom seen outside of that context.
On the other hand, the precedence of & and | (and likewise, && and ||) should be general knowledge: the former has the higher precedence, in analogy with multiplication vs addition.
a = b[i++]
instead of a = b[i]
i++ // or even better,
// i = i + 1
// and unequivocally
// rejecting any
// compiler for which
// it might matter.
What you save in typed characters utterly means nothing compared to the clarity of separating the two operations (especially side-effectful operations).IMO all these features of C makes programming and therefore system design anti-fragile. Anecdotal experience based on interactions with a few C programmers who work on embedded systems.