3 ms·
I love C. It's the language that makes me the most happy. I'm not entirely sure why, I think I like being in control. People always comment about C is unsafe, f
by keyle 3y ago
I love C. It's the language that makes me the most happy. I'm not entirely sure why, I think I like being in control. People always comment about C is unsafe, full of razors and knives flying around.
The thing to keep in mind is that *you* are the one throwing the razors and knives from the moment you go beyond printf("hello, world!\n");
I'd never recommend a company to start building anything in C. In term of the various team sizes and staff churn over the lifetime of a company, it's too risky.
But afaik most companies, particularly the growth hacking ones, are either Go or Kotlin or at that level of abstraction. Rust is slowly eating at C++ and I'm pretty sure no company in their right mind today start a new product in C++. It will slowly become COBOL.
C on the other hand still has new C written every day. I'm a polyglot and I love C, but I never had a job in C. I hope some day that happens. The modern tools aforementioned, e.g. static analysis, clangd, are really good.
The thing I love most about C is that there is a direct relationship between me doing something stupid and feeling pain for it. In python, I can write crap all day without feeling it. Some day I'll feel it, but not today!
I like small binaries and fast code. I like that when a developer tells me I did something wrong, they can prove it, and it's not some stupid high level language "the more you knoooow". I like control over things.
I love modern C and I wish it well!
- epcoa 3y ago> I'm pretty sure no company in their right mind today start a new product in C++. The library support for rust in key areas is terribly lacking and not everyone is a Microsoft that can afford to build the world from scratch. As just one example a few valiant folks develop plugins and realtime audio with rust, but serious work that needs to get done today happens in C++.
- 3a2d29 3y ago> I'm pretty sure no company in their right mind today start a new product in C++ I say this as someone who loves rust and zig, but these types of statements make me feel like HN is way out of touch with the industry. New products are constantly made in C++. That doesn't make it good (and i don't think companies building in C++ are making the best choices), but to say that no big tech company is writing any new code in C++ is just not correct. I see this happen every day at my job. I also would definitely say more C++ code is written every day over C, although I'll say, I am not as familiar with the embedded world, but I know one HFT/Gaming/Robotics firm will have millions of new C++ lines every day.
- hansvm 3y ago> in their right mind
- jakogut 3y agoAgreed, I also like writing and especially reading (good) C. The Linux kernel, Wine, and FFmpeg are a joy to read, and much more approachable than one would think. I get exhausted by people denouncing C in favor of the language du jour, and suggesting it's been obsoleted by newer and especially more abstract languages. A hammer and nails are still useful for specific jobs, even if you have screws. All tools have their trade offs. Even when you have a battery powered impact driver, sometimes you still need to pick up a basic hammer.
- deleted 3y ago[deleted]
- saagarjha 3y ago> I'm a polyglot and I love C, but I never had a job in C. I hope some day that happens. The modern tools aforementioned, e.g. static analysis, clangd, are really good. If you had a job in this you’d know that they are not ;)
- bsdpufferfish 3y ago> staff churn over the lifetime of a company, it's too risky. Experience says otherwise. C code bases have serious longevity due to how many people know it and can jump in and contribute. There just aren't that many patterns and abstractions.
- dvko 3y ago> I love C. You and me both. I'm also a polygot but I originally started on interpreted languages like PHP and Python. I then learned some C, which was quite frustrating before I learned how to reason about memory ownership and hold myself to some idioms. Oh and Valgrind. I then rewrote a bunch of projects in Rust and while it lead to correct and working software, it didn't spark the joy that C did for me. I don't exactly know why and at times I almost feel ashamed to mention this. I do hope there's a future where there's a version of C with some more substantial changes/improvements though, perhaps taking a lesson or two from Rust or Zig (eg string type w/ length).
- jll29 3y agoSince D is already taken, maybe a language called "E"? The first thing I'd borrow from Rust are Option and Result for better error handling.
- keyle 3y agoYes, this, most modern languages embrace this idea of Optional. I believe OCaml might have invented it (I love OCaml too!). Odin has it I think, Rust obviously, and Swift heavily as well. What's interesting, modern C, is promoting this move as well. Don't just return an integer, return a struct result_t with a fail bool or error bool in it, as opposed to some const char* pointing to null. Do this more and more and your C code starts becoming a lot more digestible and modern (although common sense still applies to not go overboard with these constructs in C, but you can set up a nice contract type API design within your code base).
- sgbeal 3y ago> The thing I love most about C is that there is a direct relationship between me doing something stupid and feeling pain for it. Excellent! Such wisdom is rarely found in random forum threads on the internet.
- Keyframe 3y agoI'm in the same boat. Took me a while to accept that I am a C programmer at heart, it suits me the best. I feel like I'm in full control and I can move fast with it. Not all razors are on us though, especially if moving around compilers since there are here and there undefined behaviour parts and it's easy to throw knives around. I also wouldn't recommend starting a new thing with it if the whole team wasn't well-versed with it. On the other side of spectrum, today's world is well-served with python, c++ and rust (that battle is ongoing, I like both), java, heck even JS. There's something special about C though and I've yet to see something replacing it's place. Closest was D1, but that came and went.
- uecker 3y agoIn my opinion, companies should consider C for new projects. Many people know it, the tooling is excellent, there is long-term stability, compile times are fast. With other languages you run into constant problems with tooling or compatibility issues. Also in my experience average and unexperienced programs can be very productive in C. Even if the code is not perfect, it can often be improved incrementally, where in some other languages I sometimes decided to throw it away because there abstractions that do not make sense and everything depends on it. But one absolutely needs to exploit good coding guidelines, modern tools, and CI, and avoid low-level pointer fiddling or string manipulation (which can be abstracted away in C as well as in other languages). Some of the most reliable and powerful software I use daily is written in C.
- spacechild1 3y ago> I'm pretty sure no company in their right mind today start a new product in C++. I'm pretty sure this does not match reality. > C on the other hand still has new C written every day So does C++.