Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Bartc <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: a style question: |
| Date | 2015-09-01 18:06 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <ms4lr9$dih$1@dont-email.me> (permalink) |
| References | (3 earlier) <d4josjFqhdfU8@mid.individual.net> <ms2do6$d72$1@dont-email.me> <d4k6i5Ff37rU1@mid.uni-berlin.de> <ms2qfd$v8c$1@dont-email.me> <d4lu84Fr132U1@mid.uni-berlin.de> |
On 01/09/2015 16:23, Jens Thoms Toerring wrote: > Bartc <bc@freeuk.com> wrote: >> What sort of things? > > You've been told by not too small a number of people (and given > all kinds of examples) that e.g. the ability to create new types > that are aligned to the problem you have to solve and having them > treated on the same footing as built-in types is one of them. > And that, in turn, requires operator overloading. And to make > creation of types really powerful you need templates. With all > this you can extend the language to be able to deal with pro- > blems in the most simple and transparent way. But, IMO, the set of mechanisms to do all this is too intrusive and it dominates the language. From the C++ code I have seen, you don't usually end up with perfectly clear, clean-looking code. And you've been > told about the way memory issues can be dealt with in an auto- > matic manner that reduces the amount of code you've got to write > considerably and decreases the chance of introducing bugs and me- > mory leaks along the way. But you must give it a try to under- > stand it - just talking about it is like discussing colors with > someone who has decided to keep his eyes firmly shut all of his > life. > >> I normally use a dynamic language, which is actually quite low-level >> compared with some, that can do much of what C++ can do, and with none >> of the fuss. > > If that is true I'd very much tempted to try that language. Alas, > I've never seen any documentation for it, just some often inscru- > table code snippets you post from time to time. So I still have > to be convinced that you found the silver bullet. That language has been developed since the 1980s. It's a not very remarkable interpreted, dynamic language, yet it has always been able to deal with those memory problems you mention, and can handle flexible vectors, strings and bit-arrays and much more. It doesn't have general purpose OO features; one reason is that many of the problems for which they would be needed in C++, are already solved in the language (generics and polymorphism for example). (The main such requirement has actually been overloading 'to-string' for printing user types, and that can be done with a discreet mechanism to link a type with a function). >> In my position, I am unlikely to write or generate C++ code. But I >> sometimes need to interface to it, or to understand other people's code, >> or to convert it to a different language and for that purpose its >> features get in the way. Then, the less esoteric and abstract the better! > > Let me translate what you write into some equivalent example: > > I need some crucial information and have found out that it is > supposed to be contained in a book written in Spanish. Now I've > had several years of Latin in school as well as a bit of French, > and I got some exposure to Italian, all languages nearly related > to Spanish. But when I open that book it looks tantalizingly like > things I know, many words are ringing a bell etc., but I still > don't understand what's written. But instead of learning the re- > quired amount of Spanish (or getting some help with a trans- > lation) I start running around, telling everyone in sight what a > horrible language Spanish is and imply that anyone making the > effort to learn it must be a moron. If those damned Spaniards > wouldn't be such a bunch of arrogant bastards they'd use proper > words instead of inventing new ones, just to spite me! OK, let me try an analogy too. Suppose someone took assembly language and extended it by trying to add high level constructs, type systems and so on. And did it largely by devising a really complicated macro system. You would probably be bemused by the effort, mainly because the resulting language would be a poor imitation of a real HLL. The proper thing to do is to create a new, higher level language (eg. C). Then you do all your programming in this new language where all those features are built-in and can be used effortlessly without anyone being able to see the 'strings'. You probably won't need to write much assembly again. This is my view of C++: C with a very sophisticated macro system used to pretend it's a higher level language than it really is. But you can still see the strings. (Your own analogy is flawed I think; it wouldn't be Spanish I'd be complaining about, it would be Spanish written in legalese; the sort of language that gets in the way of the message.) -- Bartc
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
a style question: G G <gdotone@gmail.com> - 2015-08-31 02:30 -0700
Re: a style question: Ian Collins <ian-news@hotmail.com> - 2015-08-31 21:40 +1200
Re: a style question: jt@toerring.de (Jens Thoms Toerring) - 2015-08-31 09:52 +0000
Re: a style question: Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 03:24 -0700
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 11:50 +0100
Re: a style question: Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-31 13:21 +0100
Re: a style question: Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 05:41 -0700
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 14:55 +0100
Re: a style question: Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-31 15:50 +0100
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 18:40 +0100
Re: a style question: Melzzzzz <mel@zzzzz.com> - 2015-08-31 17:46 +0200
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 17:27 +0100
Re: a style question: Melzzzzz <mel@zzzzz.com> - 2015-08-31 18:42 +0200
Re: a style question: Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-08-31 17:41 +0000
Re: a style question: Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 15:33 -0700
Re: a style question: Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-01 08:34 +0000
Re: a style question: Ian Collins <ian-news@hotmail.com> - 2015-09-01 07:40 +1200
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 21:36 +0100
Re: a style question: Ian Collins <ian-news@hotmail.com> - 2015-09-01 08:51 +1200
Re: a style question: Bartc <bc@freeuk.com> - 2015-08-31 22:37 +0100
Re: a style question: Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 15:24 -0700
Re: a style question: Ian Collins <ian-news@hotmail.com> - 2015-09-02 19:37 +1200
Re: a style question: jt@toerring.de (Jens Thoms Toerring) - 2015-08-31 23:33 +0000
Re: a style question: Bartc <bc@freeuk.com> - 2015-09-01 01:13 +0100
Re: a style question: Ian Collins <ian-news@hotmail.com> - 2015-09-01 18:21 +1200
Re: a style question: jt@toerring.de (Jens Thoms Toerring) - 2015-09-01 15:23 +0000
Re: a style question: Bartc <bc@freeuk.com> - 2015-09-01 18:06 +0100
Re: a style question: Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-01 20:39 +0000
Re: a style question: jt@toerring.de (Jens Thoms Toerring) - 2015-09-01 20:45 +0000
Re: a style question: Bartc <bc@freeuk.com> - 2015-09-01 22:53 +0100
Re: a style question: Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-31 17:51 -0700
csiph-web