LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-15-2017, 08:17 AM   #1
lse123
Member
 
Registered: Dec 2008
Posts: 125

Rep: Reputation: 15
C or C++ - Linux, what to learn


As a Web Developer I am familiar mostly with HTML5/JavaScript, PHP and Java... I have these Qs...

C or C++

I prepare to give the LFCS Admin Linux exam, is really benefit learning what C or C++ for further Linux progress?

Other separate Q

For studying Microprocessors textbooks is really benefit learning what C or C++ for further PC hardware/software engineering progress?

What IDEs used for C/C++ development for Linux...? Can use even Apple or MS products like Visual Studio or Xcode... ?
 
Old 07-15-2017, 08:55 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
basic c or C++ is basicly the same in Linux or somewhere else - the differences would come in when programming a 'Window' or gui

if you know Java and not Javascript mind you but Java then it should be relativity easy for you to pick up on C especially c++ because it too is oop

code::blocks or just a text editor and a command line. and I am sure their are other IDE out there as well. google IDE for LINUX c++ see what ya get.
 
Old 07-15-2017, 09:45 AM   #3
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,216
Blog Entries: 2

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by lse123 View Post
As a Web Developer I am familiar mostly with HTML5/JavaScript, PHP and Java... I have these Qs...

C or C++

I prepare to give the LFCS Admin Linux exam, is really benefit learning what C or C++ for further Linux progress?

Other separate Q

For studying Microprocessors textbooks is really benefit learning what C or C++ for further PC hardware/software engineering progress?

What IDEs used for C/C++ development for Linux...? Can use even Apple or MS products like Visual Studio or Xcode... ?
I use Code::Blocks Ide and Geany on several different platforms. I recommend learning c than c++. Most Linux distros have gcc installed. For cross platform gui I use wxWidgets which is written in C++.
 
Old 07-15-2017, 11:32 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,583
Blog Entries: 16

Rep: Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316
I understand C and I don't understand C++, so I would say at a guess that C is easier to learn! But if you're cleverer than I am, C is still a good place to start because everything that is valid in C is valid in C++ too.
 
Old 07-15-2017, 11:51 AM   #5
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
C++ was created to be compatible with C but add additional features. this was 30 yeas ago or so, so C is older than C++.

Today's C++ is way ahead of C, the compiler can do optimizations C can only dream about since it has much more information about the code, plus that the strong type system and other features allow to write you save code what C programmers also only can dream about.

This fact is not commonly known, unfortunately, and a lot of not well educated people float the internet with miss information (see above 2nd post fore example)
Not to mention those people that relay on out of date information form 20 years ago, or less competent rants from people about C++, like fore example, Linus, who happily uses C++ libraries for his diving application today ;-)
So be aware that, if you ask about the C/C++ topic, there will be a lot of misinformation for you.

To the original question.
There is C and there is C++ code, these are 2 different things.
The Linux kernel is written in C, like a lot of libraries and programs used.
It is for sure not wrong to start with C, especially if you want to learn about Linux.
Than it depends on what you will or are planning actually to do. But having some basic understanding of C is a good base for continues learning.
 
Old 07-15-2017, 11:54 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,690
Blog Entries: 3

Rep: Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920
I'd also say that it comes down to what you want to work on. If you want to do systems-level work, then use C. If you want to do user-space graphical applications, then use Java or C++. So look at the tools you wish to work on and see whether they use C or C++ and let that influence your choice.
 
Old 07-16-2017, 04:11 AM   #7
lse123
Member
 
Registered: Dec 2008
Posts: 125

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Turbocapitalist View Post
I'd also say that it comes down to what you want to work on. If you want to do systems-level work, then use C. If you want to do user-space graphical applications, then use Java or C++. So look at the tools you wish to work on and see whether they use C or C++ and let that influence your choice.
Since I know Java (& web tech like PHP and JS this may not relate) and plan to build GUI programs as in Java, definitely I have to go C++...?

In addition Studying giving LFCS Admin exam and planing reading Microprocessors textbooks and PC repair, building and troubleshooting ... especially the latter C++ is in addition the choice???

C++ is super set(contains all of) of C , correct?
 
Old 07-16-2017, 05:17 AM   #8
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by lse123 View Post
As a Web Developer I am familiar mostly with HTML5/JavaScript, PHP and Java... I have these Qs...

C or C++

I prepare to give the LFCS Admin Linux exam, is really benefit learning what C or C++ for further Linux progress?

Other separate Q

For studying Microprocessors textbooks is really benefit learning what C or C++ for further PC hardware/software engineering progress?

What IDEs used for C/C++ development for Linux...? Can use even Apple or MS products like Visual Studio or Xcode... ?
Since C is everywhere and comfortable, pleasant, to use.

Kernel is coded on C and all programmers know C.

Python, Java,... are abomination for lazy programmers.


Don't trust anyone leading you to other languages than C.

C is the first step of all good programmers.

Just use C !!

Last edited by Xeratul; 07-16-2017 at 05:20 AM.
 
Old 07-16-2017, 10:47 AM   #9
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,216
Blog Entries: 2

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by lse123 View Post
Since I know Java (& web tech like PHP and JS this may not relate) and plan to build GUI programs as in Java, definitely I have to go C++...?

In addition Studying giving LFCS Admin exam and planing reading Microprocessors textbooks and PC repair, building and troubleshooting ... especially the latter C++ is in addition the choice???

C++ is super set(contains all of) of C , correct?
You can do gui in c. but it is a lot easier in c++. And yes c++ does contain all of c.
 
Old 07-16-2017, 11:36 AM   #10
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,638

Rep: Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614Reputation: 5614
c++ is object oriented, so you need to learn what does it mean and how to use. This is valid for all OO languages (like java too).
c is relatively simple, but actually really hard to use well. I would suggest you to learn it, but it will take some time (probably years) to know it very well.
 
Old 07-16-2017, 11:48 AM   #11
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
C really isn't pure C anymore anyway, it includes a lot of features of C++ such as declaring variables anywhere, not just at the top of a code block. You kind of can learn them both simultaneously, learning the basics (mostly C) at first and then learning the more complex object-oriented, templating, and other features of C++ later. C++ is incredibly complex and is best learned bit-by-bit anyway, it's a huge thing to swallow at once.

I think even most professional C++ programmers rarely use all the features the language has to offer. Even its creator said it was way too complex. He was quoted as saying something to the effect that there was a much simpler language crying out to be extracted from C++ and he thought Java might be that language. Although Java has its own basket of troubles.

Last edited by Laserbeak; 07-16-2017 at 11:53 AM.
 
Old 07-16-2017, 02:01 PM   #12
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by pan64 View Post
c++ is object oriented, ...
C++ is a multi paradigm language. oop is just one aspect.
and oop in C++ is not the oop of Java.
 
Old 07-16-2017, 02:53 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
I log log time ago I took C++ first then took JAVA next wow did I ever catch on to JAVA really quick having already learned C++ first. so whatever is whatever if you have some back ground in one programming lang then it will cross over and help in any whatever lang you take next to learn - except FORTAIN maybe

but don't look at me for C++ or JAVA advice. they changed C++ a week or so after I took it, and Java both I do not use but I remember the basics of it and used it to learn what I know in BASH .. go figure.
ok maybe a little C I applied to it as well.

Last edited by BW-userx; 07-16-2017 at 02:55 PM.
 
Old 07-16-2017, 03:00 PM   #14
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by BW-userx View Post
whatever lang you take next to learn - except FORTAIN maybe
Actually FORTRAN isn't that bad. For being the first high level language ever invented (like 1957 or so), it's remarkably similar to modern languages.

The one language I really hate is COBOL, it's worse than reading extremely wordy English. I had to translate a huge system of COBOL programs into Perl and it turned a full huge binder into just a few pages of code.
 
1 members found this post helpful.
Old 07-16-2017, 03:03 PM   #15
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,852

Rep: Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740
I came up the hard way: FORTRAN, Assembler, BASIC, Assembler, Pascal, Assembler, then C and COBOL together. I still use Pascal from time to time, and modify C source to change program behavior, but mostly shell (Korn and Bash with some Perl, Python, PHP, or whatever is needed).
At the time I started, Fortran was considered the only "true" compiler as it translated somewhat directly into IBM 36* machine code.

Target the language of the environment you want, but let me make this clear: you are training your brain not just learning a language. The more you learn, and the more languages you learn, the better you will "think into the machine" and write better code.
 
  


Reply

Tags
c++


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to learn more about Linux carrollshaffer Linux - Newbie 20 02-01-2017 05:22 AM
Hi . Someone to learn Linux Lingat04 LinuxQuestions.org Member Intro 1 04-18-2013 09:20 PM
How did you learn Linux? jamescow Linux - General 32 03-19-2009 12:13 AM
how to learn linux senthilk Linux - General 9 05-07-2007 09:50 PM
What's the best way to learn linux? Tech1 Linux - General 19 04-15-2003 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration