I'm learning C

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,101
126
C is the mother of all modern programming languages, most languages in use today are influenced by it in someway or another.

It's not going to die, just less people will use it at high level.

System level code are still written in C, however.
 

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
C is the mother of all modern programming languages, most languages in use today are influenced by it in someway or another.

It's not going to die, just less people will use it at high level.

System level code are still written in C, however.
So I should just continue learn C then? I'm thinking that if I can get the really hard stuff out of the way first then everything else will become much easier.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,101
126
There is nothing wrong about keep learning C. You will learn a lot and benefit from it.

Just keep in mind that unless you will write code at system level, you really don't have much opportunity writing in plain C nowadays.
 

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
There is nothing wrong about keep learning C. You will learn a lot and benefit from it.

Just keep in mind that unless you will write code at system level, you really don't have much opportunity writing in plain C nowadays.
So what more commonly used for application programming, C++?
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,101
126
C++, yeah. It's used everywhere.

If you program strictly in Windows environment, then C# is very good choice. But Microsoft starts to support C# in Linux & Mac too.

If you want true portability, then Java.

Javascript for front end web programming, for sure.

Data processing, SQL/Python.

The truth is, there is no single language that can handle everything, it all depends on the environment, usage target, budget, time, maintenance, etc.

If you are into programming job, you just have to learn whatever is needed to get the job done.
 
Last edited:
Reactions: urvile

urvile

Golden Member
Aug 3, 2017
1,575
474
96
If you are into programming job, you just have to learn whatever is needed to get the job done.

That's exactly the way I look at it. There are a lot of advocates for various technologies node in particular but there is no one size fits all solution. I have to agree that C won't really be used outside of systems level and embedded stuff and even then not necessarily. I am working with some embedded stuff now and we are using embedded windows for that. Mainly because it's a lot easier we can write everything in C#. Which then flows on to how much it costs to initially develop and maintain the system.

Anyway my point is if it was beneficial to use node then I would. Because I can see the benefits in the way it will meet particular requirements. We use a combination of linux and windows on the backend. We to need to run software that is best run on linux so that's what the company runs it on......one of the business benefits of things like node is there aren't really any licensing costs.....
 
Reactions: mxnerd

sao123

Lifer
May 27, 2002
12,648
201
106
So what more commonly used for application programming, C++?


outside of time critical or precision calculation software, very few desktop Applications are written in C++ anymore, games too. C# and or Java are where most of them are done. Web programming can be done in C# or Java, or one of the many JavaScript derivatives.
 
Reactions: mxnerd

Gryz

Golden Member
Aug 28, 2010
1,551
204
106
I'll say it again.

If you are not a professional programmer yet, or you are not 99% sure that you will become a professional programmer. And still want to learn a programming language. Maybe to "learn what programming is". Or maybe because you want to be able to use something to quickly build a small tool to solve a practical problem. Do some automation. Do some "dev-ops".

In that case, learn python.

Python is a proper tool for lots of small automation in computer science. You can write a shell-script. Or you could use perl (fvck perl). Or write a "real program" in a higher language (C, C++, Java, whatever). But nowadays the best solution would be to use python. I'm not alone in this. I work in networking (as a C programmer). All of our testers (and we got *lots* of testers, double the amount of programmers), all of our testers used to use TCL to write their test-scripts. They are now slowly moving to python. (Big change, considering some of these guys have been using TCL for 10-15 years).

Do I need to explain the benefits of python ?
- very widely used. you are not alone. lots of information on the web. lots of books. lots of places to ask for help.
- relatively easy to learn
- has support for OOP. But if you don't like OOP, you can totally ignore it
- lots of libraries available. lots.
- has better built-in datatypes than many other languages. no messing around with strings like in C.
- for small programs (say < 100k lines), for non-realtime stuff, interpreted python is fast enough.
- portable
- a lot easier to read than perl (fvck perl) of shell scripts
- useful for scripting automation. useful for writing small programs (and bigger ones later, if you get better at python).
- widely used in web-applications server-side. might become more popular than php.
- useful for screen-scaping. useful for dev-ops.

Personally I would never pick python for the stuff I do. I don't like the indentation (and no brackets). But I could live with that. I could not live with the lack of strict type-checking. That would kill me. I like C for what I do. But I must admit, I've been using some python program for my own test purposes. And I've made my own changes to that program. And I must say: I was pleasantly surprised by some of the features of python. (E.g. the fact you can return more than 2 values from a function).

So whm1974, keep learning C. It's fun. It'll make you understand programming better. Make sure that at some point you write code that uses pointers. Put your data in linked lists, trees, etc. Maybe doubly-linked lists, AVL-trees or other more complex data-structures. Stuff that you might normally use a library for. Pointers will make you truly understand how stuff works on computers.

But if you ever think that C is maybe not the most appropriate language for the stuff you want to automate, have a look at Python. Python is the future for most people in automation.
 
Last edited:

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
I'll say it again.

If you are not a professional programmer yet, or you are not 99% sure that you will become a professional programmer. And still want to learn a programming language. Maybe to "learn what programming is". Or maybe because you want to be able to use something to quickly build a small tool to solve a practical problem. Do some automation. Do some "dev-ops".

In that case, learn python.

Python is a proper tool for lots of small automation in computer science. You can write a shell-script. Or you could use perl (fvck perl). Or write a "real program" in a higher language (C, C++, Java, whatever). But nowadays the best solution would be to use python. I'm not alone in this. I work in networking (as a C programmer). All of our testers (and we got *lots* of testers, double the amount of programmers), all of our testers used to use TCL to write their test-scripts. They are now slowly moving to python. (Big change, considering some of these guys have been using TCL for 10-15 years).

Do I need to explain the benefits of python ?
- very widely used. you are not alone. lots of information on the web. lots of books. lots of places to ask for help.
- relatively easy to learn
- has support for OOP. But if you don't like OOP, you can totally ignore it
- lots of libraries available. lots.
- has better built-in datatypes than many other languages. no messing around with strings like in C.
- for small programs (say < 100k lines), for non-realtime stuff, interpreted python is fast enough.
- portable
- a lot easier to read than perl (fvck perl) of shell scripts
- useful for scripting automation. useful for writing small programs (and bigger ones later, if you get better at python).
- widely used in web-applications server-side. might become more popular than php.
- useful for screen-scaping. useful for dev-ops.

Personally I would never pick python for the stuff I do. I don't like the indentation (and no brackets). But I could live with that. I could not live with the lack of strict type-checking. That would kill me. I like C for what I do. But I must admit, I've been using some python program for my own test purposes. And I've made my own changes to that program. And I must say: I was pleasantly surprised by some of the features of python. (E.g. the fact you can return more than 2 values from a function).

So whm1974, keep learning C. It's fun. It'll make you understand programming better. Make sure that at some point you write code that uses pointers. Put your data in linked lists, trees, etc. Maybe doubly-linked lists, AVL-trees or other more complex data-structures. Stuff that you might normally use a library for. Pointers will make you truly understand how stuff works on computers.

But if you ever think that C is maybe not the most appropriate language for the stuff you want to automate, have a look at Python. Python is the future for most people in automation.
Thanks, I'm just getting started with C. and I next plan on doing C++. After that I'm not sure, maybe look at Godot and other FOSS game engines and stuff.
 

Gryz

Golden Member
Aug 28, 2010
1,551
204
106
Thanks, I'm just getting started with C. and I next plan on doing C++. After that I'm not sure, maybe look at Godot and other FOSS game engines and stuff.
Great. C is a good programming language. All I wanted to say is: if the others in this thread scared you that C isn't useful anymore (which is false, imho), I recommend the alternative to be python. But if you wanna do C++ next, or look at other things besides languages, that's all fine to.

Enjoy !
 

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
Great. C is a good programming language. All I wanted to say is: if the others in this thread scared you that C isn't useful anymore (which is false, imho), I recommend the alternative to be python. But if you wanna do C++ next, or look at other things besides languages, that's all fine to.

Enjoy !
I figured that the folks claiming that C and C++ dead and full of crap considering that both are widely used and just about anything and everything can be done with with them.
 

urvile

Golden Member
Aug 3, 2017
1,575
474
96
I figured that the folks claiming that C and C++ dead and full of crap considering that both are widely used and just about anything and everything can be done with with them.

Whoa. I just meant from my professional viewpoint. I have been in the industry 10 years and have so far worked in:

Oil and gas
Leisure industry (think integrating hotel booking systems)
Defence
Transport (tolling systems)
Back to defence
Security (biometrics and whatnot. It's very cool stuff)

I have never seen or used C. The closest I have come was using platform invoke to write a wrapper for some wincrypt PKI functions. C is an awesome language to learn but there are reasons both technical and business as to why C isn't used that widely anymore. That's all I meant.
 

BFG10K

Lifer
Aug 14, 2000
22,709
2,980
126
C is an awesome language to learn but there are reasons both technical and business as to why C isn't used that widely anymore.
I'm not sure why this myth keeps getting repeated. It is widely used, e.g.
  1. https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages
  2. https://www.tiobe.com/tiobe-index/
I've been watching multiple sources like this for years, and C consistently ranks in the top five most of the time. For the last three years it actually seems to be trending upward, usually from 4-5 to 2-3.
 

urvile

Golden Member
Aug 3, 2017
1,575
474
96
I'm not sure why this myth keeps getting repeated. It is widely used, e.g.
  1. https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages
  2. https://www.tiobe.com/tiobe-index/
I've been watching multiple sources like this for years, and C consistently ranks in the top five most of the time. For the last three years it actually seems to be trending upward, usually from 4-5 to 2-3.

That's not my point. I am saying in my professional experience I have never seen applications written in C or C++. That's all. C is far to limited to do the the type of integration work I do. It just doesn't have the language features and then there are the security issues.

So that's both a technical and business issue. I am fairly sure that I said C is dead to ME earlier. Anyway I don't really care about C\C++. Or what other people use....Can I code in C\C++? Sure. Would I want to? Not really.....

YMMV
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,101
126
  1. https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages
The above survey is for IEEE Spectrum readers. And you know, IEEE members are engineers.

If a person is programming at system level (programming engineers), like BIOS, firmware, device/machinery controller, networking devices, drivers, where resources are limited (especially memory) then most likely he is going to use C, pretty much no other choice.

If a program is going to be used at business environment (programmers), no one is going to use C.
 
Last edited:

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
  1. https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages
The above survey is for IEEE Spectrum readers. And you know, IEEE members are engineers.

If a person is programming at system level (programming engineers), like BIOS, firmware, device/machinery controller, networking devices, drivers, where resources are limited (especially memory) then most likely he is going to use C, pretty much no other choice.

If a program is going to be used at business environment (programmers), no one is going to use C.
So what is more typical for business use, C++, Java?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,282
3,904
75
So what is more typical for business use, C++, Java?
I'd say Java, C#, and PHP are the most common. Maybe followed by C++, Python, and Ruby.

Maybe the point here is that once you learn one procedural language it's not hard to learn any other. Once you learn one object-oriented language it's not hard to learn any other. (And most object-oriented languages can behave procedurally.) Once you learn one standard object library it's not too hard to learn any other. The same might be true of functional languages (Standard ML, XSLT(?), F#), but after I learned one I tried hard to forget it.
 

Chaotic42

Lifer
Jun 15, 2001
33,929
1,098
126
I'd say Java, C#, and PHP are the most common. Maybe followed by C++, Python, and Ruby.

Maybe the point here is that once you learn one procedural language it's not hard to learn any other. Once you learn one object-oriented language it's not hard to learn any other. (And most object-oriented languages can behave procedurally.) Once you learn one standard object library it's not too hard to learn any other. The same might be true of functional languages (Standard ML, XSLT(?), F#), but after I learned one I tried hard to forget it.

Agreed. I will say (keep in mind I'm an engineer with a math degree who does development out of necessity, I'm not a software engineer or computer scientist) that I think it's important to learn both Assembly and something like C so that you have to experience what's really going on with your system. Higher level languages abstract a lot of that away, which is good for development time, but it's important to respect what's happening under the hood.

Things like Java and Python are great to get code running quickly, but I'd argue that they allow people like engineers, mathematicians, and scientists who would otherwise have no business programming a system to turn out usable code. They lower the bar of entry into the field, which can be good or bad. If you're a pure programmer and can't handle C or Assembly, that's a cause for concern. I've seen C written by scientists and it's terrifying, even to me.
 

mv2devnull

Golden Member
Apr 13, 2010
1,503
145
106
I've seen C written by scientists and it's terrifying, even to me.
Quite likely.

The language is not necessarily the main problem though. You (non-computing scientist) have a problem. You think hard how to crack it and come up with algorithm that should solve the scientific problem. You implement code with some language to the best of your ability. Test data sets pass fine. However, the "production" runs take forever/eat terabytes of RAM/etc. The logic is correct, the code (horrific or not) is valid, but the complexity of the algorithm does not suite big data.
 

urvile

Golden Member
Aug 3, 2017
1,575
474
96
OK. No rotten fruit please. C is an awesome language and I think everyone should learn it. I actually went out of my way to learn it at uni and took a C unit which was part of an EE major as an elective. At the uni I went to they don't teach C as part of a computer science degree anymore. Same as they don't teach ada anymore. :-O They do teach the fundamentals of OO using C++ but the focus is on Java. Even for data structures and algorithms units both introductory and more advanced. Because a reference is really just a pointer and yes you can write multiway search trees using java.

But I don't have to worry about any of that stuff. It's just reinventing the wheel. In .NET I can instantiate a list object add objects to it and then call List.Sort() which could execute quicksort on the list (there are some other steps but.....). Did I learn quicksort at university? Yeah. Would I want to implement it myself. No.
 
Reactions: mxnerd

sao123

Lifer
May 27, 2002
12,648
201
106
I'm not sure why this myth keeps getting repeated. It is widely used, e.g.
  1. https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages
  2. https://www.tiobe.com/tiobe-index/
I've been watching multiple sources like this for years, and C consistently ranks in the top five most of the time. For the last three years it actually seems to be trending upward, usually from 4-5 to 2-3.


I didnt see anyone say C and C++ are dead languages. They are just used for very specific purposes, not found within your typical business software developer job.
If you are making traffic lights and microwaves and cell phones and televisions, those are ALL C/C++.
But if you are making DESKTOP APPLICATIONS for a windows or linux environment, those are not C/C++ UNLESS you need high speed or high precision in the scientific/mathematics areas, like for example if you need software to compute a rocket orbit trajectory, or to compute cancer mutation rates or if you are writing Audio/Video (Drivers&Codecs).
if you want to build Web Applications for a Database application, or Xbox Games, or your own version of PhotoEditor, Spreadsheet, WordProcessor, Calculator, etc, you're not going to be using C/C++.
 

whm1974

Diamond Member
Jul 24, 2016
9,460
1,570
96
I didnt see anyone say C and C++ are dead languages. They are just used for very specific purposes, not found within your typical business software developer job.
If you are making traffic lights and microwaves and cell phones and televisions, those are ALL C/C++.
But if you are making DESKTOP APPLICATIONS for a windows or linux environment, those are not C/C++ UNLESS you need high speed or high precision in the scientific/mathematics areas, like for example if you need software to compute a rocket orbit trajectory, or to compute cancer mutation rates or if you are writing Audio/Video (Drivers&Codecs).
if you want to build Web Applications for a Database application, or Xbox Games, or your own version of PhotoEditor, Spreadsheet, WordProcessor, Calculator, etc, you're not going to be using C/C++.
I thought most desktop applications were written in C++. I have no plans on doing Web applications anytime soon.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |