Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #18845

Re: reasons for preferring C over C++

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "tim....." <tims_new_home@yahoo.co.uk>
Newsgroups comp.arch.embedded
Subject Re: reasons for preferring C over C++
Date Mon, 20 Oct 2014 11:56:42 +0100
Lines 81
Message-ID <cak83aFhrm4U2@mid.individual.net> (permalink)
References <543ead04$0$15847$e4fe514c@dreader35.news.xs4all.nl><m1mmar.23s.1@stefan.msgid.phost.de><caf18hF6lueU1@mid.individual.net><7x4mv1tdyv.fsf@ruckus.brouhaha.com><cahbdfFp8kcU1@mid.individual.net> <7xoat7hape.fsf@ruckus.brouhaha.com>
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Trace individual.net S+eEExeebOlLeLVKSbv5PAdR/94W5qBz0IzWZ81XXItklwILhF
Cancel-Lock sha1:oVKpuQT9sBPVSf4PrtLepqgcrIY=
In-Reply-To <7xoat7hape.fsf@ruckus.brouhaha.com>
X-Priority 3
X-MSMail-Priority Normal
Importance Normal
X-Newsreader Microsoft Windows Live Mail 14.0.8117.416
X-MimeOLE Produced By Microsoft MimeOLE V14.0.8117.416
Xref csiph.com comp.arch.embedded:18845

Show key headers only | View raw


"Paul Rubin" <no.email@nospam.invalid> wrote in message 
news:7xoat7hape.fsf@ruckus.brouhaha.com...
> "tim....." <tims_new_home@yahoo.co.uk> writes:
>>> [ STL containers ]
>> the syntax is awful - completely unintelligible to someone who has
>> never seen it before (and sometimes even if you have)
>
> It seemed pretty natural to me. std::vector<float> is a vector of
> floats.  std::vector<int> is a vector of ints, and so on.

try putting that in a loop "For first, to last, step next"

compare with:

for (i=1; i< sizeof(array); i++)
    array[i]...

It's unintelligible to someone who hasn't seen it before (as I will admit is 
the C version, but the set who have seen it before is 100 times bigger)



.
>
>>> and range checking
>> big deal
>
> Given the amount of bugs in real code caused by subscript errors, range
> checking is a good thing too.

No,  I mean,

big deal that it save me from typing:

if (i < sixzeof(arrayname))

>>>, and they allow you to use containers of multiple
>> but I won't have enough types for this to be a problem
>
> Look up "typeful programming" and start using more types.  It will
> decrease your debugging time :).

will it?

do you really think that type mismatches is the bulk of my debugging a real 
time program.

You don't think that they are swamped 100 fold by event synchronisation 
problems?

>>> STL is not really hard to use.
>> No it's not hard to use, but it is like 1000 discrete facts long.  And
>> the tests always ask you about the most obscure ones.
>
> I've found cppreference.com to have enough info to use STL effectively.
>
>> at 2 minutes per question you don't have enough time for more that a
>> cursory glance
>
> In that case they're trying to check your experience level.

except that IME of working on genuine projects, ability at C++ programming 
in real world use does not correlate with whether you know all the new 
features of the latest standard.

I've worked with so really good people who coded entirely to the 99 version

OTOH, I've recently worked with someone who could (more or less) quote you 
the complete set of additions in the '11 standard (and explain why they were 
there).  Yet he was CFU when it came to actually coding a solution to a 
problem

your choice

tim



 

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 19:21 +0200
  Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-15 10:36 -0700
    Re: reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 19:48 +0200
      Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-15 21:25 +0100
        Re: reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 23:28 +0200
          Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-15 23:40 +0100
  Re: reasons for preferring C over C++ Don Y <this@is.not.me.com> - 2014-10-15 10:58 -0700
  Re: reasons for preferring C over C++ upsidedown@downunder.com - 2014-10-15 21:03 +0300
    Re: reasons for preferring C over C++ Don Y <this@is.not.me.com> - 2014-10-15 11:11 -0700
    Re: reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 20:26 +0200
  Re: reasons for preferring C over C++ Stefan Reuther <stefan.news@arcor.de> - 2014-10-15 20:44 +0200
    Re: reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 23:30 +0200
      Re: reasons for preferring C over C++ Stefan Reuther <stefan.news@arcor.de> - 2014-10-16 18:19 +0200
        Re: reasons for preferring C over C++ Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-10-16 23:12 +0200
          Re: reasons for preferring C over C++ Reinhardt Behm <rbehm@hushmail.com> - 2014-10-17 13:25 +0800
          Re: reasons for preferring C over C++ Stefan Reuther <stefan.news@arcor.de> - 2014-10-17 18:43 +0200
    Re: reasons for preferring C over C++ "tim....." <tims_new_home@yahoo.co.uk> - 2014-10-18 12:29 +0100
      Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-18 11:44 -0700
        Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-18 22:25 +0100
          Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-18 15:42 -0700
            Re: reasons for preferring C over C++ Niklas Holsti <niklas.holsti@tidorum.invalid> - 2014-10-19 11:03 +0300
            Re: reasons for preferring C over C++ Tim Wescott <seemywebsite@myfooter.really> - 2014-10-19 17:46 -0500
              Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-19 16:28 -0700
              Re: reasons for preferring C over C++ Nobody <nobody@nowhere.invalid> - 2014-10-20 02:47 +0100
        Re: reasons for preferring C over C++ "tim....." <tims_new_home@yahoo.co.uk> - 2014-10-19 09:34 +0100
          Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-19 17:00 -0700
            Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-20 08:50 +0100
              Re: reasons for preferring C over C++ "tim....." <tims_new_home@yahoo.co.uk> - 2014-10-20 11:57 +0100
                Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-20 12:11 +0100
                Re: reasons for preferring C over C++ upsidedown@downunder.com - 2014-10-20 22:36 +0300
                Re: reasons for preferring C over C++ Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2014-10-21 00:36 +0000
            Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-20 08:52 +0100
            Re: reasons for preferring C over C++ "tim....." <tims_new_home@yahoo.co.uk> - 2014-10-20 11:56 +0100
        Re: reasons for preferring C over C++ Stefan Reuther <stefan.news@arcor.de> - 2014-10-19 10:52 +0200
          Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-19 17:16 -0700
      Re: reasons for preferring C over C++ glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 23:02 +0000
        Re: reasons for preferring C over C++ "tim....." <tims_new_home@yahoo.co.uk> - 2014-10-19 09:45 +0100
  Re: reasons for preferring C over C++ David Brown <david.brown@hesbynett.no> - 2014-10-15 22:12 +0200
    Re: reasons for preferring C over C++ Wouter van Ooijen <wouter@voti.nl> - 2014-10-15 23:35 +0200
      Re: reasons for preferring C over C++ Paul Rubin <no.email@nospam.invalid> - 2014-10-15 19:10 -0700
      Re: reasons for preferring C over C++ Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-10-16 10:34 +0300
        Re: reasons for preferring C over C++ Tom Gardner <spamjunk@blueyonder.co.uk> - 2014-10-16 10:10 +0100
  Re: reasons for preferring C over C++ Tim Wescott <tim@seemywebsite.com> - 2014-10-16 01:06 -0500
  Re: reasons for preferring C over C++ Anders.Montonen@kapsi.spam.stop.fi.invalid - 2014-10-16 08:32 +0000
    Re: reasons for preferring C over C++ David Brown <david.brown@hesbynett.no> - 2014-10-16 20:54 +0200

csiph-web