On 09/11/2019 18:03, Tim Rentsch wrote:
Ian Collins <[email protected]> writes:
On 06/11/2019 01:57, Thiago Adams wrote:
C is dangerous but it is simple. When you know the tool you
know exactly what the compiler is doing and you know from a long
time what is important to do and check. How to deal with the
details.
C++ is complex and nobody knows happens under the hood. This is why
site that shows the compiler output are so useful nowadays for C++
community.
C is not perfect and C++ is not so bad. Personally I wish I could
select some features from both and add some extra ones.
This is why I created my own C front end.
The complexity in a programming problem is a constant. You can solve
it in the C way with a large number of simple steps, which introduces
extra complexity in making sure they all work together. You can solve
it with fewer step in a higher level language, which introduces extra
complexity to the language. The overall complexity remains constant.
Mother Goose comes to comp.lang.c.
I assume by your recent tone that you have been smoking something...
Take a concrete example: resource management.
In C resource management is transparent but manual, the programmer has
to track what has been allocated and know when to free it. This, along
with the opportunity for error, gets quite complex when a resource is
shared, especially between threads.
In C++, adding some extra complexity in the language (constructors and automatic object destruction) removes the complexity and the
opportunities for error from the user code.
The code is still doing the same work and may well compile down to
equivalent assembler. The overall complexity remains constant.
--
Ian.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)