LinuxQuestions.org
Review your favorite Linux distribution.
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


View Poll Results: Are you a C, C++, or C/C++ developer?
C Developer 12 20.69%
C++ Developer 13 22.41%
C/C++ Developer 26 44.83%
None of the above. 7 12.07%
Voters: 58. You may not vote on this poll

Reply
  Search this Thread
Old 03-07-2008, 10:59 PM   #1
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Are you a C, C++, or C/C++ developer?


Hello,

Do you focus on just one language or do you focus on both languages?

Do you feel that they automatically go together? That they are mutually exclusive? That one doesn't necessarily imply the other? Other?
 
Old 03-08-2008, 12:47 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I do not focus on one language, but in the C family it's only C (and in general it's not OOP).
 
Old 03-08-2008, 03:42 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I love C but avoid C++ like plague. I stick with Java for OO programming.
 
Old 03-08-2008, 05:03 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Whilst I occasionally use C most of my work is in OO and thus when I want a compiled end product I look towards C++.
 
Old 03-08-2008, 07:12 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
I'm trying to teach myself several programming languages at once, trouble is I'm a bad teacher and a worse pupil.
 
Old 03-08-2008, 07:28 AM   #6
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
I use C++ more than C, I just find it harder and less productive to programme without the use of such things as templates and overloading.
 
Old 03-08-2008, 10:31 AM   #7
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I use 100% C++ when I'm writing something with no target OS. When I write for *nix, though I generally have to use libc which is C, and I also try to make my library APIs C if they aren't an object libraries. I guess a more accurate way to say it is that if I want to write a "real" program that deals with files, threads, and processes then I'll make it for *nix because I don't want to determine what's POSIX and what's C89/99.

I generally program in terms of objects, so I use a lot of dynamic lists of objects and encapsulated or embedded objects, so I have to write those in C++. Most of my C++ sources in a dual project have both a C "include" header and a C++ local header.

I'll make as many sources C as possible and I greatly prefer the C I/O API to that of C++. For one, it seems like the C++ I/O system is only designed so that one has the option to avoid classic C, and also you don't have control over low-level things such as fcntl with C++. Overloaded std::ostream operator << are extremely useful, but ultimately impractical unless you're debugging a C++ command-line tool.
ta0kira

Last edited by ta0kira; 03-08-2008 at 10:36 AM.
 
Old 03-09-2008, 12:16 AM   #8
shambler
Member
 
Registered: Sep 2006
Location: Canada
Distribution: openSUSE 11.3, Xubuntu 10.10, Ubuntu 11.04
Posts: 53

Rep: Reputation: 23
I prefer C++ so I can do OO with objects and inheritance - makes a lot of work I do so much easier. As do namespaces and a few other goodies. Being able to do C style i/o or C++ style i/o is particularly helpful, especially if porting C code to C++. Partial ports or mixed C/C++ programming using extern "C" { .. } is a good thing as well.

However, I stay away from some C++ language "features" such as templates. I need to do both C and C++, plus php, python, xhtml. css, javascript and a bunch more, and could do without cluttering up my brain any more than necessary.
 
Old 03-09-2008, 01:09 AM   #9
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
I love C but avoid C++ like plague. I stick with Java for OO programming.
I don't know that I've ever heard it put that way before. Most people who use C choose C++ over Java as far as I can tell (to include me.) You really lose a lot of functionality with OO in Java because:
  • Single-inheritance only
  • No non-abstract members allowed in abstract classes
  • No virtual inheritance
  • No direct interface with C
(Again with no evidence) it seems to me that the Java->C++ barrier tends to be the complexity of memory management in C++ or maybe just the simplicity of GUIs in Java. Since you're a C user, does that mean the GUI does it for you?
ta0kira
 
Old 03-09-2008, 01:28 AM   #10
fantas
Member
 
Registered: Jun 2007
Location: Bavaria
Distribution: slackware, xubuntu
Posts: 143

Rep: Reputation: 22
Mixture of both. Probably something like C with classes.

I love the C++ language features (especially templates, inheritance etc.) but can easily live without stuff like e.g. the iostreams or static_cast (or even STL) which seem to me very convoluted (they have their purpose of course, but it seems only to those people who need the extra safety belt).
 
Old 03-09-2008, 03:28 AM   #11
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by ta0kira View Post
You really lose a lot of functionality with OO in Java because:
  • No non-abstract members allowed in abstract classes
Not true. I think you're confusing abstract classes with interfaces.

Quote:
Originally Posted by ta0kira View Post
  • No virtual inheritance
I'm curious: What do you use it for? I never have.
 
Old 03-09-2008, 03:36 AM   #12
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by JMJ_coder View Post
Hello,

Do you focus on just one language or do you focus on both languages?
I focus on C++ because that's what they make me write at work.

Quote:
Originally Posted by JMJ_coder View Post
Do you feel that they automatically go together? That they are mutually exclusive? That one doesn't necessarily imply the other? Other?
They're two very different, though related languages.

C++ adds convenience, but also lots of ugliness.
 
Old 03-09-2008, 08:34 AM   #13
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I learnt C++ and haven't really bothered learning C as there's no need for me to. I don't usually use classes, but I make use of STL stuff (vectors, for example).
 
Old 03-09-2008, 09:57 AM   #14
sci3ntist
Member
 
Registered: Dec 2006
Distribution: Debian,Slackware,FreeBSD,CentOS,Red Hat,Windows Server 2008
Posts: 133

Rep: Reputation: 16
C is the best, I always prefer to write in c and perl, they are the best.
 
Old 03-09-2008, 10:48 AM   #15
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by Dan04 View Post
I'm curious: What do you use it for? I never have.
Normally if a class inherits a base class more than once it will contain that many independent copies of it. Virtual inheritance merges those copies into one:
Code:
              +--> class middle1 --+
class base1 --|                    |--> class final1
              +--> class middle2 --+
final1 will only have one copy of base1 if middle(1|2) use virtual inheritance, whereas it would have 2 if one or both didn't. This helps in 2 ways:
  • Allows e.g. class dog to be created from class mammal and class domestic, both of which inherit class animal individually.
  • Allows abstract functions to be defined by other classes that are inherited:
    Code:
    struct abstract
    {
    	virtual void function() = 0;
    };
    
    class defines_abstract : virtual public abstract
    {
    	void function() { }
    };
    
    struct uses_abstract : virtual public abstract
    {
    	inline void something()
    	{ this->function(); }
    };
    
    class steals_abstract : public uses_abstract, public defines_abstract
    {
    	//no definition of 'function' needed
    };
    
    int main()
    {
    	steals_abstract abstractness;
    	abstractness.something();
    }
ta0kira

Last edited by ta0kira; 03-09-2008 at 10:53 AM.
 
  


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
Developer Myopia donzzz77 LQ Suggestions & Feedback 12 02-13-2008 10:42 AM
How do i become a kernel developer??? samix_119 Linux - Kernel 3 12-17-2006 09:37 AM
How can i become kernel developer? Barq Linux - General 1 09-04-2004 03:18 PM
How to become a linux developer elf-assassin Linux - General 1 06-10-2004 11:05 AM
QT developer chichibabin Programming 3 10-10-2003 06:42 AM

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

All times are GMT -5. The time now is 04:29 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