Author Topic: Does anybody learn C any more?  (Read 62608 times)

0 Members and 7 Guests are viewing this topic.

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2860
  • Country: nz
Does anybody learn C any more?
« on: August 17, 2019, 08:08:10 am »
If you have picked up plain old ANSI C in the last few years, how and why did you learn it?

I originally learnt C as it was the standard compiled 3GL for PC programming during the 16-bit era, (along with with maybe Pascal). I still use it often and respect it as being the swiss army knife of programming languages.

What would drive people to take the leap from the highly abstracted world of things like Python to the 'madness' of C today?

It can't just be Arduino and embedded development...

(I'm currently writing a REST API service in C for only one reason - performance. Python gave 2 transactions per second, my C implementation gives 200... Most likely with a bug count to match!)
« Last Edit: August 17, 2019, 08:11:04 am by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2686
  • Country: au
    • Halestrom
Re: Does anybody learn C any more?
« Reply #1 on: August 17, 2019, 12:02:07 pm »
I learned C makings scripts for video game maps.

I use it a lot.  Pet projects and work -- only the other week I was facing 20 seconds of json parsing in python vs 1.5 seconds of parsing (with an inefficient parser) in C.  Waiting 20 seconds for every graph to plot was a nightmare.

Touchscreens never killed laptops.  Laptops never killed desktops.  No language will ever kill C.   We end up with a bit of everything.
« Last Edit: August 17, 2019, 12:03:50 pm by Whales »
 
The following users thanked this post: BillyD, rs20

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Does anybody learn C any more?
« Reply #2 on: August 17, 2019, 12:22:26 pm »
Luckily people still learn it. There is a lot of legacy code to be maintained, esp in the machine building industry.
However many modern big paid IT jobs don't require it anymore.
Cloud programming is all about functional programming, dockers and all kind of newer languages.

Non it related jobs use Mathlab, simulation tools etc.
 

Offline knapik

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
Re: Does anybody learn C any more?
« Reply #3 on: August 17, 2019, 03:40:52 pm »
I don't see microcontroller companies ever supporting anything other than C (and sometimes C++), so I'll say it'll always have its use. I don't particularly think its a good language though.
 

Offline bsfeechannel

  • Super Contributor
  • ***
  • Posts: 1693
  • Country: 00
Re: Does anybody learn C any more?
« Reply #4 on: August 17, 2019, 04:49:21 pm »
What would drive people to take the leap from the highly abstracted world of things like Python to the 'madness' of C today?

Simple. Just list the languages written in C. Start with Python. Then list the languages influenced by C. Start with Python.
 
The following users thanked this post: Yansi

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3910
  • Country: it
Re: Does anybody learn C any more?
« Reply #5 on: August 17, 2019, 07:56:20 pm »
I don't see microcontroller companies ever supporting anything other than C (and sometimes C++), so I'll say it'll always have its use.

This. If you work with microcontrollers then C is a must, even though there are things like micropython or GNAT ports for specific targets like some STM32 families

Quote
I don't particularly think its a good language though.
Meh, i like my hammer :) other languages are just a curiosity to me when i work with micros: basically i can't find any support for anything that's not C/C++
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10088
  • Country: us
Re: Does anybody learn C any more?
« Reply #6 on: August 18, 2019, 12:48:54 am »
Well, Windows is written in C as is the Linux kernel and all of the utilities.  As I said before, C runs the world.  Fortran tells it how fast to go.  Everything else is just passing through.

And Unix is written in C so MAC OS X must be as well.

https://www.toptal.com/c/after-all-these-years-the-world-is-still-powered-by-c-programming

You really need to separate application languages like Java and C++ from system languages like C or math oriented languages like Fortran.

 
The following users thanked this post: bjdhjy888

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10088
  • Country: us
Re: Does anybody learn C any more?
« Reply #7 on: August 18, 2019, 12:56:10 am »
For a language with a LOT of legacy code and no new practitioners, think about COBOL.  The banks are in serious trouble trying to find programmers.  I would be surprised if ANY university offered a course.  And the old guys will be retiring soon!  The job market is going to explode!

Look at the list of businesses that still use COBOL:

https://www.quora.com/Is-COBOL-programming-language-still-in-use-in-the-year-2018

The language is still in use because it is auditable!  And COBOL uses fixed point arithmetic so no round-off errors accumulate.
« Last Edit: August 18, 2019, 12:58:11 am by rstofer »
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Does anybody learn C any more?
« Reply #8 on: August 18, 2019, 01:01:15 am »
Well, Windows is written in C as is the Linux kernel and all of the utilities.
Windows is written in C++. The funky exception handling in C++ is said to be a major factors that kept Windows horribly buggy for years.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3538
  • Country: us
Re: Does anybody learn C any more?
« Reply #9 on: August 18, 2019, 01:31:12 am »
...
...
Touchscreens never killed laptops.  Laptops never killed desktops.  No language will ever kill C.   We end up with a bit of everything.
...

Depends on what you mean by "kill C".

FORTRAN is still in use, COBOL is still in use.  In today's world no one would think of FORTRAN or COBOL as a growth language, but FORTRAN or COBOL surely is not "killed", at least not yet.

I do think that C will loose popularity like FORTRAN or COBOL at least in the "developed economies".  India and China will likely be the power houses of "real" programming.  "Real" in the sense that the "programmer" is not dragging pre-programmed ICON around and use drop down menu to check/uncheck boxes of what you want that icon/program to do, but actually developing the code behind those ICONs.

While waiting for my car tire repair, I was in the waiting room with a large TV set.  I saw a TV show segment about kid's learning "computer programming" using some Microsoft tools - dragging icons around and use the drop down to refine function that icon/app offers.  Microsoft paraded it as the next generation of programming AND as training the next generation of programmers.  None of the show host know any better.  They were "amazed" at the tool as being able to create the next generation programmers creating a new class of (verbatim quote:) "programmers making a good living."

It may well be a world that in the the developed economies we don't learn C or any real language to program.  The macro-tools will be developed by the developing economies where wages are lower.  The developed economies will use these higher level tools to control the thing that will do our actual production of of value.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21608
  • Country: us
Re: Does anybody learn C any more?
« Reply #10 on: August 18, 2019, 01:43:56 am »
I'm not going to go so far as to say C will always be around, but I think it will be with us for the foreseeable future. C is universal in the embedded microcontroller world, and C++ is still heavily used in other areas of software development. I don't see this changing any time soon.
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 6196
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Does anybody learn C any more?
« Reply #11 on: August 18, 2019, 03:06:55 am »
As someone making a living with embedded development in microcontrollers, DSPs and ARM Linux that absolutely breathe C everywhere, I am absolutely certain that C will not vanish in the foreseeable future as well.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4720
  • Country: au
  • Question Everything... Except This Statement
Re: Does anybody learn C any more?
« Reply #12 on: August 18, 2019, 03:29:22 am »
Another in embedded, its pretty much either C, C++ or assembler, and in a larger amount of projects than I would probably like, a mix of one of the C's and assembler.

For data analysis, and odd job stuff I still prefer python as its easier for me to bodge things together in a short time frame, Its generally a lot slower than C could do things, but I would prefer to have a program in 1 hours and burn 14 on processing it, than 4 hours making it and 3 hours to process it, the total time is less for C, but I am free to do other things while python runs.
 

Offline coppercone2

  • Super Contributor
  • ***
  • Posts: 13719
  • Country: us
  • √Y√... 📎
Re: Does anybody learn C any more?
« Reply #13 on: August 18, 2019, 03:49:47 am »
I still think in ASM because its the first thing I hard core learned, and its interesting to very precisely control the MCU and understand what the blocks are doing... and actually be able to figure out hardware bugs and semi faulty chips or internal damage detection/evasion
 

Online magic

  • Super Contributor
  • ***
  • Posts: 8060
  • Country: pl
Re: Does anybody learn C any more?
« Reply #14 on: August 18, 2019, 07:13:06 am »
It's 2019, people!
C is obsolete, we gotta learn LISP Smalltalk Java Haskell Intercal Rust :scared:
 
The following users thanked this post: ludzinc, rstofer

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 6415
  • Country: nz
Re: Does anybody learn C any more?
« Reply #15 on: August 18, 2019, 07:29:25 am »
Well, Windows is written in C as is the Linux kernel and all of the utilities.
Windows is written in C++. The funky exception handling in C++ is said to be a major factors that kept Windows horribly buggy for years.

I don't know what Windows is written in now, but since Microsoft started it in around 1984 and released version 3.0 1990 while C++ wasn't generally available until about the same time -- it's 100% certain early Windows wasn't written in C++.

Microsoft wanted exception handling and invented their own version of it with a specific runtime implementation (SEH). At first I think programmers had to set it up manually in each function using macros, but gradually compilers got features to do it automatically.

It was not terribly compatible with standard C++ exceptions, once that appeared, and this caused untold problems.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 8060
  • Country: pl
Re: Does anybody learn C any more?
« Reply #16 on: August 18, 2019, 07:48:37 am »
Windows NT has been rewritten from scratch so it has nothing to do with v3.0 or 9x.
Everything since 2000 was NT-derived, although it did receive some injections of 9x codebase here and there. I think the graphics stack used to be one example before it got rewritten in Vista(?).

NT kernel code has been leaked at one point. If this repo is what it purpotes to be, it's written in C.
https://github.com/ZoloZiak/WinNT4

Userspace probably is a mix of C/C++ and I presume that they are moving onto C# in the latest versions.

The oldschool win32 API DLLs are all C.
« Last Edit: August 18, 2019, 07:50:08 am by magic »
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Does anybody learn C any more?
« Reply #17 on: August 18, 2019, 10:09:20 am »
...
...
Touchscreens never killed laptops.  Laptops never killed desktops.  No language will ever kill C.   We end up with a bit of everything.
...
<snip>

While waiting for my car tire repair, I was in the waiting room with a large TV set.  I saw a TV show segment about kid's learning "computer programming" using some Microsoft tools - dragging icons around and use the drop down to refine function that icon/app offers.  Microsoft paraded it as the next generation of programming AND as training the next generation of programmers.  None of the show host know any better.  They were "amazed" at the tool as being able to create the next generation programmers creating a new class of (verbatim quote:) "programmers making a good living."

<snip>

That reminds me of an old Gary Larson Far Side cartoon which showed a child playing a Nintendo with 'hopeful parents' in the background imagining help wanted ads in the year 2005: ''Nintendo Expert Needed. $50,000 salary + bonus" or ''Can You Save The Princess? We need skilled men and women, $75,000 + Retirement.'
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: Does anybody learn C any more?
« Reply #18 on: August 18, 2019, 10:14:07 am »
It's 2019, people!
C is obsolete, we gotta learn LISP Smalltalk Java Haskell Intercal Rust :scared:
why in the 2019, if they have to invent a new language, why they have to bring the fucking ";" as linefeed along? chr(13) and chr(10) have been used for millenia as linefeed and carriage return, a relic brought down from C/C++ :palm: everything else is a good thing in C/C++ except this (this make C is 99.99% my favourite language) why?

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 6196
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Does anybody learn C any more?
« Reply #19 on: August 18, 2019, 10:48:53 am »
Mecha, you are not the only one that mentions this, but I really don't understand the anger towards the ; character. It helps with extra ling lines and is visible as a delimiter. LF, CR or CR/LF are not visibile (by default on a text editor) and OS-dependent. Also, once you get it in your system, you use it without thinking.

Regarding Windows: the adoption was in stages. 3.11 and prior were entirely in C (although DOS was assembly for the most part, and you couldn't have windows without it). Windows 95 was the first to start having functions written in C++ but, IIRC, Winows NT4 was the one advertised as having a significant portion being developed in C++ (with Windows 2000 and XP increasing its spread even more). If Microsoft was ever  fully out of the "C", it will certainly comeback with the adoption of WSL
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Does anybody learn C any more?
« Reply #20 on: August 18, 2019, 11:08:57 am »
It's 2019, people!
C is obsolete, we gotta learn LISP Smalltalk Java Haskell Intercal Rust :scared:
why in the 2019, if they have to invent a new language, why they have to bring the fucking ";" as linefeed along? chr(13) and chr(10) have been used for millenia as linefeed and carriage return, a relic brought down from C/C++ :palm: everything else is a good thing in C/C++ except this (this make C is 99.99% my favourite language) why?
The use of a statement delimiter predates C by a long way. It was introduced because of problems found in early languages, like Fortran, where the end of the line meant the end of the statement. Fortran fixed this with something really clunky - a special continuation mark in a special column on the following line allowed for more complex statements. We don't end an English statement at the end of a line. We end it with a full stop. Full stop being the same as decimal point made ending statements with a full stop somewhat error prone, so most languages chose a semi colon. The problem in C is not the use of a semi colon to end a language statement. Its the inconsistency that a special continuation marker ("'\") is used to force statement continuation in pre-processor statements.
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1556
  • Country: wales
Re: Does anybody learn C any more?
« Reply #21 on: August 18, 2019, 11:44:37 am »
How and why did you learn it. I think it was Microsoft QuickC because it was a lot easier than MASM.
Second C compiler I tried was the Motorola DSP56K Optimizing C Compiler which didn't support a fractional data type making it useless.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10088
  • Country: us
Re: Does anybody learn C any more?
« Reply #22 on: August 18, 2019, 02:25:56 pm »
For the hobbyist, C was the first higher level language available on early 8080 and Z80 machines.  So, no, I didn't learn it in the last few years.  I have been using it for nearly 40 years (starting around '80).  I preferred Pascal but that came along a bit later.

I would still be inclined to use C as a language for embedded programming simply because I don't believe in dynamic memory allocation (heap) on memory limited embedded processors.  I can avoid the standard string functions (that use a heap) and everything works out fine.

C and Fortran are the only languages I actually use.  I have tried, off and on, over the last 20 years of so to develop an interest in C++ and I just can't quite 'get it'.  It's not the mechanics of the language (well, ok, it is), it's the 'why' I can't wrap my head around.  Same with Python.  I want to like it, I admire the built in structures, but then they bastardize the syntax with indent levels.  Not that I don't indent code levels, I just want some kind of delimiters like '{' and '}'.

I'm just too old to learn new stuff and, given that the old stuff is still in use, have no real desire to push beyond my comfort zone.  It's not like I need (or even want) a job.
« Last Edit: August 18, 2019, 02:27:50 pm by rstofer »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17781
  • Country: fr
Re: Does anybody learn C any more?
« Reply #23 on: August 18, 2019, 03:22:27 pm »
NT kernel code has been leaked at one point. If this repo is what it purpotes to be, it's written in C.
https://github.com/ZoloZiak/WinNT4

Userspace probably is a mix of C/C++ and I presume that they are moving onto C# in the latest versions.

The oldschool win32 API DLLs are all C.

Yep.
The base kernel is C, as is the Linux one, and AFAIK, MacOS X one (XNU).

When Windows introduced COM stuff, I think they wrote most of that in C++, but still kept an interface for C.

I'd guess a lot of higher-level components in Windows are written in C++, and as you said, some in C#, but the core is still C.

Although MS promotes other languages and tools, the Windows API is still mostly C, and you can still write full apps entirely in C on Windows directly using Windows SDK.

 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3538
  • Country: us
Re: Does anybody learn C any more?
« Reply #24 on: August 18, 2019, 05:29:12 pm »
For the hobbyist, C was the first higher level language available on early 8080 and Z80 machines.  So, no, I didn't learn it in the last few years.  I have been using it for nearly 40 years (starting around '80).  I preferred Pascal but that came along a bit later.
...
...

If you consider BASIC, FORTH high level languages, both were available for CPM on 8080.  z80 was a cloned (functional clone, not hardware clone) of 8080 with much enhancement over the 8080, so 8080 predates z80.  I had BASIC on my SOL20 (8080) in 1977 before C was available for the 8080, CPM BASIC was the standard then. 

I don't rule out that C was out there for 8080 before 77, but I was religiously reading the main available computer magazine at the time - "Byte Magazine" and I don't recall any advertisement of C compilers out there.  Anything available on CPM would likely be before DOS.

Altair BASIC was used by Microsoft to make Altair-Microsoft BASIC in 1975 before DOS existed. Microsoft did not make MS-DOS until IBM contracted them to create DOS for the IBM-PC (which was 8088 a mixed 8/16 bit improvement of 8080 which was 8 bit only).  That was the time when MS purchased OS from Seattle Computer Products and made it into DOS for IBM-PC.  IBM PC with PC DOS was introduced in 1981.  So Microsoft BASIC pre-dates MS-DOS and PC-DOS.

Running with under 64K ram that the PC can use for DOS, any C compiler back than were primitive.  You cannot consider C then to be anything like C later when "extended memory" came into play.  I think the Greenleaf C compiler was the first "real" industry standard C compiler for PC.  It later was purchased by Microsoft as the first version of Microsoft C which then became the industry standard.

Now if you are talking about "Structured Language", I agree with you.  BASIC and FORTH are high level languages, but not Structured Languages.  Borland Pascal came much later than C.
« Last Edit: August 18, 2019, 05:37:31 pm by Rick Law »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf