5 ms·
I keep changing my mind about C/C++. I loved my junior days programming in C & C++. It was really fun writing your own logging framework, container classes etc
by rb808 10y ago
I keep changing my mind about C/C++.
I loved my junior days programming in C & C++. It was really fun writing your own logging framework, container classes etc. OTOH spending weeks looking for root causes of memory problems was fun the first few years then became an annoyance.
Higher level languages are much more productive - which was initially great, but now I feel more like a sysadmin than a programmer. Its a lot of researching, wiring up and configuring libraries. Probably results in better results but not as fun as hitting the metal.
So sometimes I wish I could go back to the old days but my nostalgia is probably rose tinted. I'd love to do it, but I don't think its commercially productive enough, so I'm skeptical of talk of a resurgence.
- cryptarch 10y agoTry Rust maybe? It has a different learning curve from C, as initially you'll be having a hard time getting programs to compile at all, but from that point the ergonomics are much better and you don't ever have to deal memory bugs unless you're developing a low-level library.
- deleted 10y ago[deleted]
- echelon 10y agoI second this notion. I'm quite productive in Rust now and can string together web services quickly. (To date I've written a text to speech engine, a laser projector renderer, and some image processing stuff.) Rust is so awesome. Unlike Python or Ruby it's typesafe at compile time. Unlike Java and Go, it has no dumb GC, and unlike C and C++ it's memory safe. At compile time! Programs can be distributed as a single binary, which makes deployment a breeze. If that weren't enough, Rust innovates beyond every language I know of with its compile time threadsafety and fucking sweet package manager. (Cargo is seriously the best package manager I've ever used--perhaps the best in existence right now.) Give Rust a try. It's freaking awesome. (I'll buy you a coffee if you do and don't like it!)
- rb808 10y agoThat does sound freaking awesome, I really will have to try it out.
- echelon 10y agoThe borrow checker is hard to deal with at first, but after you power through the initial difficulty it becomes second nature. I rarely have to fight the compiler, and when I do it's because I'm trying to do something stupid. In a way I'd liken learning Rust to learning Vim. There is an upfront cost, but the payoff is going to be huge.
- CorvusCrypto 10y agoIdk if I share your enthusiasm, but rust is pretty cool. Certainly has its uses though for bare metal I'd still say go with C (and ASM) if using atmel's AVR chips. At least until rust gets a working compiler to AVR. Seems it is getting ever closer https://github.com/avr-rust/rust https://github.com/avr-rust/rust
- cm2187 10y agoHow developed is the ecosystem? One thing I enjoy about .net is the huge number of free and commercial libraries, the great IDE, and the ability to code a very broad range of applications with a single language (website, CLI, GUI, service, etc). Is Rust comparable?
- echelon 10y agoNot at all. Rust has a long, long road ahead before it has an ecosystem comparable to Java or .NET. These systems have literally man centuries of work poured into them. That said, I still predict Rust becoming the most important language of the decade, if not the decades that follow simply due to the strength of its foundation. Rust solves problems that no other language has--real problems with actual costs--, and fits into a very interesting space where it can eat away at the lethargic incumbants. Rust is a web service language [1]. A desktop application language [2]. A CLI tooling language [3]. A core system library language. A game development language (eventually) [4]. It has a bright future ahead in so many different domains, and the tooling and libraries will come and reinforce this. [1] Hyper, Iron [2] Servo [3] Ripgrep [4] Piston
- bsharitt 10y agoI find myself doing most of my hobby programming in C. I think it kind of evokes the same thing other hobbyists(like wood working) get by building something from scratch even though there are easier ways to get close to the same end result. There's just something fulfilling about building something with your own two hands as it were and seeing it work. That being said, I don't think I'd like to do C professionally and I'll happily stick with languages the manage my memory and have all kinds of libraries that give me "free" stuff.
- sh_tinh_hair 10y agoAgreed. My first choice for a project on *nix is usually in C: it feels like real coding rather than including half the packages/modules from 'pick your glue language here' where the opacity is blinding. But many times I'll stop after working through the first data structures and IPC elements and decide to go higher level in the interest of time and energy (and for other (younger) people being able to maintain it).
- fuball63 10y agoI love the analogy to woodworking. When I am working on game dev, I prefer to use a old SDL based engine I developed in C++ instead of some of the new popular frameworks which are more productive and powerful. I just like tinkering and that "built from scratch" feeling for my hobby projects.
- CalChris 10y agoWell, C and C++ are very different languages. But going forward, this long time C programmer is writing in Rust unless required by exigencies beyond my control. A gun pointed at my head or writing an LLVM backend qualify. Not much else.
- liuliu 10y agoThe tools and stdlib improved ton too. I had address sanitizer and undefined sanitizer default on for a while and that helped a lot on memory issues. Things such as int32_t, intptr_t, ptrdiff_t made it is easier to be confident about your pointer math as well.
- gertef 10y agoThe reality is that anything you do for the first time is fun, and then gets boring.
- dwc 10y ago> So sometimes I wish I could go back to the old days but my nostalgia is probably rose tinted. It seems like nostalgia is a big thing over the past few years. Old game emulators, people getting back into C64 or whatever. I guess it's fun for some people. I've considered playing with such stuff, but I know I'd miss some of the real advances we've made since then. But my major projects at work are in C. My previous job was about 50% C, 50% scripting languages. For all C's deficiencies it's a known quantity and does its job well enough. And knowing C well is a rare enough skill to be valuable, apparently. When I don't need C I'd much rather reach for something like ocaml/haskell, a lisp, erlang/elixir, or something. Basically I ignore all the "C replacement" languages because I can either use C or pick something way better.