LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2011, 04:14 PM   #1
joham34
Member
 
Registered: Oct 2009
Location: Greece
Distribution: ubuntu 18.04
Posts: 89

Rep: Reputation: 4
does a regular linux user need C++ knowledge ?


Hi everybody. I have a modest knowledge of shell and am able to write scripts. I wonder if it will be better to proceed to learn C++ or just to try learn shell better. I intend to do some personal home and office application programming
So what are the possibilities of c++ over shell?
Thank you
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-07-2011, 04:18 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Technically, you don't need to know it, yet, if you want to become proficient with linux and programming, then yes, you will want to learn C/C++, even some assembly
 
Old 12-07-2011, 04:21 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Your title question is easy to answer:
does a regular linux user need C++ knowledge ?
Certainly not.

But ...

Quote:
Originally Posted by joham34 View Post
I intend to do some personal home and office application programming
C++ is the best language.

A typical Linux user doesn't do applications programming. Many different languages could be used for applications programming. Probably more Linux programs have been written in C than in C++. I can't give any concise argument, especially one that would convince an inexperienced programmer, but I am certain that C++ is the best (currently available) language for serious programming projects.

Last edited by johnsfine; 12-07-2011 at 04:41 PM.
 
Old 12-07-2011, 04:33 PM   #4
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by joham34 View Post
I intend to do some personal home and office application programming
Well, the shell can only take you so far - have you considered something like Python? I like it for the "odd-jobs" I come across, and it's much nicer to use and easier to learn than C++, and won't have you tearing your hair out because of memory allocation errors.

Of course, this is just MHO...
 
Old 12-07-2011, 04:36 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Quote:
Originally Posted by joham34 View Post
So what are the possibilities of c++ over shell?
Thank you
Entirely different things. Shell is not meant for actual programming. There are many programming languages for different purposes, it would be hard to tell which one would be the best for you.
 
Old 12-08-2011, 12:22 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by johnsfine View Post
...
C++ is the best language.
...
Of course not. In many sense it's the worst language. Looks like it was designed to ensure the programmers' job security.

Remember our recent discussion on debugging C++ templates ?

But C++ is a (necessary ?) evil in modern world. Remember, I've many times given this link: http://yosefk.com/c++fqa/ ? ... Remember, once one could hardly imagine a world without slavery.
 
Old 12-08-2011, 12:28 PM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Sergei Steshenko View Post
Remember our recent discussion on debugging C++ templates ?
Right. There are big flaws in the ways C++ supports many features that are missing entirely from every other popular language.

Having programmed big projects for MANY years with and without those language features, I'm quite sure flawed is better than missing.
 
Old 12-08-2011, 12:37 PM   #8
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by joham34 View Post
does a regular linux user need C++ knowledge ?
No. It is recommended to be familiar with shell, regular expressions (so you'll use sed/awk) and one scripting language (python/perl). But this is also optional.

Quote:
Originally Posted by johnsfine View Post
C++ is the best language.
No, it isn't. It is one of more powerful languages, but there are tasks for which C++ is not very suitable.
All languages have their uses.
 
Old 12-08-2011, 02:06 PM   #9
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by johnsfine View Post
Right. There are big flaws in the ways C++ supports many features that are missing entirely from every other popular language.

Having programmed big projects for MANY years with and without those language features, I'm quite sure flawed is better than missing.
You have conveniently omitted http://yosefk.com/c++fqa/ . Quite an interesting read on C++ as a whole.
...
One of the stupidities of C++ which is on the surface is the 'const' qualifier. A typical good C++ program has a lot of 'const' in its source, and rightly so. Which just proves my point - 'const' should have been the default - like in OCaml, for example.
 
0 members found this post helpful.
Old 12-08-2011, 02:08 PM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
On topic.

My favorite default language is Perl. It looks like Lua is a good scripting language (though some people find it slower than Perl/Python). Lua appears to be simple/straightforward compared to Perl/Python. And pretty advanced on the other hand.
 
Old 12-08-2011, 03:55 PM   #11
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
Quote:
does a regular linux user need C++ knowledge ?
No, not at all. BASH, the default shell in most Linux distros, is quite powerful and can do much more than you may think, especially when combined with helpers like AWK.

If you want to know more about what makes Linux tick then maybe you should learn C.

Consider C++, Java, or other languages if you want to write graphical programs or object oriented programs to be used by others.
 
Old 12-08-2011, 05:16 PM   #12
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 234Reputation: 234Reputation: 234
Thumbs down

Quote:
Originally Posted by Sergei Steshenko View Post
You have conveniently omitted http://yosefk.com/c++fqa/ . Quite an interesting read on C++ as a whole.
The text in question has been criticized and is a good flamewar fuel. It would be better if everybody stuck to "*I* don't like it so *I* don't use it".

Quote:
Originally Posted by Sergei Steshenko View Post
Which just proves my point
"Proving a point" is a waste of time, if a "point" doesn't always have a practical application. Everybody has an opinion, so let's not start another language war. You're free to use Ocaml. You're also free to make your own C++ derivative.

Quote:
Originally Posted by Sergei Steshenko View Post
On topic.

My favorite default language is Perl. It looks like Lua is a good scripting language (though some people find it slower than Perl/Python). Lua appears to be simple/straightforward compared to Perl/Python. And pretty advanced on the other hand.
It might be a good idea to use/learn something that is more frequently used. Lua (afaik) is less common than Perl/Python, so it might be a better idea to learn Perl or Python.

Last edited by SigTerm; 12-08-2011 at 05:21 PM.
 
0 members found this post helpful.
Old 12-08-2011, 06:32 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
One of the greatest features of Unix/Linux is that ... "the choice is yours with regards to "how you choose to do something!"

When you contrive to ask (Unix|Linux) to do "anything at all," you will do so by constructing "a command," and that "command" will ultimately consist of "an (executable...) file."

And that file (can...) will begin with: #!handler_name

(What is affectionately known as "shebang.")



In other words, when you enter (almost) any command, the shell will forthwith decide that "it isn't a built-in command that I recognize, therefore it must be the name of some file, and therefore I will first look for 'shebang.'" If the shell finds a 'shebang,' it will invoke the specified handler_name program and ask it to carry out the command.

"Okay, okay, okay... so what's the bottom line here?" It is very-simply this:

You can (write and) run a command (that is written in...) any language that you please in Unix/Linux, and no one on Earth will know or care.

Therefore: "do you need C/C++ knowledge?" Uhh... nope!!
  • Do I, personally, "know C/C++?" Yes. Intimately.
  • Have I had need to use that knowledge in the last two dozen(!) (out of more than thirty(!!!)) years? "Thankfully ... no! "

"Shebang" has (delightfully...) dispatched "the arkane" to the (entirely proper...) nether-regions of: "Get 'er done!"

Last edited by sundialsvcs; 12-08-2011 at 06:34 PM.
 
2 members found this post helpful.
Old 12-08-2011, 08:31 PM   #14
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by SigTerm View Post
...
"Proving a point" is a waste of time, if a "point" doesn't always have a practical application. Everybody has an opinion, so let's not start another language war. You're free to use Ocaml. You're also free to make your own C++ derivative.
...
Bad defaults causing extra typing are obviously bad. Because of extra typing. It's not a matter of (not) liking a language in a sense like one may like green and dislike brown.

I don't quite understand "You're also free to make your own C++ derivative". OCaml (as many other functional languages) has by default immutable "variables". While C/C++ do not have them immutable by default.

I wouldn't do a C++ derivative. A language as capable as C++ should be designed from scratch not taking into account "C" legacy.

FWIW, OCaml is a language with automatic memory management and with performance quite close to the one of C/C++. As such it can be quite convenient/useful for a whole lot of tasks. But there are some tasks requiring complete control of HW and manual memory management - OCAml is not for such tasks.

My point was just the 'const' qualifier.
 
0 members found this post helpful.
Old 12-08-2011, 08:58 PM   #15
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
A very key point of the Linux/Unix environments is that, no matter what you may find yourself doing, "you are standing on the shoulders of giants." After all, the entire Unix(R) project started when a couple of Bell Labs researchers stared at the guv'mint funded (and committee-driven into-the-ground) Multics project, and said to themselves, "I Can Do That! (on a PDP-7) ..." and then set out to prove it. (And they did.)

One of the first (and at the time, most earth-shattering) conclusions that they made was that you don't have to make "a significant new operating system" in assembly language. (Such a notion was fairly heretical at the time ...) You can, in fact, use "C" to build an operating system, soup to nuts.

But another equally-important discovery was: "you don't have to use 'C' for everything, and you probably shouldn't."

The good folks who gave us Python ... or Perl ... or Ruby ... or Haskell ... or (fill in the blank) ... what have they done? Well, for one thing, they have given us "fantastically well-crafted C/C++ programs," otherwise known as "the core implementing technologies of their language-of-choice." Because they have done their very-arcane job so very well, we can write truly-crappy programs and actually get away with it! ...

We have "an embarrassment of riches" with regards to our selection of technologies that are equally and very-readily available to us. Therefore, we don't have to "dive to the basement" with technologies like C/C++ merely to make the digital computer do what we want it to do. Instead, we can avail ourselves of other tools (all of them, of course, amazingly-cleverly written in C or C++ ...) to "get from Point A to Point B" much more quickly and cheaply. And, thanks to "shebang," the end-user will neither know nor care how exactly we worked our Magickal Spell. (Or, for that matter, that we worked any magick at all...)

Unix/Linux ... The World Is Your Oyster.

Last edited by sundialsvcs; 12-08-2011 at 09:00 PM.
 
1 members found this post helpful.
  


Reply



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
difference between regular user and system user (and groups) kushalkoolwal Linux - General 1 09-28-2010 04:25 PM
LXer: How the regular Windows user sees Linux LXer Syndicated Linux News 0 11-04-2008 07:00 PM
LXer: Linux Foundation End User Summit: New BtrFS Filesystem and Knowledge Center LXer Syndicated Linux News 0 10-18-2008 04:12 AM
The_Sims for Linux doesnt run in regular User, but in Root. Slackware issue. RHLinuxGUY Linux - Games 4 11-02-2004 09:35 PM
Which is best to install for a first time Linux user with NO UNIX knowledge or LINUX? chris24ang Linux - Newbie 13 05-16-2004 10:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:55 PM.

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