May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | Am 26.05.2013 11:28, schrieb Nick Sabalausky: > On Sat, 25 May 2013 22:44:52 -0700 > "H. S. Teoh" <hsteoh@quickfur.ath.cx> wrote: >> >> Like I've said many times before, the only way I found coding in C++ >> tolerable was to use it as "C with classes". Trying to do real OO in >> C++ is an exercise in masochism. Even Java with its baroque verbosity >> and prolific boilerplates beats C++ hands-down in this respect. >> > > I always used to consider myself comfortable with C/C++ until I came > across Java. > > To mix metaphors, that was a double-edged eye-opener: Java (this was > circa v1.2-v1.4) taught me everything that was wrong with C++'s classes > and *cough* module system, but it *also* taught me that Java wasn't > the answer either. ;) > For me the deal break was that it worked more or less the same everywhere, while keeping a C++ feeling. Plus it had a module system reminiscent of Pascal family of languages, and back then I was already impressed with GC enabled systems programming languages thanks to Native Oberon operating system. Did you had the pleasure to write portable C or C++ code across multiple operating systems and vendors in the mid 90's? Welcome to #ifdef spaghetti code and reluctance of using certain features due to inconsistent support. -- Paulo |
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Sun, May 26, 2013 at 01:18:32PM +0200, Paulo Pinto wrote: [...] > Did you had the pleasure to write portable C or C++ code across multiple operating systems and vendors in the mid 90's? > > Welcome to #ifdef spaghetti code and reluctance of using certain features due to inconsistent support. [...] Ugh! Don't remind me. Right now at work I have a project that requires reading (yes, just reading) some heavily #ifdef'd code. It's a very, very, very painful experience. Not to mention function pointer spaghetti. One of the symptoms of switching from C++ back to C is that there's no polymorphic abstraction anymore, so the only way to have a sane polymorphic system is to use tables of function pointers everywhere. When a bug happens in some obscure corner of the code, it's hours and hours of hair-pulling to discover just which of 50 different function pointer initializations were in effect when the bug happened, for each of the 50 function pointers traversed before the buggy code. It's gotten to the point that every other line of code is a call through a function pointer, each of which has its own set of 50 or so different functions that it can potentially point to. It doesn't help that many of these function pointers are unhelpfully named. I'm quite near the point of losing my sanity just trying to figure out the control flow of the thing! Ah, if only this code were written in D... :-P T -- What doesn't kill me makes me stranger. |
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 5/26/2013 7:48 AM, H. S. Teoh wrote:
> Ah, if only this code were written in D... :-P
One possibility is to write the code in D, debug it, then recode the result in C to satisfy your customer.
(Don't dismiss this out of hand - I've seen this sort of thing done before. Back when I was programming hand-held LED games for Mattel (remember those?) the prototype was written for a 6502 single board computer that fit in a Samsonite briefcase. Once the gameplay and everything else was massaged to perfection, it was handed over to another group of engineers who translated it to work on the 4 bit computer that drove the actual handheld device.)
|
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Sun, 26 May 2013 13:18:32 +0200 Paulo Pinto <pjmlp@progtools.org> wrote: > > Did you had the pleasure to write portable C or C++ code across multiple operating systems and vendors in the mid 90's? > Luckily, no. For me it was just Win9x and DOS (using that awesome 32-bit extender DOOM and every other game of the time used, forget the name. DOS4GW?). And it was more mid-to-late 90's for me. (And then a little bit of PalmOS around 2000 or so.) > Welcome to #ifdef spaghetti code and reluctance of using certain features due to inconsistent support. > |
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Sun, 26 May 2013 11:51:24 -0700
Walter Bright <newshound2@digitalmars.com> wrote:
> On 5/26/2013 7:48 AM, H. S. Teoh wrote:
> > Ah, if only this code were written in D... :-P
>
> One possibility is to write the code in D, debug it, then recode the result in C to satisfy your customer.
>
> (Don't dismiss this out of hand - I've seen this sort of thing done before. Back when I was programming hand-held LED games for Mattel (remember those?)
>
You worked on those? That's really cool, my friends and I used to love those things (Or, actually, come to think of it, at that point they were all LCD, not LED - roughly late 80's IIRC). Most of the ones I had were "Tiger" brand though - was that part of Mattel or a competitor?
|
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 5/26/2013 12:56 PM, Nick Sabalausky wrote:
> On Sun, 26 May 2013 11:51:24 -0700
> Walter Bright <newshound2@digitalmars.com> wrote:
>
>> On 5/26/2013 7:48 AM, H. S. Teoh wrote:
>>> Ah, if only this code were written in D... :-P
>>
>> One possibility is to write the code in D, debug it, then recode the
>> result in C to satisfy your customer.
>>
>> (Don't dismiss this out of hand - I've seen this sort of thing done
>> before. Back when I was programming hand-held LED games for Mattel
>> (remember those?)
>>
>
> You worked on those? That's really cool, my friends and I used to love
> those things (Or, actually, come to think of it, at that point they
> were all LCD, not LED - roughly late 80's IIRC). Most of the ones I had
> were "Tiger" brand though - was that part of Mattel or a competitor?
>
Yeah, I did the 'Soccer' one. For minimum wage! It was in 1978 or so. The display was a grid of red LEDs.
|
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Sun, 26 May 2013 08:18:11 -0700 "H. S. Teoh" <hsteoh@quickfur.ath.cx> wrote: > Back then there was a lot of pressure to minimalize the language; nowadays we know better... No we don't. Some of us do, like those of us here in D-land. But from what I've seen there's still a *lot* of belief in keeping languages minimal. > > On Sun, May 26, 2013 at 05:22:18AM -0400, Nick Sabalausky wrote: > > > > I dunno. The more I learned about C++'s more advances features the more disillusioned I became with it. I was always happiest (or at least, least unhappy) with the "C with classes" form of C++. > > Have to agree with that. Though when templates first came out, they > were a huge thing for me. It was only later that it became clear that > the way C++ handled them was ... well, it left a lot to be > desired. :) When I got acquianted with D's templates, I was totally > blown away. It was like a veil was lifted and I saw for the first > time what a *real* template system ought to look like. > I always tended to avoid doing much of anything with C++ templates simply because they were still new at the time and the implementations were considered to still be somewhat buggy. Around the same time, I was noticing that using any of the newer, fancier, "better" features of C++ had a tendency to leave you needing to *also* start using all of the other fancier features, too, many of which were either awkward (being C++ and all) or known-buggy (the templates at the time). So that was a big part of what made me start loosing interest in C++. > C++11 (finally!) introduced lambdas > and type inference, and a bunch of other stuff, but ... meh. A lot of > it feels like "too little, too late". > Yea. I generally feel that, regardless of whether or not those involved are consciously thinking it, C++ is basically a rusty run-down old engine on two working cylinders that's...not trying to catch up with D, but just trying it's best not to fall too far behind, too quickly. |
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Sun, 26 May 2013 13:04:50 -0700
Walter Bright <newshound2@digitalmars.com> wrote:
> On 5/26/2013 12:56 PM, Nick Sabalausky wrote:
> > On Sun, 26 May 2013 11:51:24 -0700
> > Walter Bright <newshound2@digitalmars.com> wrote:
> >>
> >> (Don't dismiss this out of hand - I've seen this sort of thing done
> >> before. Back when I was programming hand-held LED games for Mattel
> >> (remember those?)
> >>
> >
> > You worked on those? That's really cool, my friends and I used to love those things (Or, actually, come to think of it, at that point they were all LCD, not LED - roughly late 80's IIRC). Most of the ones I had were "Tiger" brand though - was that part of Mattel or a competitor?
> >
>
> Yeah, I did the 'Soccer' one. For minimum wage! It was in 1978 or so. The display was a grid of red LEDs.
Cool. I did a couple of indie/budget games back in late high school, early college (roughly 1998-2002) for royalties that probably ended up working out to much less than minimum wage. But it still beat the hell out of McDonald's! ;)
|
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 5/26/2013 1:21 PM, Nick Sabalausky wrote:
> Cool. I did a couple of indie/budget games back in late high school,
> early college (roughly 1998-2002) for royalties that probably ended up
> working out to much less than minimum wage. But it still beat the hell
> out of McDonald's! ;)
That's true. I learned a hell of a lot - best min wage job I ever had! I did a whole bunch of embedded systems then, and they were real projects for real customers, not demonstration projects.
The company I was working for, Aph, could have been Microsoft. But they snatched defeat from the jaws of victory, and disappeared. Management simply had no idea what they had. (Of course, I had no idea at the time, either.)
|
May 26, 2013 Re: [article] Language Design Deal Breakers | ||||
---|---|---|---|---|
| ||||
On 26/05/13 15:44, H. S. Teoh wrote: > On Sun, May 26, 2013 at 01:27:55PM +1000, Peter Williams wrote: >> On 26/05/13 11:59, Nick Sabalausky wrote: > [...] >>> Forget waiting for a huge improvement, I'd have been happy to >>> ditch C++ even for a small improvement. C++ is such a pain IMO that >>> using it has about as much inertia as ice skates on concrete. >> >> I found shifting from C++ to C an improvement. (Yes, I learnt C++ >> before I learnt C.) I should mention that this was back in the mid >> 90s and C++ may have improved since then :-). > [...] > > You're not the only one who felt that way. At my day job we also > "upgraded" from C++ back to C. I've often ranted about our horrific > experience with a hugely over-engineered C++ system that can literally > do *anything*... except that nobody understood how to use the thing. It > had dtors with side-effects that did useful work, for instance, and > there were so many levels of abstraction it was bordering on insanity. > Once I had to make a function call to said horrible code... it involved > going through 6 layers of abstraction, two of which were fwrite()ing > function arguments to a temporary file, then fork() and exec()ing an > auxilliary utility that fread() the arguments back, and *then* > dispatched them across an IPC link... Makes debugging fun doesn't it? :-) > > We're now back in C-land, and boy the code is much cleaner, and > *faster*, even though it's a lot harder to read and more tedious to > maintain. > > Like I've said many times before, the only way I found coding in C++ > tolerable was to use it as "C with classes". Trying to do real OO in C++ > is an exercise in masochism. Even Java with its baroque verbosity and Amen to that. One reason I've avoided Java is that I found the signal to noise ratio in the source code VERY low and this made reading such code to find the bit that actually did something difficult. I am (or was), however, a fan of the Java Virtual Machine (JVM) because it offers "run anywhere" functionality. > prolific boilerplates beats C++ hands-down in this respect. And don't > even mention templates, which are already nasty enough to work with in > simple generic types; they are utter monstrosities when you start > getting into CTFE and compile-time codegen. D templates, CTFE, and > mixins, by contrast, are actually *pleasant* to work with. I agree. Although I'm still learning D I'm finding it a pleasure with a very high signal to noise ratio in source code. Plus most features just work like one wishes the would. Peter |
Copyright © 1999-2021 by the D Language Foundation