Welcome, Guest. Please login or register.

Author Topic: C vs C++ ... or whatever language  (Read 21358 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Einstein

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: C vs C++ ... or whatever language
« on: February 09, 2018, 09:49:52 PM »
Quote from: psxphill;835959
There are pros and cons to C, I watched some of the video and he doesn't seem to be objective enough. To me he sounds like he is in denial.


I write my (native) libs and apps in plain C. I'm happy. I considered, maybe twice after just playing, to migrate to C++, but realized that the features I actually required were provided by C already. I'm sure some people actually need C++ (instead of C) for the same reasons that I need C (instead tof asm, if we ignore portability) myself. Some people need C# (instead of C++). I wouldn't mind namespaces, I haven't needed templates, I cannot stand references, I despise operator overloading.
I have spoken !
 

Offline Einstein

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: C vs C++ ... or whatever language
« Reply #1 on: February 10, 2018, 10:47:29 AM »
@Thomas Richter

Indeed, and those features aren't required by me. I wouldn't mind namespaces as I mentioned, mostly to keep all native OS identifiers from polluting my "namespace". The not-too-many external libs I have used in the past have properly prefixed everything. But I have survived the single global namespace problem without introducing inconsistencies in my framework.

Regarding references, the perverted syntax of reusing the (1) "address of" operator for references, and doing so in the definition while (2) not requiring (explicit) syntax in the call is just unacceptable. Even if (an)other character(s) would be used in function definition/declaration-place, I still find it inconsistent with pointer syntax and harder to tell what is actually being passed by looking at caller code. Has there been a fix in newer C++ standards ? But like I wrote, I don't need them (and cannot stand them due to syntax).

Besides, I like to have my (C) habits easily translate over to asm land. With proper C++ habits, that would be much more inconvenient.
« Last Edit: February 10, 2018, 10:57:15 AM by Einstein »
I have spoken !
 

Offline Einstein

  • Sr. Member
  • ****
  • Join Date: Dec 2004
  • Posts: 402
    • Show all replies
Re: C vs C++ ... or whatever language
« Reply #2 on: February 10, 2018, 12:21:10 PM »
Quote from: Daytona675x;835989
@Einstein
Well, the whole C/C++ syntax is pretty perverted...
Actually I find the &-reference-syntax to be quite consistent with other C syntax madness ;) (e.g. try to explain the * madness to a C (or C++) student :P )
It's just a matter of getting used to it, some practice, nothing else.


Yes, both '*' and '&' already serve more than 1 usage, references only add yet another usage to '&'.
I have spoken !