Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #480583
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Newsgroups | sci.electronics.design |
| Subject | Re: Ping Tom Gardner et. al. |
| Date | 2017-10-06 16:32 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <or8464$vdb$1@dont-email.me> (permalink) |
| References | <kqABB.142601$po2.80988@fx36.iad> <or7bpu$efd$1@dont-email.me> <2bJBB.1080790$uh.251387@fx28.am4> <or7slj$5lc$1@dont-email.me> <N2LBB.452713$dT2.429787@fx05.am4> |
On 06/10/17 14:55, Tom Gardner wrote: > On 06/10/17 13:24, David Brown wrote: >> On 06/10/17 12:47, Tom Gardner wrote: >>> On 06/10/17 08:36, David Brown wrote: >>>> and while >>>> everything works correctly (it's easy to check), your code review folks >>>> are sticking hot pokers in their eyes to avoid looking at it. >>> >>> And that, in a nutshell, is one problem with C/C++ >>> >> >> There are two solutions to it. One is that when a feature appears >> useful but cumbersome, C++ evolves to make it simpler. Examples include >> recursive template programming (replaced by variadic templates and >> generalised constexpr functions), the safe boolean idiom (replaced by >> explicit conversion operators), and "enable_if" templates (replaced by >> concepts). >> >> (If those terms don't mean anything to you, you should question how >> valid your opinions on C++ are without knowledge of the modern language.) >> >> The other solution is to realise that you can program in C++ without >> understanding all the fiddly and complex bits - you can leave those to >> the folks writing libraries. This is the same in most programming >> languages. > > Just so. > > But that doesn't affect the point; C++ descends into being > a write-only state more easily than other equally powerful > languages. 1. I know of no languages with the breadth of features, the breadth of programming styles, and the breadth of target application types, than C++. I don't know what you could compare it to here. 2. All languages are write only when you are not familiar with them, or at least with similar languages. 3. A skilled obfuscater can write write-only code in any language quite easily. > > Yes, it is entirely possible to write code that is clear, > simple, and easy to read. Not everybody achieves that. > Not everybody is a good programmer. Not even all professional programmers are good programmers. It is fair to say that as it is a bigger language, it takes longer to be a good C++ programmer than a good C programmer. It is perhaps also fair to say that for the same reason, a bad C++ programmer can make a bigger mess than a bad C programmer. But I have seen enough bad C code to know that a small language does not mean clearer or better code. > >>>> So C++11 allows some fancy tricks like, but they should not be used >>>> until C++14 and generalised constexpr functions. (I can't remember >>>> off-hand if gcc 5.3 supports that - I /think/ it does.) >>> >>> And that, in a nutshell, is one recurring problem with C/C++ >> >> If you want to use modern features, use a modern compiler. I don't >> track all features and all versions of gcc in my head - but I know how >> to look it up. It is not hard. > > The real nasty is that frequently C/C++ compilers > implement /a/ subset of a standard, where the subset > depends on what is convenient and what the compiler > writers understand. There is no "real nasty" about it. It usually takes time between a standard being published, and compilers having full support for it. If you want to write code that requires C++14, you can look at the documentation for your compiler and version to see if it supports it. And you give the compiler a command-line flag to match. If you want to compile C++14 code with gcc, you write "g++ -std=c++14" or "g++ -std=gnu++14" (for gcc extensions). If the compiler does not support it, it tells you. If you want experimental partial support for newer features, look up the flags to enable that. Both C and C++ standards go to extraordinary lengths to support backward compatibility, so that old code still works with newer compilers and newer standards. > > ISTR a triumphant announcement that the first complete > C++ compiler was available, 4/5/6 years after the > standard was published. The first C++ compiler (Cfront from 1983) was available long before the first C++ standard was published (C++98, in 1998). The first unofficial sort-of-standard was the 1985 book "The C++ Programming Language". gcc supported C++ from 1987. In the early days of C++, it took a while for new features to be properly implemented on a range of compilers. They are a lot better now. The serious C++ compilers (gcc, clang, MSVC, EDG front end) all have full support for C++14. gcc and clang have full support for C++17 (which was finished a few months ago, but I think is still not officially published). > > >>> Choose your poison carefully :) > >
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Ping Tom Gardner et. al. bitrex <bitrex@de.lete.earthlink.net> - 2017-10-05 20:49 -0400
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 09:36 +0200
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 11:18 +0200
Re: Ping Tom Gardner et. al. bitrex <bitrex@de.lete.earthlink.net> - 2017-10-06 05:59 -0400
Re: Ping Tom Gardner et. al. bitrex <bitrex@de.lete.earthlink.net> - 2017-10-06 06:05 -0400
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 12:20 +0200
Re: Ping Tom Gardner et. al. Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-06 11:47 +0100
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 14:24 +0200
Re: Ping Tom Gardner et. al. Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-06 13:55 +0100
Re: Ping Tom Gardner et. al. bitrex <bitrex@de.lete.earthlink.net> - 2017-10-06 09:12 -0400
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 16:37 +0200
Re: Ping Tom Gardner et. al. Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-06 15:50 +0100
Re: Ping Tom Gardner et. al. bitrex <bitrex@de.lete.earthlink.net> - 2017-10-06 14:02 -0400
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-06 16:32 +0200
Re: Ping Tom Gardner et. al. Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-06 17:44 +0100
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-16 11:18 +0200
Re: Ping Tom Gardner et. al. Jasen Betts <jasen@xnet.co.nz> - 2017-10-09 07:58 +0000
Re: Ping Tom Gardner et. al. David Brown <david.brown@hesbynett.no> - 2017-10-16 11:23 +0200
csiph-web