To go with Go or C/C++?


T

Tinxx

Don't worry, this is not about some religious language war. I'm just looking for some advice from some C/C++ people who can judge better than me sincemy experience in C/C++ is very limited. I have been developing 10 years with Smalltalk and 10 years with Java. I did some C++ during my studies for my thesis, that's all.

Now I regret never having done any systems programming and I would like to dig a bit into it in my spare time. So I have to pick a language and I was looking at C/C++, D, and Go. I have never seen any job ad asking for a Javadevelopper with some knowledge of C/C++ appreciated. To learn C/C++ well Ineed 3-4 years full time work with it. So even if I do some C/C++ programming in my sparetime I guess it will never make up for anything that counts job wise. Even when I have 20+ years to go till I retire. So my conclusion is that "systems programming" would be something for my spare time that should be done for the fun of it and not with a job goal, because that is unrealistic. My question is whether that opinion is too pessimistic or not. What I came up with so far is that choosing Go for some fun and leisure development work would make sense. D is surely much more complete than Go, but the Go community is really alive and kicking. I'm asking this question here, because I think I know what the people in the Go forum would answer ;-).

Regards, Tinxx
 
Ad

Advertisements

V

Victor Bazarov

Don't worry, this is not about some religious language war. I'm just
looking for some advice from some C/C++ people who can judge better than
me since my experience in C/C++ is very limited. I have been developing
10 years with Smalltalk and 10 years with Java. I did some C++ during my
studies for my thesis, that's all.

There is no such language as "C/C++". I'll presume you mean C++.
Now I regret never having done any systems programming and I would
like to dig a bit into it in my spare time. So I have to pick a language
and I was looking at C/C++, D, and Go. I have never seen any job ad
asking for a Java developper with some knowledge of C/C++ appreciated.
To learn C/C++ well I need 3-4 years full time work with it.

It probably depends on what you're going to be using it for. Often the
exposure to language features can be quite limited if the projects do
not demand it.
So even if
I do some C/C++ programming in my sparetime I guess it will never make
up for anything that counts job wise. Even when I have 20+ years to go
till I retire. So my conclusion is that "systems programming" would be
something for my spare time that should be done for the fun of it and
not with a job goal, because that is unrealistic. My question is whether
that opinion is too pessimistic or not. What I came up with so far is
that choosing Go for some fun and leisure development work would make
sense. D is surely much more complete than Go, but the Go community is
really alive and kicking. I'm asking this question here, because I think
I know what the people in the Go forum would answer ;-).

And you don't know what people in a C++ forum would answer?

Picking up enough C++ to start doing good (or harm) in any field does
not really require years of full-time exposure. Since C++ is a general
purpose language (like Java or D, for instance), knowing the language is
really not a strict prerequisite for getting a job in some field of
applying the language. At least not as much as knowing the field.

I can't tell you anything about Go. You would have to ask "some Go
people" as you'd put it.

V
 
S

Stefan Ram

Tinxx said:
Now I regret never having done any systems programming and I
would like to dig a bit into it in my spare time. So I have
to pick a language and I was looking at C/C++, D, and Go.

C is much easier to learn then C++. D and Go I don't know.
Therefore,

you must choose C!

C is the most popular language on Tiobe (in some months
Java takes this place). C is the fasted language on
language shootout (or very close to the top).

»=head2 What language is Parrot written in?

C.

=head2 For the love of God, man, why?!?!?!?

Because it's the best we've got.«

http://www.davidcole.net/msie/notes/ipl/perl/jul13/parrot/parrot-0.0.4/docs/faq.pod

»Here's the thing: C is everywhere. Recently Tim Bray made
basically the same point; all the major operating systems,
all the high-level language runtimes, all the databases,
and all major productivity applications are written in C.«

http://girtby.net/archives/2008/08/23/in-defence-of-c/

»According to the TIOBE index, the C programming
language is the most popular language in April 2010.«

http://www.geeks3d.com/20100413/tiobe-index-c-language-back-at-number-1-position/

C++ is way too complicated:

»Today's C++ programs will be tomorrow's unmaintainable
legacy code. As [GWS 94] says of C++:

"The seeds of software disasters for decades to
come have already been planted and well fertilised."«

retrieved in 2007 from:
http://burks.brighton.ac.uk/burks/pcinfo/progdocs/cppcrit/index005.htm

http://article.gmane.org/gmane.comp.version-control.git/57918

»C++ is already too large and complicated for our taste«

from a Usenet post posted by Bjarne Stroustrup

