Author Topic: How many people code in C these days, and if so, why?  (Read 47205 times)

0 Members and 8 Guests are viewing this topic.

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: How many people code in C these days, and if so, why?
« Reply #300 on: May 11, 2020, 04:55:02 pm »
Somebody mentioned open source. And Microsoft.

I HATE open source. I HATE IT !!! As a user it's a royal freakin' PITA.

You have some misconceptions about open software.

UNIX V6 was open source, selled by Bell Labs with license (it was not free software, only open software)

Red Hat Enterprise Linux is Free and open software, with a lot of technical support that you have to pay to Red Hat (you pay for the support and program tools, not for the OS)

They all are different concepts.
« Last Edit: May 11, 2020, 05:13:52 pm by Picuino »
 


Offline bd139

  • Super Contributor
  • ***
  • Posts: 23093
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #302 on: May 11, 2020, 05:24:59 pm »
Don’t buy Ubuntu support though. That’s worse value for money than Mac Pro wheels.
 
The following users thanked this post: chriva

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6824
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #303 on: May 11, 2020, 05:26:37 pm »
Do you have actual proof MS influenced C11 in such a way? You seem very convinced of this.
They did add quite a few new members to the SC22 working group.  Just four years after the ratification, committee members suggested removing Annex K.  I was not, and have never been, a member of SC22, but I have read their public documents, and they openly acknowledge that these features were pushed by Microsoft.  Remember, at that point, Microsoft was long on record for attesting that MS C++ will never implement C99.

Do you require me to set up a link page with references to those public documents, or can you consider the core of the points, and just ignore my ranty bits about MS' involvement?  The points, regardless of who pushed them, stand on their merits – after all, the entire C standards committee did ratify it all.

If someone has the penguin as a profile picture you just know they'll hate ms in every way possible and even blame them for stuff they didn't do.
And Swedes traditionally hate all us Finns, and call us "finnjävlar", "finnish fucks".  So, your opinion of me personally is meaningless, and honestly, the fact that you even offered it, is disgusting.

How about you leave my person out, and instead comment on the points I made?  Those are what matter, not who I am.  :)

Tux is a mascot.  I like doing Linux work, so I adopted a version of it for myself.  For the first batch of Linux-based student laptops at the local Uni, I even created a bootsplash with a version of Tux rolling its eyes as the boot progressed.  The purpose was the same: branding.  Zealotry is not in the picture.  I do recall hoping for a larger SSD in the early units, specifically for running Windows and other OSes in VMs, too.  (The first model only had a 120 G Samsung SSD, which is a bit tight, considering Matlab, Mathematica, Maple, and other useful Sci software were also installable on these machines.)

I also do proprietary work.  I do not have any reason to ask why someone else would use Windows just because I don't – because it is just a tool.  Whatever works, works.  It becomes meaningful only when you add context, and external measurements to use in the comparison of different tools.  Somewhere on this board is an early post of mine about the various licenses I suggest for different type projects.  (No, it is not just a list of GPL variants.)

The open source world have benefited A LOT from big corps too.
Yes, and a few companies have hurt it more than most.  The "past Microsoft" has done immense harm, intentionally, as part of its Embrace, extend, and extinguish strategy.  It is important to remember that this was what Microsoft internally described the strategy, not some crazy Linux conspiracy theorists stamped on it.

The "current Microsoft" is doing a lot of positive work in the open source arena.  They are definitely no longer an antagonist, but a participant and contributor, and that is good.

If we look at say Linux kernel developers, most of them get a salary from small and large tech companies.  I find nothing odd in that, having run an IT company for a decade myself, doing a lot of proprietary server-side stuff among other things.  (In another thread, I've mentioned how that broke me, because I'm much more of a tool guy, a janitor/developer/inventor, than a business guy.)  I would not find it suspicious or odd, even if some of the Linux devs were on MS payroll.  (In fact, that would be a very positive thing, considering certain patents and licensing.)

However, MS's business strategy still requires barriers from developers to shift away from the Microsoft platform.  WSL2 and its "almost-linux" environment is a particularly good example of this.  It will be compatible enough so that software is trivial to port to WSL2, but anyone learning to develop in WSL2 will find all other POSIXy systems "more difficult", and will prefer WSL2 instead.  Business-wise this is a sound strategy, and not "evil", but for someone who strongly believes in having vendors compete and not build walled gardens, it is not a good thing.

I would like to emphasize that none of this has anything to do with open source or closed source; this is about portability and the quality and future of the C language as a tool.  I've already explained how C fills a niche at the low system level that is hard to replace with anything else, and how C++ in particular is not suited for that.  None of the new languages have shown practical examples of filling anything in that niche efficiently.  My point was that C99 and POSIX is the best toolkit for that niche, and that C11 (and C18, as it was basically just a collection of erratas to C11) included a couple of good things, and a bunch of optional things that benefit a single vendor and not the users of the C programming language in general.

So, if you disagree with me, I'd like to know exactly why.  I mean, I am not interested in how you see my person, do please do stick to the subject, and not my person.  I do freely admit that I really shouldn't blame Microsoft, because it was the entire multi-vendor C standards committee and working group SC22 that ratified the standard.  But, the way they first publicly stated for years that they refuse to implement C99, and then suddenly participated in the C standards committee to develop C11 with features previously implemented only by MS C++ compiler, was .. worth ranting about to me.
Then again, it was the "past Microsoft", with a totally different leadership and strategies than the company today.
And then again, international standards are not software, and are basically impossible to fork, so the errors made then may be impossible to correct.  :-//

I wish I was better writer in English, so I could have twisted the ranty parts into snide humor; that would have worked much better.  But me fail English often.
« Last Edit: May 11, 2020, 05:29:23 pm by Nominal Animal »
 
The following users thanked this post: nctnico, Karel

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6824
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #304 on: May 11, 2020, 05:42:40 pm »
Standardisation by committee is a sure way to fuck a specification.
Make that design by committee, and I'll agree so hard I'll hurt my neck.

Before C11, the C standards committee didn't tell compiler writers how their compilers should work, they simply ratified an existing agreement.  Additional features weren't pushed from the top down, but by developer users requiring certain features pushing them through their compiler vendors.

If it matters any, I do have similar trust issues with GCC developers, as in the past they were keener on following the standard than in actually producing sensible-in-the-real-world behaviour.  I am told they purged a lot of the slow stones out, and the development cycle seems much faster now that they switched to C++ (and that is a very good thing; it used to take years for bug fixes to filter through), but I haven't personally had any need to interact with them for a couple of years now.

I also have a lot to complain about various Linux distributions and inanities in the Linux kernel, if anyone is willing to listen.  I just ain't a fanboy.  (Except maybe of good arguments – the interesting kind, not the angry kind – and solving problems, and that sort of stuff.)
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #305 on: May 11, 2020, 05:56:57 pm »
I have personally never run into such a compiler bug. That would look like a bug on a *very* basic C feature.... I still want to draw people's attention to the dangers of comparing C "booleans" with a constant.... So, beyond the style question, I think you should be very careful with this.
I totally agree. And I am very careful. For example, I use only the boolean constants defined by the compiler, which reduces (but does not eliminate!) the risk.

To be clear, I wasn't necessarily encouraging this style. It was just a response to the whole "boolean" subthread, which triggered this memory for me.

Speaking of weird bugs: Years ago when I wrote device drivers and applications for Win32 on Windows, the holy and worshipful Visual Studio {grin} and its C/C++ compiler had a bug where #include statements in the very first line of a source file were ignored. I kid you not. It was 100% repeatable. I still leave line 1 of my source files blank as a result of THAT bug in my past. I bet I have more little subconscious quirks like that and the boolean== thing that I've acquired over the years and just don't think about, because I got burned at some point.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7409
  • Country: ca
Re: How many people code in C these days, and if so, why?
« Reply #306 on: May 11, 2020, 08:00:09 pm »
Reading Ritchie's The Development of the C Language paper (from GNU C readings) helped me realize again - the language goes back to the early 1970's and is flawed and cannot fix things due to the legacy code out there it's always had to support. Live on PDP-7. I guess this is why you instead just come up with a new programming language.

I've always hated the C language's lack of type-checking, which is intentional as the academics like polymorphism which is a shit storm for embedded systems.

I've always hated the language's lack of range-checking, where you index outside an array's bounds - this has countless bugs and punches to memory locations, enabled countless buffer-overrun virus invasions, to this day. I understand it's too much overhead to check during run-time like other languages, but it's a huge danger.

Why compile:
Code: [Select]
char myArray[10];
int myTrollLife[10];


myArray[10] = '?';
myTrollLife[50] = 1241248798798798719986720;

I wish the C compilers worked a little harder and caught obvious noob mistakes, instead of catering to legacy or whatever it is that commands ignoring the obvious.


I've always hated the language's silly freedom i.e.

Code: [Select]
if (flaps = true) {
  Boeing737Max(); // goodby all passengers and thanks for compiling.
}

Why allow assignments within a conditional expression? Just crazy.

I'm not trying to be perfect here in my examples or my rant- but it's hilarious how dangerous the C language is, and it doesn't need to be.
All the fanboys expect a perfect programmer but these three issues are huge, in my view and been around for decades as I remember.
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23093
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #307 on: May 11, 2020, 08:15:08 pm »
I tend to write conditionals "yoda style" as I have indeed shafted myself with that.

if (true = flaps)

... error: lvalue required as left operand of assignment

But you know, testing is important too. So is static analysis (coverity). So is runtime analysis (valgrind etc). So is fuzzer (afl). And obviously unit and integration level testing otherwise how the hell do you know what you've written actually even works correctly from a semantic perspective.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6824
  • Country: fi
    • My home page and email address
Re: How many people code in C these days, and if so, why?
« Reply #308 on: May 11, 2020, 08:19:59 pm »
I'm not trying to be perfect here in my examples or my rant- but it's hilarious how dangerous the C language is, and it doesn't need to be.
All the fanboys expect a perfect programmer but these three issues are huge, in my view and been around for decades as I remember.
FWIW, I do agree.  C really isn't that good, which is why I feel so strongly about its standardization committee; they're the ones that could help make it better.. but don't.

It's just that there are some use cases where we don't have anything better than C yet.
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1762
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #309 on: May 11, 2020, 08:22:23 pm »
By the way, ever tried reprogramming 300Mlocs of C code that is tested and prooven over 25 years, and then start all over in another language?
How many thousands of SW engineers and hundreds of millions of $ would that cost ?

Not anything approaching 300Mlocs of code, but I did run into a similar situation at my last job. We had a series of products that used a C code base that was ~15 years old. This was embedded code running on 16-bit and 32-bit microcontrollers with limited FLASH and RAM and consisted of perhaps 125Klocs of C. The code was mature, and while by no means bug free, bugs reported by customers were rare. This code was written by senior engineers who were primarily EE types rather than CS types and they all had been at the company for >20 years.

A few years ago the company was growing and hired a few more software people, mostly guys right out of university, but a few senior ones as well. These new guys collectively took one look at the existing code and promptly declared it broken, purely because it wasn't written in C++. They mounted a campaign to start moving everything to C++ while the old timers dug in their heels and resisted these efforts. I left the company right around the time the C++ crowd was starting to win some minor battles and the old timers were starting to get weary of the infighting and just letting the newcomers have their way.

So what would the C++ advocates gain by rewriting this code base in C++? Very little. The existing code was working, was well-understood, had few real bugs, and had made the company hundreds of millions of dollars over the years. Rewriting it in C++ would have taken perhaps 10-20 man-years of effort and would have resulted in a code base with hundreds of bugs, many of which had been exterminated in the C code base years and years ago. It would have been harder to understand by many of the people who had to interact with it and maintain it (primarily customers and application engineers, who were typically not CS types and who were comfortable with C but not with C++).

The industry is littered with the burned-out wrecks of companies who thought rewriting their bread and butter products in a newer, shinier language was a good idea.
"That's not even wrong" -- Wolfgang Pauli
 
The following users thanked this post: bd139

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23093
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #310 on: May 11, 2020, 08:26:22 pm »
The industry is littered with the burned-out wrecks of companies who thought rewriting their bread and butter products in a newer, shinier language was a good idea.

Hey, my house was paid for by the hopes and dreams of those companies  :-DD
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8119
  • Country: de
  • A qualified hobbyist ;)
Re: How many people code in C these days, and if so, why?
« Reply #311 on: May 11, 2020, 08:42:56 pm »
With C you have to check things yourself and can't rely on a smart compiler doing everything for you. That means more work for you, but at the same time it allows you to do some things a protective language doesn't support. If you like to play safe there are mitigations like libraries with secure functions and other measures to protect against typical security issues like buffer overflows. But the security doesn't come for free, neither with a protective language nor with libs. Executables will be larger and slower. And you can't assume that a secure language won't have or create any security issues. For example, Web 2.0 is a security nightmare.
 

Offline engrguy42

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #312 on: May 11, 2020, 08:58:51 pm »
I have a question for the professional coder dudes...

I always assumed that in the commercial software world that the guys writing code would, maybe 80% of the time, be reaching into ready-to-go functions and libraries the company had built up over the years, and only 20% writing new stuff. "Hey, I need to do some I2C stuff...oh wait, we did that bunch of functions last year, I'll just copy it", or something like that. And I assumed that modular OO stuff and functions would be highly prized, to make libraries of often-used modules that had been used and tested to death.

Is that not how it's done? Or is there a lot of re-inventing the wheel? I guess I assumed that companies would be all over the modular/OO design approach so they could have clean, reliable libraries they could copy from, and save gobs of development time.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27787
  • Country: nl
    • NCT Developments
Re: How many people code in C these days, and if so, why?
« Reply #313 on: May 11, 2020, 09:06:33 pm »
I have a question for the professional coder dudes...

I always assumed that in the commercial software world that the guys writing code would, maybe 80% of the time, be reaching into ready-to-go functions and libraries the company had built up over the years, and only 20% writing new stuff. "Hey, I need to do some I2C stuff...oh wait, we did that bunch of functions last year, I'll just copy it", or something like that. And I assumed that modular OO stuff and functions would be highly prized, to make libraries of often-used modules that had been used and tested to death.
Re-using existing code happens everywhere. Some code I use in every microcontroller project dates back from over 2 decades ago. How much project specific code needs to be added depends on the project and whether or not there is existing code which does almost the same.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline engrguy42

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #314 on: May 11, 2020, 09:42:28 pm »
I have a question for the professional coder dudes...

I always assumed that in the commercial software world that the guys writing code would, maybe 80% of the time, be reaching into ready-to-go functions and libraries the company had built up over the years, and only 20% writing new stuff. "Hey, I need to do some I2C stuff...oh wait, we did that bunch of functions last year, I'll just copy it", or something like that. And I assumed that modular OO stuff and functions would be highly prized, to make libraries of often-used modules that had been used and tested to death.
Re-using existing code happens everywhere. Some code I use in every microcontroller project dates back from over 2 decades ago. How much project specific code needs to be added depends on the project and whether or not there is existing code which does almost the same.

Thanks. I guess I was focused a bit more on the OO aspects. Personally, I do a lot of engineering-type simulations of real world equipment, like equipment with control/feedback systems. And from that perspective, for me at least, having the concept of objects is wonderful.

So for example, let's say you're modelling a solar inverter system with feedback controls. Or an automobile. Or an industrial motor. You can set up classes for the different components, then an overall class, and for example make a Model 463 solar generator system object. Then next month if you need to model a Model 823, you just use the same classes, but tweak the parameters. Same interfaces, same internals, different parameters. And you have these software modules simulating each component, so you can mix-n-match.

I'm guessing that most of the folks here are more in the lower level, embedded hardware systems, so maybe that higher level approach isn't needed?
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27787
  • Country: nl
    • NCT Developments
Re: How many people code in C these days, and if so, why?
« Reply #315 on: May 11, 2020, 09:54:43 pm »
I have C++ classes which I re-use too. Usually a bit of tweaking or overloading of functions is needed to accomodate an existing class to a new project. Some of these classes also date back to over a decade ago.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline engrguy42

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #316 on: May 11, 2020, 09:58:47 pm »
I have C++ classes which I re-use too. Usually a bit of tweaking or overloading of functions is needed to accomodate an existing class to a new project. Some of these classes also date back to over a decade ago.

Are you talking about the practices of a sizeable commercial software developer, or you personally? I'm mostly curious about how commercial developers view the whole OO approach, and if they're as excited about it as I assumed they are.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: How many people code in C these days, and if so, why?
« Reply #317 on: May 11, 2020, 09:59:22 pm »
An interesting article about C++ in microcontrollers.

Modern C++ in embedded systems – Part 1: Myth and Reality.
https://www.embedded.com/modern-c-in-embedded-systems-part-1-myth-and-reality/
 

Offline intmpe

  • Contributor
  • Posts: 27
  • Country: au
Re: How many people code in C these days, and if so, why?
« Reply #318 on: May 11, 2020, 09:59:48 pm »
The industry is littered with the burned-out wrecks of companies who thought rewriting their bread and butter products in a newer, shinier language was a good idea.

Hey, my house was paid for by the hopes and dreams of those companies  :-DD

Mine is too. That is funny as shit but so true.

There used to be a website called fuckedcompany.com but they had to take it down because of the legal threats and battles. Now all you have is glassdoor and stuff but my understanding is if you are a company you can actually "pay" to have a better ranking. I've been in companies so fucked up you felt like you needed a rectal exam each day but in glassdoor they look rosy. So you ask yourself how is that possible when everyone you know hates the place. Well .. they buy their ranking.
 
The following users thanked this post: bd139

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27787
  • Country: nl
    • NCT Developments
Re: How many people code in C these days, and if so, why?
« Reply #319 on: May 11, 2020, 10:03:31 pm »
I have C++ classes which I re-use too. Usually a bit of tweaking or overloading of functions is needed to accomodate an existing class to a new project. Some of these classes also date back to over a decade ago.

Are you talking about the practices of a sizeable commercial software developer, or you personally? I'm mostly curious about how commercial developers view the whole OO approach, and if they're as excited about it as I assumed they are.
Personally but still a commercial software developer  ;)
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #320 on: May 11, 2020, 10:16:35 pm »
I've always hated the language's lack of range-checking, where you index outside an array's bounds - this has countless bugs and punches to memory locations, enabled countless buffer-overrun virus invasions, to this day. I understand it's too much overhead to check during run-time like other languages, but it's a huge danger.
Think of C as a "more portable Assembly language" and it makes much more sense. That's how I came to C - nearly everything professional I'd done up to that point was in pure Assembly for whatever platform. But then I joined a team whose project was based in C. Originally I was tasked with writing the hyper-critical sections in Assembly for maximum performance, but you can't do that very long while remaining ignorant of the language to which you're interfacing.

So I taught myself C, and it was easy. And fast. And logical. Because I came at it from a "lower level language" (Assembly), I was already accustomed to a programming environment where you have limitless flexibility and the responsibility that goes with it. I didn't expect the language to bounds-check my pointers, that's MY job. I didn't expect the language to type-check my variables, that's MY responsibility and sometimes you want/need the flexibility to access things in weird ways. Ultimately, it's all just bytes in memory anyway and you should be able to access the 2nd byte of a DWORD directly in memory if you want/need to. Do I need to be careful? Of course, but that's what I'm being paid to do: Be a professional who pays attention to details.
[/quote]
 
The following users thanked this post: Karel, chriva

Offline engrguy42

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #321 on: May 11, 2020, 10:17:11 pm »
Thanks. I'm curious in the major commercial software world the bosses are always running around saying "I WANT RE-USABLE LIBRARIES PEOPLE !!! I WANT OBJECTS AND CLASSES AND FUNCTIONS WE CAN RE-USE ON THE NEXT JOB!!"

Maybe special awards for the guy who produces the most re-usable classes/objects/functions each month.  :D

Hell, if it was me I'd be all over that. Why write spaghetti code when you can make a nice clean re-usable module?
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Online coppice

  • Super Contributor
  • ***
  • Posts: 9351
  • Country: gb
Re: How many people code in C these days, and if so, why?
« Reply #322 on: May 11, 2020, 10:17:22 pm »
The industry is littered with the burned-out wrecks of companies who thought rewriting their bread and butter products in a newer, shinier language was a good idea.
Hey, my house was paid for by the hopes and dreams of those companies  :-DD
Projects off the rails are the most secure source of employment in the software industry.
 
The following users thanked this post: bd139

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: How many people code in C these days, and if so, why?
« Reply #323 on: May 11, 2020, 10:26:52 pm »
That, and legacy COBOL code running government agencies....
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15226
  • Country: fr
Re: How many people code in C these days, and if so, why?
« Reply #324 on: May 11, 2020, 11:31:35 pm »
The industry is littered with the burned-out wrecks of companies who thought rewriting their bread and butter products in a newer, shinier language was a good idea.
Hey, my house was paid for by the hopes and dreams of those companies  :-DD
Projects off the rails are the most secure source of employment in the software industry.

Ahah, true. I even wonder how many jobs all failed software projects have created. Probably a lot. ;D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf