General > General Technical Chat
How many people code in C these days, and if so, why?
<< < (14/99) > >>
ace1903:
C is easier to learn by doing. Many of my colleagues started as electrical engineers with no background in computer science.
When they were newbies, we used to give them small tasks to do in project that was 100k+ sloc. All of them completed successfully in a week by looking at the rest of the code and a couple of books.
After 3 months they were capable of doing tasks of any order of complexity. Of course, there was support from system architect and obligatory and regular code reviews.

The same approach doesn't work for projects in C++. To be good software developer in C++ need some background in computer science.
Learning by studying books and doing exercises instead of regular tasks. Code review in C takes an hour or two (incremental patch). Good C++ review is more hours and is much more difficult.

Newbies tend to finish tasks fast in C++ but at the expense of resource leaks and random crashes.
When I say C++ I think all the features of C++, not C way of programming in C++
The ratio of good C  developers vs good C developers is something like 1 to 50.
C++ makes a better product but it will be expensive.
engrguy42:

--- Quote from: ace1903 on May 06, 2020, 02:45:14 pm ---C is easier to learn by doing. Many of my colleagues started as electrical engineers with no background in computer science.
When they were newbies, we used to give them small tasks to do in project that was 100k+ sloc. All of them completed successfully in a week by looking at the rest of the code and a couple of books.
After 3 months they were capable of doing tasks of any order of complexity. Of course, there was support from system architect and obligatory and regular code reviews.

The same approach doesn't work for projects in C++. To be good software developer in C++ need some background in computer science.
Learning by studying books and doing exercises instead of regular tasks. Code review in C takes an hour or two (incremental patch). Good C++ review is more hours and is much more difficult.

Newbies tend to finish tasks fast in C++ but at the expense of resource leaks and random crashes.
When I say C++ I think all the features of C++, not C way of programming in C++
The ratio of good C  developers vs good C developers is something like 1 to 50.
C++ makes a better product but it will be expensive.

--- End quote ---

Again, isn't the important question "What problem do I need to solve?", rather than what's "easier"?

I'm surprised nobody has mentioned C#. I think if you want to very quickly and efficiently develop GUI's on Windows that's probably at the top of the list.

And if you're doing math-intensive stuff you probably want a language that happens to have some excellent math libraries available so you don't waste time coding them from scratch.

And if you're doing graphics-type stuff (ray tracing, etc.) you want a language that fits more closely with what graphics hardware manufacturers' API's develop and support.

And if you're coding at a lower hardware level you want an language that is light and efficient for that.

And on and on and on...

As with most things in the universe, it depends. There's no right answer for everyone. Just be sure to evaluate the problem and look for the best tool that's available. Unfortunately a lot of people take the approach "Oh, I like this, therefore everyone has to like it and think it's the best". 
Wolfgang:
I've worked in the software industry for 30years+.
I've worked in C/C++/COBOL/Pascal/FORTRAN/Assemblers/LUA/Python/PL1/Java/...
I've written several languages myself for specialized purposes.

My view on (sometimes religious) language debates:
- With a clean mind you can solve a problem in (almost) all languages, sometimes more elegant, sometimes harder.
- Even the best language cannot keep idiots from coding garbage.
- Every good code has this ratio: 10% solution of the problem, 90% defense against idiots.

Now (retired) I use:
- Plain C for hard numerics (math, speed) and on microcontrollers (Arduino)
- Python on the desktop. Reason: Elegant, efficient, lot of useful libraries.
ace1903:
In an ideal world, there will be 50+ C++ developers equally good in math for signal processing and a little bit of hardware (to know to use logic analyzer scope...).
But in real-world if you try to find them, either half of them would hate math or will be from some distant country with cultural differences.
There was an interesting story from Dropbox I think. They know that C++ is best for them, the product has already a stable code base and benefits from C++.
But the available workforce forces them to migrate whole product towards some javascript framework..
They have great ideas for new features and improvements but sadly C++ developers don't want to learn their proprietary code base and find it uninteresting and not challenging enough. 
Couple of days ago I asked project developed in Matlab\python to be ported in C++ for the production environment. Got hundreds of views because description contained neural networks and machine learning.
Sadly only one C++ developer applied for the job.
 
Wolfgang:
IMHO, C++ has been expanded to death. The language has become completely unwieldy due to featuritis,
is hard to read and its so easy to shoot yourself in the foot.
If you use all features to the fullest (multi inheritance, ...) its so easy to write code even the inventor will
not understand anymore after two weeks. C++ tries to do too much, has too many side effects, is hard to debug,
not very suited for realtime or small hardware stuff due to memory issues, not extremely fast either, so ...
If your problem just calls for a reasonable object-oriented language and performance is not critical -
Python. You do the same in a fraction of the code. If its close to hardware or raw speed - pure C.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod