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


Groups > comp.lang.c++ > #85804 > unrolled thread

To C or not to C++

Started byNOSPAM.Alan.Beck@darkrealms.ca (Alan Beck)
First post2022-08-08 09:43 +0000
Last post2022-08-27 23:15 -0700
Articles 14 on this page of 114 — 19 participants

Back to article view | Back to comp.lang.c++


Contents

  To C or not to C++ NOSPAM.Alan.Beck@darkrealms.ca (Alan Beck) - 2022-08-08 09:43 +0000
    Re: To C or not to C++ Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-08 20:02 +0300
    Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-09 05:38 +0000
      Re: To C or not to C++ Ralf Fassel <ralfixx@gmx.de> - 2022-08-09 11:07 +0200
        Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-10 02:25 +0200
          Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-09 17:52 -0700
            Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-09 21:39 -0700
              Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-10 07:45 +0000
            Re: To C or not to C++ scott@slp53.sl.home (Scott Lurndal) - 2022-08-10 19:50 +0000
              Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-10 13:13 -0700
              Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-11 04:29 +0200
          Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-10 02:41 +0000
          Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-10 07:39 +0000
            Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-10 10:11 -0700
              Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-12 08:23 +0000
                Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-12 12:12 +0000
                  Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-12 14:41 +0000
                    Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-12 12:09 -0700
                      Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-13 10:28 +0200
                      Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-13 09:37 +0000
                Re: To C or not to C++ Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-12 15:55 +0300
                  Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-12 14:43 +0000
                    Re: To C or not to C++ Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-12 18:07 +0300
                      Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-12 15:14 +0000
                        Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-12 12:11 -0700
                          Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-13 09:38 +0000
                            Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-13 17:56 +0200
                            Re: To C or not to C++ Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-24 11:32 +0300
                              Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-24 11:33 +0100
                                Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-24 04:37 -0700
                                  Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-24 13:31 +0100
                                Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-24 14:09 +0000
                                  Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-24 15:31 +0100
                                    Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-24 14:38 +0000
                                      Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-24 15:57 +0100
                                        Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-24 10:41 -0700
                                          Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-24 21:48 +0100
                                            Re: To C or not to C++ "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-25 07:34 +0200
                                              Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-25 11:29 +0100
                                                Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-25 04:14 -0700
                                                  Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-25 12:36 +0100
                                                    Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-25 05:16 -0700
                                                      Re: To C or not to C++ Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-25 17:16 +0100
                                                        Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-25 20:35 +0200
                                                          [OT] Bad CS course, no cookie (Was: To C or not to C++) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-25 21:32 +0100
                                                            Re: [OT] Bad CS course, no cookie (Was: To C or not to C++) David Brown <david.brown@hesbynett.no> - 2022-08-25 23:16 +0200
                                                              Re: [OT] Bad CS course, no cookie Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-26 00:33 +0100
                                                                Re: [OT] Bad CS course, no cookie David Brown <david.brown@hesbynett.no> - 2022-08-26 10:39 +0200
                                                                  Re: [OT] Bad CS course, no cookie Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-08-26 10:57 +0100
                                                                    Re: [OT] Bad CS course, no cookie David Brown <david.brown@hesbynett.no> - 2022-08-26 12:49 +0200
                                                          Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-25 19:56 -0700
                                                            Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-26 10:47 +0200
                                                              Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-26 02:48 -0700
                                                                Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-26 13:02 +0200
                                                                  Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-26 04:57 -0700
                                                                    Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-26 14:55 +0200
                                                                      Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-26 06:20 -0700
                                                                  Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-27 18:44 +0200
                                                                    Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-28 11:30 +0200
                                                      Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-25 10:06 -0700
                                                        Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-25 10:32 -0700
                                                          Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-25 11:36 -0700
                                                          Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-25 20:47 +0200
                                                Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-26 03:11 +0200
                                            Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-25 09:21 +0200
                                              Re: To C or not to C++ scott@slp53.sl.home (Scott Lurndal) - 2022-08-25 12:58 +0000
                                              Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-25 10:23 -0700
                                                Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-25 20:51 +0200
                                                  Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-25 12:14 -0700
                              Re: To C or not to C++ scott@slp53.sl.home (Scott Lurndal) - 2022-08-24 13:56 +0000
                                Re: To C or not to C++ Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-24 17:18 +0300
                                  Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-24 14:25 +0000
                      Re: To C or not to C++ scott@slp53.sl.home (Scott Lurndal) - 2022-08-12 16:46 +0000
                    Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-15 06:16 +0000
                      Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-15 19:01 +0000
                        Re: To C or not to C++ Bo Persson <bo@bo-persson.se> - 2022-08-15 22:22 +0200
                          Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-16 08:48 +0200
                            Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-16 19:19 +0000
                              Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-16 12:56 -0700
                                Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-17 18:47 +0000
                                  Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-17 14:49 -0700
                                    Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-18 14:49 +0000
                                      Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-19 03:10 +0200
                                        Re: To C or not to C++ d thiebaud <thiebauddick2@aol.com> - 2022-08-18 22:12 -0400
                                          Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-18 20:08 -0700
                                        Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-19 10:39 +0000
                              Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-17 06:45 +0000
                                Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-17 18:48 +0000
                          Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-16 19:16 +0000
                Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-12 12:03 -0700
          Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-10 10:13 +0200
            Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-11 04:25 +0200
              Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-11 01:03 -0700
              Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-11 08:11 +0000
              Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-11 13:53 +0200
                Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-13 04:13 +0200
                  Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-13 21:13 +0200
                    Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-13 12:29 -0700
                      Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-13 13:12 -0700
                      Re: To C or not to C++ David Brown <david.brown@hesbynett.no> - 2022-08-14 00:44 +0200
              Re: To C or not to C++ Öö Tiib <ootiib@hot.ee> - 2022-08-12 02:54 -0700
                Re: To C or not to C++ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-12 12:12 -0700
                  Re: To C or not to C++ Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-12 16:22 -0700
                  Re: To C or not to C++ Öö Tiib <ootiib@hot.ee> - 2022-08-12 17:49 -0700
                    Re: To C or not to C++ Manfred <noname@add.invalid> - 2022-08-13 03:16 +0200
                      Re: To C or not to C++ Öö Tiib <ootiib@hot.ee> - 2022-08-13 09:08 -0700
                      Re: To C or not to C++ Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-08-15 14:44 -0700
          Re: To C or not to C++ Ralf Fassel <ralfixx@gmx.de> - 2022-08-10 12:06 +0200
          Re: To C or not to C++ Juha Nieminen <nospam@thanks.invalid> - 2022-08-11 07:04 +0000
    Re: To C or not to C++ Bonita Montero <Bonita.Montero@gmail.com> - 2022-08-09 12:31 +0200
      Re: To C or not to C++ Muttley@dastardlyhq.com - 2022-08-09 15:59 +0000
      Re: To C or not to C++ Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-08-19 04:09 -0700
    Re: To C or not to C++ "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-08-13 12:17 -0700
    Re: To C or not to C++ "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-08-27 23:15 -0700

Page 6 of 6 — ← Prev page 1 2 3 4 5 [6]


#85867

FromÖö Tiib <ootiib@hot.ee>
Date2022-08-12 02:54 -0700
Message-ID<19c3945f-f9ef-44a1-a0f1-b80c39485fe3n@googlegroups.com>
In reply to#85842
On Thursday, 11 August 2022 at 05:26:05 UTC+3, Manfred wrote:
> On 8/10/2022 10:13 AM, David Brown wrote: 
> > On 10/08/2022 02:25, Manfred wrote: 

...
 
> >> If you are writing code that compiles both as C and C++, then you are 
> >> in fact writing C code, not C++. 
> > 
> > That's just silly.  You are, in fact, writing code that is C code /and/ 
> > C++ code.  It might not be idiomatic code, but it is perfectly valid.
> 
> Again, I disagree. And it is not silly. 
> 
> Let's take an example that makes some sense: you write some code that 
> involves a linked list (or any other container, for that matter) - 
> consider a C implementation and a C++ implementation. 
> 
> Are you seriously arguing that the C implementation is a C++ 
> implementation just as well? 
> (Please note that I /know/ that the C implementation would be legal C++ 
> code. I'm just saying that if you write such a C implementation in a C++ 
> program, then you are Doing It Wrong™)

Within single product variant tree it is good idea to use clear absolutes
and limits and compliances everywhere (like always, never, exactly one,
up to 200, C++14). That helps everybody involved to focus and narrow
what is done and how and under what constraints. 

There can be rather obvious reasons for such single product team to
choose writing some program for some process of said product in
common subset of for example C11 and C++11. So as result that
program is indeed both C11 program and C++11 program. What is
here even to argue? 

The code is unlikely to follow widespread idioms of programming in
either programming language. But saying that whatever was therefore
"done wrong" without being committed nor having clue what the product
does is silly™. How can one even dream to be capable to judge 
adequately?

[toc] | [prev] | [next] | [standalone]


#85897

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2022-08-12 12:12 -0700
Message-ID<87h72he0nb.fsf@nosuchdomain.example.com>
In reply to#85867
Öö Tiib <ootiib@hot.ee> writes:
[...]
> There can be rather obvious reasons for such single product team to
> choose writing some program for some process of said product in
> common subset of for example C11 and C++11. So as result that
> program is indeed both C11 program and C++11 program. What is
> here even to argue? 
>
> The code is unlikely to follow widespread idioms of programming in
> either programming language. But saying that whatever was therefore
> "done wrong" without being committed nor having clue what the product
> does is silly™. How can one even dream to be capable to judge 
> adequately?

I don't doubt that there can be valid reasons for writing code in the
common subset of C11 and C++11, but those reasons are not obvious.
Can you elaborate?

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#85899

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2022-08-12 16:22 -0700
Message-ID<59ae77b4-69fe-4a69-b93d-c1c405fcdcd9n@googlegroups.com>
In reply to#85897
On Friday, 12 August 2022 at 20:13:11 UTC+1, Keith Thompson wrote:
> Öö Tiib <oot...@hot.ee> writes: 
> [...]
> > There can be rather obvious reasons for such single product team to 
> > choose writing some program for some process of said product in 
> > common subset of for example C11 and C++11. So as result that 
> > program is indeed both C11 program and C++11 program. What is 
> > here even to argue? 
> > 
> > The code is unlikely to follow widespread idioms of programming in 
> > either programming language. But saying that whatever was therefore 
> > "done wrong" without being committed nor having clue what the product 
> > does is silly™. How can one even dream to be capable to judge 
> > adequately?
> I don't doubt that there can be valid reasons for writing code in the 
> common subset of C11 and C++11, but those reasons are not obvious. 
> Can you elaborate?
> 
You can toggle the files between C and C++ by changing the extension.
That can help if you're dealing with builds on many platforms.
For instance, you can often compile the program with a simple  cc *.c
But what if you've got cpp files that are not also C files? Now, quite
frequently, you've got to set up a build script to compile the c files,
compile the cpp files, and then link them. And that build script is something
that is liable to break.
So instead rename the c files to cpp files, and it's CC *.cpp.

[toc] | [prev] | [next] | [standalone]


#85901

FromÖö Tiib <ootiib@hot.ee>
Date2022-08-12 17:49 -0700
Message-ID<9f308371-ba3c-45f5-8aa7-115fcba460fbn@googlegroups.com>
In reply to#85897
On Friday, 12 August 2022 at 22:13:11 UTC+3, Keith Thompson wrote:
> Öö Tiib <oot...@hot.ee> writes: 
> [...]
> > There can be rather obvious reasons for such single product team to 
> > choose writing some program for some process of said product in 
> > common subset of for example C11 and C++11. So as result that 
> > program is indeed both C11 program and C++11 program. What is 
> > here even to argue? 
> > 
> > The code is unlikely to follow widespread idioms of programming in 
> > either programming language. But saying that whatever was therefore 
> > "done wrong" without being committed nor having clue what the product 
> > does is silly™. How can one even dream to be capable to judge 
> > adequately?
> I don't doubt that there can be valid reasons for writing code in the 
> common subset of C11 and C++11, but those reasons are not obvious. 
> Can you elaborate?

Sure. I mean the reasons are for the product team obvious. These are
not general reasons to use that common subset. Generally it is most
likely waste of effort but for concrete project it is logical solution. I
try to bring few examples that can make it obvious for them.
 
