Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I still find it surprising how much C is still used (half of C++ when measured by github PRs)
Except when actually needed because of some specific required toolchain, why not just use C++ and write it as if it was C. Then you at least have the option of using a proper hashmap or btree or whatever when needed -
FBDev64703d@12bitfloat I have written my own hasmap ! But really, even if I'm not doing any speed-needing stuff, I still find it too slow for coding libraries. And really any system package manager (pacman the best!) will do it.
-
@FBDev64 Hell yeah, fellow arch user :D
Yeah it's certainly possible to write good data structures in C, but it's just so much more work than using a highly optimized off the shelf one in C++ (abseil) or Rust (std) imo -
FBDev64703d@12bitfloat I wrote it 1~2 years ago, so I just have to adapt it a bit and #include it.
I feel like a God when coding in C or Assembly, like I'm the master of computers. When I go to high-level langs or C++ I feel like a simple employee working for a company and we all are clones.
IDK. -
retoor97663d@FBDev64 I wrote recently about how a self written hash map in c beats the c++ builtin std::map but the difference was so minimal. I had to do a million puts and gets or smth to see difference.
I prefer C just because I like to do everything myself and how's it's doing nothing more or less than I want, not really because it's better -
retoor97663d@FBDev64 if your background color matches you'll get a notif every time someone with same background color posts smth. That's why
-
@retoor Do note that the std::map isn't even that great. I think swiss maps is where it's at right now (https://abseil.io/about/design/... )
I like the simplicity of C but it's also kinda what hinders you from composing and reusing software
I think something like Go (if it was a bit better designed) would be the best in terms of complexity for most programs. Not too complex but also not too simple -
@retoor Good point, yeah Java might actually be that language
Unpopular opinion: I actually like Java and think it's a good language :D
It was mostly hated because of the mega-overengineering people did. But that wasn't the languages fault, because those same people then went over to the JavaScript world and overengineered everything there too -
retoor97663d@12bitfloat C and python are my favourite. Kinda opposites. Java is nice one in between but I never choose middle ground myself. It's always C or Python
-
@12bitfloat @retoor
With today's CPUs and caches, std:: vector will actually beat std::map in performance (in map-like usage) up to several tens of thousands of elements.
I wouldn't be surprised if they just pulled some kind of SSO so that if the map is below, say, 512 kb or so, it's just a vector. -
@FBDev64 Oh, I meant which specific program you use to assemble your code, not necessarily which architecture, though it is very much implied in the question ;>
I like working on x86 code with fasm, at least when I don't have to deal with long ass SSE or AVX mnemonics. You know, shit like VCVTTPS2UQQ. Though intrinsics in C aren't much better. -
@FBDev64 Nice! Writing for the Gameboy sounds really cool. Old hardware in general has that quasi arcane vibe about it, lovely line of work.
Related Rants
I was on Reddit and saw so much C threads saying that it's dying and all.. but I think it is growing.
question
c