»C++ is too complicated. At the moment, it's impossible
for me to write portable code that I believe would work
on lots of different systems«

Donald E. Knuth

»the largest cross platform compatible subset of C++ is C«

http://www.artima.com/weblogs/viewpost.jsp?thread=8826

»C++ has always been a zombie, its only drive is the C
ghost inside it :)«

Pascal J. Bourguignon

<[email protected]>

»I think C++ was pushed well beyond its complexity threshold«

Joshua Bloch

http://gigamonkeys.com/blog/2009/10/16/coders-c++.html

»C++ is an unbelievably huge language«

http://blogs.msdn.com/jaredpar/archive/2009/04/21/questions-not-to-hinge-a-c-interview-on.aspx

»it's just a garbage heap of ideas that are mutually exclusive«

Ken Thompson

http://gigamonkeys.com/blog/2009/10/16/coders-c++.html

»there are a lot of people programming it. But what you
do is you force people to subset it.«

Jamie Zawinski

http://gigamonkeys.com/blog/2009/10/16/coders-c++.html

»the bug classes C++ introduces are way scarier than the
ones it takes off the table«

http://www.matasano.com/log/914/c-a-cautionary-tale-or-1-hour-of-your-black-hat-trip-is-spoken-for/

»C++ is a huge regression compared to C«

Felix von Leitner

http://events.ccc.de/camp/2007/Fahrplan/events/1951.en.html

C is more widespread than C++, at least according too:

2 C 17 %
4 C++ 9 %

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

»C++ has become a niche language, but I talk to many C++
programmers who live in total denial about that fact.«

http://weblogs.java.net/blog/cayhorstmann/archive/2008/01/dinosaurs_can_t_1.html

»C++ is becoming a freak language that's parading its
disfigurements in front of mildly disgusted but
curiously fascinated audience.«

http://www.relisoft.com/tools/CppCritic.html

»If you port your Firefox add-on to IE, you may have to
use C++. And Allen admitted that this is a bit 1998.
"The first thing people say is 'That's horrible. No one
programs in C++ anymore,'" he said.«

http://www.theregister.co.uk/2008/12/11/firefox_to_ie_port/

»an interesting difference between "Effective Java" and
"Effective C++" is that my reaction to the latter was to
come up with a set of SOPs that mainly boil down to
"don't use C++ feature x".«

Bjorn Borud

<[email protected]>

»C++ is generally regarded as the most technically
deficient of the popular OOPLs.«

H. S. Lahman

<[email protected]>

»There are only two things wrong with C++, The initial
concept and the implementation.«

Bertrand Meyer

»C++ is a vast playground, and makes you feel smart
when you know all of it, so you're always tempted to use
all of it. But that's really, really hard to do well,
because it's such a crap language to begin with. In the
end, you just make a mess, even if you're good.«

http://steve.yegge.googlepages.com/tour-de-babel

»It was decisions like not using C++ and not using
threads that made us ship the product on time.«

Jamie Zawinski

http://www.joelonsoftware.com/items/2009/09/23.html

»C++ is a horrible language. It's made more horrible by
the fact that a lot of substandard programmers use it (...)

I've come to the conclusion that any programmer that would
prefer the project to be in C++ over C is likely a
programmer that I really *would* prefer to [move on], so
that he doesn't come and [disturb] any project I'm involved
with. (...)

[T]wo years down the road you notice that some
abstraction wasn't very efficient, but now all your code
depends on all the nice object models around it, and you
cannot fix it without rewriting your app.«

http://lwn.net/Articles/249460/

»As you can see, C++ is really complex, and so a few
mistakes crept in. First of all, exceptions in
constructors do call local destructors, but only if the
exception is caught.«

http://www.fefe.de/c++/

»C++ is just an abomination. Everything is wrong with it
in every way. So I really tried to avoid using that as
much as I could and do everything in C at Netscape.«

Jamie Zawinski

http://gigamonkeys.com/blog/2009/10/16/coders-c++.html

»Though I was not the world's leading C++ expert, I was
a sophisticated and knowledgeable C++ user.

So what happened? Basically I got sick of every single
aspect of C++ being designed around higher performance
instead of my productivity. I also got sick of
impossible to diagnose linker errors and never being
able to just download a library and use it. Each new
library meant I had to build from source because C++ has
no ABI that allows compiled code to just be used. (...)

I wish the C++ people would wake up and realize that C++
is drowning in its own complexity. If I had to write a
high performance application these days I would reach
for C. Any other application I would write in either a
scripting or VM based language and then code the slow
parts in C. Why not C++? Mainly because you can't get
scripting or VM based languages to play nicely with C++
because C++ has no ABI.«

Pro-Phi-Psi; Tuesday, March 11, 2008

http://prophipsi.blogspot.com/2008/03/why-i-no-longer-like-or-use-c.html (gone)

See also:

http://www.sysprog.net/quotec.html
http://burks.bton.ac.uk/burks/pcinfo/progdocs/cppcrit/
http://yosefk.com/c++fqa/defective.html
http://www.nothings.org/computer/cpp.html
http://www.horstmann.com/cpp/pitfalls.html
http://steve.yegge.googlepages.com/tour-de-babel
http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml
http://www.kernel.org/pub/linux/docs/lkml/#s15-3
 
B

Balog Pal

Don't worry, this is not about some religious language war.
I'm just looking for some advice from some C/C++ people who can judge better than
me since my experience in C/C++ is very limited. I have been developing 10 years with
Smalltalk and 10 years with Java. I did some C++ during my studies for my thesis, that's all.

Now I regret never having done any systems programming and I would like to dig a bit into it in my spare time.

Hm, systems programming and spare time is not the best mix.
So I have to pick a language and I was looking at C/C++, D, and Go.

Is there any systems programming dome in D or Go actually? Or could be
done in theory at least?
I have never seen any job ad asking for a Java developper with some knowledge of C/C++ appreciated.

I saw many, but that's hardly relevant.

If you really look to widen yor horizon as a programmer, I'd suggest
first to study SICP http://mitpress.mit.edu/sicp/ then some more
languages that play in different category than all you mentioned.

And after that extend to things you do actual work with.

As of C++, it is a huge investment. I'd only suggest it to those who can
commit bigtime and then use it in practice too.

An C I'd put as avoid unless you're forced and could not figure an
escape route.
 
Ad

Advertisements

M

Melzzzzz

Now I regret never having done any systems programming and I
would like to dig a bit into it in my spare time. So I have
to pick a language and I was looking at C/C++, D, and Go.

C is much easier to learn then C++. D and Go I don't know.
Therefore,

you must choose C![/QUOTE]

That's for sure. But to really understand C (or motivation behind it),
one has to know at least one assembler.
 
R

Rui Maciel

Tinxx said:
I'm asking this question here, because I think I know what the people in
the Go forum would answer ;-).

I believe the better option is either C or C++. Both have their downsides,
but they do have an upside which none of the other languages you've
mentioned has: they are standardised. Both C and C++ have been set in stone
though international standards. This means that it is guaranteed that all
you will learn right now will still be applicable decades from now. There
is absolutely no assurance that bit rot won't catch up with the other
alternatives you are considering, and if we look at the history of
unstandardised languages, it will.


Rui Maciel
 
V

Victor Bazarov

Oh yeah...
You don;t need to know C in order to program in C++, as well...


So you can do system programming without understanding/knowing hardware
you program?

Hello! It's *system* programming, silly. All you need to understand or
know is the *system*. Hardware-shmardware!... :)

V
 
Ad

Advertisements

G

Gerald Breuer

Learn C first because you need a magnitude of time less to learn.
Then learn C++ and forget some idioms of C-programming.
 
M

Melzzzzz

Hello! It's *system* programming, silly. All you need to understand
or know is the *system*. Hardware-shmardware!... :)

V
"
System programming (or systems programming) is the activity of computer
programming system software. The primary distinguishing characteristic
of systems programming when compared to application programming is that
application programming aims to produce software which provides
services to the user (e.g. word processor), whereas systems programming
aims to produce software which provides services to the computer
hardware (e.g. disk defragmenter). It requires a greater degree of
hardware awareness.
"

http://en.wikipedia.org/wiki/System_programming

Well, yes, I agree that one need to know system. Depending on task and
system, hardware knowledge is required (or not).
 
V

Victor Bazarov

Learn C first because you need a magnitude of time less to learn.
Then learn C++ and forget some idioms of C-programming.

Nonsense. "Learn to crawl because it's quicker, then learn to fly while
simultaneously unlearning to crawl." Learning C is a waste of time if
your goal is to learn C++. Even if it takes only a month to learn C
before going over to C++, it's one month too many, especially
considering that certain concepts and idioms *need* to be expunged from
memory. Do it correctly to begin with - start with C++.

V
 
T

Tinxx

"Picking up enough C++ to start doing good (or harm) in any field does
not really require years of full-time exposure."

Well, that is good news. This is somewhat why I was asking this in the C++ forum.

@Stefan Ram: Great post! Enjoyed a lot reading it. "C is more widespread than C++ ...". This is true according to Tiobe. Makes sense first to learn C.Before you can understand why square root of -1 is a problem you need to understand what a square root is ... Also using C++ as a pimped C or modern C becomes an option this way.

"So you can do system programming without understanding/knowing hardware
you program?"

Well, this makes me realize that I would have to revector as to what to do with C or C++. As I don't have the required hardware knowledge I would change to do some kind of application-independent performance critical development such as socket programming (raw sockets or zeromq.org), number crunching, image processing, something like that).

"Learn C first because you need a magnitude of time less to learn.
Then learn C++ ..."

Think this makes sense as already said earlier. Once saw some C++ code which was full with "extern C" statements. Doing plain C++ without any C is nota reality.

Thanks for all the comments.
Cheers, Tinxx
 
G

Gerald Breuer

Am 01.05.2013 21:37, schrieb Victor Bazarov:
Nonsense. "Learn to crawl because it's quicker, then learn
to fly while simultaneously unlearning to crawl."

If there would be a large intersection of crawling and flying
this suggestion might be right.
Even if it takes only a month to learn C before going over
to C++, it's one month too many, especially considering
that certain concepts and idioms *need* to be expunged
from memory.

These concepts can be expunged almost immediately if you
arent going to develop larger idiomatic C-projects in between.

C++ is a complicated language and learning C++ right from the
start might be too difficult and the learning curve may be too
steep for the novice. So it's educational meaningful to learn
the basic concepts of C which also apply C++ also first.
 
Ad

Advertisements

B

Balog Pal

Am 01.05.2013 21:37, schrieb Victor Bazarov:


If there would be a large intersection of crawling and flying
this suggestion might be right.

They both are involved with movement -- and even may be connected by
history. :-o About the same as how C and C++ programming is connected.
These concepts can be expunged almost immediately if you
arent going to develop larger idiomatic C-projects in between.

My experience shows that established C programmers fare pretty badly
with C++ in general and good C++ even more. Rather they fall back to
(likely bad in the first place) habits and write C code in C++, that
falls back on everyone's head. While fresh starters have no such problems.
C++ is a complicated language and learning C++ right from the
start might be too difficult and the learning curve may be too
steep for the novice.

Sure it is, so the way to do it is using a proper learning book or
course that adds elements in proper pace and order. But all C++
elements. Creating a foundation in C++ then build on it more and more.

There is absolutely no necessity to use C as foundation. And we have a
ton of observations that it is a particularly bad and/or dangerous one.
If it weren't going backwards it would still be a waste of time going on
an oblique vector instead right on target.
So it's educational meaningful to learn
the basic concepts of C which also apply C++ also first.

Not really -- the basic concepts of C, like "arrays" are there for sake
of compatibility, and carried as undroppable ballast, but can and are
avoided in usage. So they may be skipped for a long time on the the
proper route. Similar applies to usage of the C library.
 
I

Ian Collins

Tinxx said:
"Learn C first because you need a magnitude of time less to learn.
Then learn C++ ..."

Think this makes sense as already said earlier. Once saw some C++
code which was full with "extern C" statements. Doing plain C++
without any C is not a reality.

Yes it is. You only need to declare something extern "C" if you want to
expose it to C code. My day job is systems programming and I do most of
it in C++. If your system has a C++ compiler, why restrict yourself to C?

Get a copy of "Accelerated C++: Practical Programming by Example", it's
probably still the best learn C++ from the ground up book.
 
T

Tinxx

I think I start with learning C and play around with C calling Lua and viceversa. Maybe some DI framework for C where the configuration definition language is Lua. Might have been done a zillion times before, but it's for fun and learning and you first have to be able to walk before you want to fly.. Knowing plain C is always useful, because C++ is sometimes an overkill ornot the appropriate choice. Then I do some socket programming with zeromq.org first with C and later with C++. This way I can slowly fight my way up at the pace I have time in my spare time.

Thanks for all replies,
Tinxx
 
Ad

Advertisements

B

Bo Persson

Gerald Breuer skrev 2013-05-01 20:44:
Learn C first because you need a magnitude of time less to learn.
Then learn C++ and forget some idioms of C-programming.

The problem is that you have to forget A LOT of C, like

printf and scanf
C string handling
pointers and arrays
malloc and free
inventing odd names instead of overloaded functions
typedef struct
prefixed names instead of namespaces
pass-by-pointer instead of pass-by-reference
that << and >> are some odd bit shifting instead of I/O operators


How much time have we lost after learning all this?


Bo Persson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top