One of target devices where the process runs may have some reason
why C++ can't be used ... for example defective C++ runtime.
C++ is more restrictive about some things (like type safety). Team is
worried about those things. So they want to make it to build with
C++ just as static analysis.
There can be some tool in usage that reads code for some purpose
and generates something but does not work with C features outside
of common subset.
There may be available collaborators (with very important domain
knowledge) who are capable to learn that common subset quickly
enough but whole C++ would take too lot of months.

[toc] | [prev] | [next] | [standalone]


#85902

FromManfred <noname@add.invalid>
Date2022-08-13 03:16 +0200
Message-ID<td6u24$1uhr$1@gioia.aioe.org>
In reply to#85901
On 8/13/2022 2:49 AM, Öö Tiib wrote:
> On Friday, 12 August 2022 at 22:13:11 UTC+3, Keith Thompson wrote:
>> Öö Tiib <oot...@hot.ee> writes:
>> [...]
>>> There can be rather obvious reasons for such single product team to
>>> choose writing some program for some process of said product in
>>> common subset of for example C11 and C++11. So as result that
>>> program is indeed both C11 program and C++11 program. What is
>>> here even to argue?
>>>
>>> The code is unlikely to follow widespread idioms of programming in
>>> either programming language. But saying that whatever was therefore
>>> "done wrong" without being committed nor having clue what the product
>>> does is silly™. How can one even dream to be capable to judge
>>> adequately?
>> I don't doubt that there can be valid reasons for writing code in the
>> common subset of C11 and C++11, but those reasons are not obvious.
>> Can you elaborate?
> 
> Sure. I mean the reasons are for the product team obvious. These are
> not general reasons to use that common subset. Generally it is most
> likely waste of effort but for concrete project it is logical solution. I
> try to bring few examples that can make it obvious for them.
>   
> One of target devices where the process runs may have some reason
> why C++ can't be used ... for example defective C++ runtime.
> C++ is more restrictive about some things (like type safety). Team is
> worried about those things. So they want to make it to build with
> C++ just as static analysis.
> There can be some tool in usage that reads code for some purpose
> and generates something but does not work with C features outside
> of common subset.
> There may be available collaborators (with very important domain
> knowledge) who are capable to learn that common subset quickly
> enough but whole C++ would take too lot of months.

That's all fine, but if you are programming in the common subset of C 
and C++, then you are effectively programming in C, aren't you?
I mean, practically: with respect to C, you are excluding at most 5% of 
the language; with respect to C++ you are excluding at least 60% of the 
language.

Maybe I should make one thing clear, that I thought was in fact obvious:
I didn't say, and I don't believe, that C++ programming is good, as 
opposed to C programming being bad, not at all.

[toc] | [prev] | [next] | [standalone]


#85909

FromÖö Tiib <ootiib@hot.ee>
Date2022-08-13 09:08 -0700
Message-ID<d6154ac4-5dbb-4550-9f54-c68ce67cfe3cn@googlegroups.com>
In reply to#85902
On Saturday, 13 August 2022 at 04:17:14 UTC+3, Manfred wrote:
> On 8/13/2022 2:49 AM, Öö Tiib wrote: 
> > On Friday, 12 August 2022 at 22:13:11 UTC+3, Keith Thompson wrote: 
> >> Öö Tiib <oot...@hot.ee> writes: 
> >> [...] 
> >>> There can be rather obvious reasons for such single product team to 
> >>> choose writing some program for some process of said product in 
> >>> common subset of for example C11 and C++11. So as result that 
> >>> program is indeed both C11 program and C++11 program. What is 
> >>> here even to argue? 
> >>> 
> >>> The code is unlikely to follow widespread idioms of programming in 
> >>> either programming language. But saying that whatever was therefore 
> >>> "done wrong" without being committed nor having clue what the product 
> >>> does is silly™. How can one even dream to be capable to judge 
> >>> adequately? 
> >> I don't doubt that there can be valid reasons for writing code in the 
> >> common subset of C11 and C++11, but those reasons are not obvious. 
> >> Can you elaborate? 
> > 
> > Sure. I mean the reasons are for the product team obvious. These are 
> > not general reasons to use that common subset. Generally it is most 
> > likely waste of effort but for concrete project it is logical solution. I 
> > try to bring few examples that can make it obvious for them. 
> > 
> > One of target devices where the process runs may have some reason 
> > why C++ can't be used ... for example defective C++ runtime. 
> > C++ is more restrictive about some things (like type safety). Team is 
> > worried about those things. So they want to make it to build with 
> > C++ just as static analysis. 
> > There can be some tool in usage that reads code for some purpose 
> > and generates something but does not work with C features outside 
> > of common subset. 
> > There may be available collaborators (with very important domain 
> > knowledge) who are capable to learn that common subset quickly 
> > enough but whole C++ would take too lot of months.
> 
> That's all fine, but if you are programming in the common subset of C 
> and C++, then you are effectively programming in C, aren't you? 
> I mean, practically: with respect to C, you are excluding at most 5% of 
> the language; with respect to C++ you are excluding at least 60% of the 
> language. 

You are right that it  is closer to C than to C++ because C++ is just lot
bigger programming language. It is trivially true.
Why to name it C? It takes more effort than to program in C. There is
little area of possible code that compiles on both but behavior will
differ. Such code may not be used despite compilers are silent. Can
say compatible subset or common subset as that causes less confusion. 

> 
> Maybe I should make one thing clear, that I thought was in fact obvious: 
> I didn't say, and I don't believe, that C++ programming is good, as 
> opposed to C programming being bad, not at all.

Good. Usage of engineering tool is not good or bad, it is tool. Result
can be good or bad, right or wrong, benevolent or evil but that does not
depend on tool.
 

[toc] | [prev] | [next] | [standalone]


#85951

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2022-08-15 14:44 -0700
Message-ID<86bksluqpu.fsf@linuxsc.com>
In reply to#85902
Manfred <noname@add.invalid> writes:

> [...] if you are programming in the common subset of C
> and C++, then you are effectively programming in C, aren't you?

In my experience programming in the common subset of C and C++ is
much more like programming in an annoyingly braindamaged subset of C
than it is like programming in C.

> I mean, practically:  with respect to C, you are excluding at most 5%
> of the language;  [...]

Unfortunately excluding 5% of the language ends up excluding 95+% of
the programs (and probably more for programs of any reasonable size).
I think no C programmer naturally writes C programs that fall into
the common subset of C and C++, except by accident, and that happens
only rarely, and in small programs.

[toc] | [prev] | [next] | [standalone]


#85835

FromRalf Fassel <ralfixx@gmx.de>
Date2022-08-10 12:06 +0200
Message-ID<ygabkssmmzm.fsf@akutech.de>
In reply to#85819
* Manfred <noname@add.invalid>
| > On the Arduino, you usually only write the loop() (in C/C++)
>
| Note that the expression (C/C++) is considered a Bad Word nowadays.
--<snip-snip>--
>
| It may or may not be important to you, but if you show up at a job
| interview talking about C/C++, you will effectively show up as someone
| who does not know what they are talking about, so beware.

Thanks for the hint.  I indeed meant "C or C++" instead of implying
C and C++ are somehow interchangeable.

R', time to stop trying to save bandwidth, I guess .-)

[toc] | [prev] | [next] | [standalone]


#85846

FromJuha Nieminen <nospam@thanks.invalid>
Date2022-08-11 07:04 +0000
Message-ID<td29le$qfa$1@gioia.aioe.org>
In reply to#85819
Manfred <noname@add.invalid> wrote:
> Note that the expression (C/C++) is considered a Bad Word nowadays.

I think pointing that out is quite nitpicky.

I believe the vast majority of people are using "C/C++" in a similar
manner as they would use eg. "and/or".

In other words, "C/C++" is simply shorthand for "C or C++ (inclusive)".

[toc] | [prev] | [next] | [standalone]


#85811

FromBonita Montero <Bonita.Montero@gmail.com>
Date2022-08-09 12:31 +0200
Message-ID<tctcuv$1c631$1@dont-email.me>
In reply to#85804
Am 08.08.2022 um 09:43 schrieb Alan Beck:
> 
> //Hello All,//
> 
> I decided I wanted to learn C programming so  I can solve problems with
> software instead of hardware.
> 
> I have an arduino and am learning it.
> 
> 
> Shouod I be learing C,C++ or Arduino "sketch" language.
> 
> I have books for all three.l
> 
> Thand beforo hand

You can program an Arduino with a limited C++-subset but
I don't see any use in that because Arduino programs are
always very small.

[toc] | [prev] | [next] | [standalone]


#85812

FromMuttley@dastardlyhq.com
Date2022-08-09 15:59 +0000
Message-ID<tcu09s$53d$1@gioia.aioe.org>
In reply to#85811
On Tue, 9 Aug 2022 12:31:07 +0200
Bonita Montero <Bonita.Montero@gmail.com> wrote:
>Am 08.08.2022 um 09:43 schrieb Alan Beck:
>> 
>> //Hello All,//
>> 
>> I decided I wanted to learn C programming so  I can solve problems with
>> software instead of hardware.
>> 
>> I have an arduino and am learning it.
>> 
>> 
>> Shouod I be learing C,C++ or Arduino "sketch" language.
>> 
>> I have books for all three.l
>> 
>> Thand beforo hand
>
>You can program an Arduino with a limited C++-subset but

AFAIK the Arduino IDE just uses gcc with main() somehow built in already
(anyone know how it does it, just an .h file include or something more?) and
useful bits of C++ such as the STL left out because the binary wouldn't
have a chance of fitting in the arduinos memory.

[toc] | [prev] | [next] | [standalone]


#85998

FromFrederick Virchanza Gotham <cauldwell.thomas@gmail.com>
Date2022-08-19 04:09 -0700
Message-ID<55e68fad-e152-44be-b63a-779911f07e6en@googlegroups.com>
In reply to#85811
On Tuesday, August 9, 2022 at 11:30:07 AM UTC+1, Bonita Montero wrote:

> You can program an Arduino with a limited C++-subset but 
> I don't see any use in that because Arduino programs are 
> always very small.


In my day job I program microcontrollers in C++. One is Arduino and the other is Texas Instruments.

It's rare that there's something missing from the standard library that I need. I just write normal C++ code for these two microcontrollers.

I have 512 kB for program code and constants, and 92 kB of RAM. So far I've been able to write pretty complicated programs and only use about a quarter of the memory available. Lately in my day job I'm writing C++ code to move galvoes to direct a laser beam to draw patterns on glass.

Also if I did need more than 512 kB or 92 kB, I can connect a separate chip. (I can even use some of the onboard 512 kB as RAM if I want to).

[toc] | [prev] | [next] | [standalone]


#85913

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-08-13 12:17 -0700
Message-ID<td8tcd$2t5t2$1@dont-email.me>
In reply to#85804
On 8/8/2022 9:43 AM, Alan Beck wrote:
> 
> //Hello All,//
> 
> I decided I wanted to learn C programming so  I can solve problems with
> software instead of hardware.
> 
> I have an arduino and am learning it.
> 
> 
> Shouod I be learing C,C++ or Arduino "sketch" language.
> 
> I have books for all three.l
> 
> Thand beforo hand

Personally, I would learn C++ first even though I learned C first. Or, 
you can stage it. Learn C first, then C++. C gave me a foundation to 
understand the advantages of C++...

[toc] | [prev] | [next] | [standalone]


#86129

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-08-27 23:15 -0700
Message-ID<tef15d$id0f$1@dont-email.me>
In reply to#85804
On 8/8/2022 9:43 AM, Alan Beck wrote:
> 
> //Hello All,//
> 
> I decided I wanted to learn C programming so  I can solve problems with
> software instead of hardware.
> 
> I have an arduino and am learning it.
> 
> 
> Shouod I be learing C,C++ or Arduino "sketch" language.
> 
> I have books for all three.l
> 
> Thand beforo hand

To C or not to C... Well, actually, I just might have to design a plugin 
interface and I would want C bindings. An end user can program a plugin 
in C, C++, C#, ect... I just need to design the C API and 
data-structures. So, I choose to use C for the raw plugin logic API.

[toc] | [prev] | [standalone]


Page 6 of 6 — ← Prev page 1 2 3 4 5 [6]

Back to top | Article view | comp.lang.c++


csiph-web