Wondering if C Programming Language is still alive?

NTMBK

Lifer
Nov 14, 2011
10,400
5,635
136
It's still pretty widely used in things like embedded software, driver development, low level stuff like that. And it's a good starting point to learn about things like memory management.

Depends what you want to do with programming!
 
  • Like
Reactions: DAPUNISHER
Jul 27, 2020
24,044
16,801
146
I've heard from experienced programmers that you DO NOT want to do that.
 
Last edited by a moderator:

Red Squirrel

No Lifer
May 24, 2003
69,690
13,319
126
www.betteroff.ca
C/C++ are good languages to learn. Lot of stuff either emulates it, or is actually using it under the hood. It's worth learning both or at least just jump straight to C++. What I like about both languages is that they are not proprietary or dependent on any specific vendor. It's probably as low level as you can get without going straight to assembly.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,319
126
www.betteroff.ca
I wouldn't consider myself an expert but I've written small programs with it such as my hvac controller and environmental monitoring system and other misc utilities. I keep meaning to start on a larger scale project but have not started anything yet. I kind of want to experiment with making a clustered application that scales, just not really sure what yet. Maybe a social media platform or a game (server part would be clustered) or something.

Oddly enough the biggest project I ever worked on was in C# which I knew nothing about when I started it. It was around 1mil lines of code. I did some crazy major changes to it including completely rebuilding the storage engine from ground up to use MySQL instead of flat files. My basic knowledge of C++ kind of helped me quickly learn C# though. C# is actually pretty nice, but if I was to do something from scratch I'd still do C++ as it's OS agnostic and not run by a single corporation.

I find C++ is easier than C as it has OOP concepts like classes, which C does not have. For something small C is fine, I think it has less overhead which is why it's used for things like drivers. For a larger scale project or something you anticipate growing, C++ is easier.
 
Jul 27, 2020
24,044
16,801
146
Oddly enough the biggest project I ever worked on was in C# which I knew nothing about when I started it. It was around 1mil lines of code.
:eek:

What does it do in a nutshell?

Does it have a UI? Would you like to share some screenshots?

Is there any heavy compute going on in it? Maybe you could release the source code of a toned down version that could be used to test the performance of PCs as well as the performance difference when compiled with different dotnet versions.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,319
126
www.betteroff.ca
:eek:

What does it do in a nutshell?

Does it have a UI? Would you like to share some screenshots?

Is there any heavy compute going on in it? Maybe you could release the source code of a toned down version that could be used to test the performance of PCs as well as the performance difference when compiled with different dotnet versions.

It was a UO game server, so ran the whole game world basically. Was called RunUO, but I heavily modified it and added a lot to it including rewriting the whole storage engine. The original authors were geniuses though as they were able to reverse engineer the game enough to figure out all the packets etc. That's the hard part.

There was a decent amount of compute depending on what was going on in game but it was mostly single threaded so had to be diligent of adding anything too intensive as it would affect game play for everyone. I would sometimes go overboard with mobs that do lot of crazy things and during testing I would spawn like 1,000+ of them and have them fight each other to test them. If the server did not lag then it was considered worthy of release. Honestly I was surprised at how efficient C# was for being a higher level language.

Another C++ project I have that's actually still active is https://uogateway.com It's a UO top site list. The back end that does the polling is C++ and site itself is php.
 
  • Like
Reactions: igor_kavinski
May 11, 2008
21,651
1,293
126
I know it is. C is a great language. Close to the hardware if you want and need to, and fully abstracted if you so desire.
Everything is already cooked up. Shared libraries, static libraries are easy to use. That is totally not "C" specific but the language is quite manageable.
Of course, some people make a sport of it to make the code as unreadable as possible, code obfuscation. For fun or for business that is...

Also , when people get older, one prefers to stick to what they know, cause it is a bit like muscle memory. Weird comparison but i do not know how to describe it.
And i am just a n00b when it comes to writing programs.
 
  • Like
Reactions: igor_kavinski
Jul 27, 2020
24,044
16,801
146
Also , when people get older, one prefers to stick to what they know, cause it is a bit like muscle memory. Weird comparison but i do not know how to describe it.
And i am just a n00b when it comes to writing programs.
Not weird at all. Humans prefer not to waste time and very few want to challenge themselves by trying to learn new skills when they can just use their existing skills and save time.

What kind of programs have you written? Got a Github repo?

I'm currently messing with using someone else's assembly programs for benchmarking different CPUs. The whole thing was targeted for Linux but thankfully, the actual ASM files compile fine under Windows with NASM so having a blast creating the EXEs and then wrapping them up all together for a CPU instruction set benchmarking suite for Windows. I just hope the original author has no objection to that.
 
May 11, 2008
21,651
1,293
126
Not weird at all. Humans prefer not to waste time and very few want to challenge themselves by trying to learn new skills when they can just use their existing skills and save time.

What kind of programs have you written? Got a Github repo?

I'm currently messing with using someone else's assembly programs for benchmarking different CPUs. The whole thing was targeted for Linux but thankfully, the actual ASM files compile fine under Windows with NASM so having a blast creating the EXEs and then wrapping them up all together for a CPU instruction set benchmarking suite for Windows. I just hope the original author has no objection to that.
I did write a program, but it is not available for the masses. Because it does not have all the features i would like it to have.
Also , i would then, if it was a real product, put on sale for like 10 euro or something or with a donation page. Very low price.
 
Jul 27, 2020
24,044
16,801
146
I did write a program, but it is not available for the masses. Because it does not have all the features i would like it to have.
Also , i would then, if it was a real product, put on sale for like 10 euro or something or with a donation page. Very low price.
Hey now, you are making me uber curious!

Post a screenshot or give us a hint about its functionality.
 

Jimminy

Senior member
May 19, 2020
444
164
116
Even with C, when you are writing something that directly controls hardware, (for example a microcontroller), you sometimes still must resort to subroutines written in assembly or even machine code.

In my limited experience, using C is overall more trouble than it's worth for hardware interaction. I found it better to just do it in assembly language from the very start. This also forces you to *think* in terms of the hardware rather than through an abstraction layer.
 

Jimminy

Senior member
May 19, 2020
444
164
116
it is a program that keeps track of all the administration during writing of a C or C++ program.
I always used a small notepad to scribble on. But I usually transcribed these notes to a plain text file, if they were important. This gave me a way to later document my code with comments. It worked pretty well for me, but I'm not a pro.
 
  • Like
Reactions: igor_kavinski
Jul 27, 2020
24,044
16,801
146
Had you played around with assembly code before recently?
No. I didn't even know what to do with it. Just downloaded NASM. Ran it, it worked then googled how to link it and it just worked. Was pretty surprised. I didn't change anything in the code coz that would be too risky (would only try that inside a VM). Was just trying to create an EXE for each INT/FP instruction asm file that the original author had written. There are so many that it quickly became tedious creating OBJ, then linking, then checking how many iterations would be optimal (some finish too quickly so need to increase the iteration count for it to serve as a better benchmark). The cool thing was after creating 8 of them, I just ran this one CMD file with eight lines for as many powershell instances and each instruction runs on its own core. Poor man's multi-core benchmark :D

Gonna finish the rest when and if I get the time. And then testing on a more modern PC (running on i7-4770). Dang. Can't believe the work these CPU instruction geeks have to do for benchmarking.