View mode: basic / threaded / horizontal-split · Log in · Help
July 21, 2012
Re: Just where has this language gone wrong?
Let me just add, I really *like* the terse syntax of D. Lambdas, 
uniform function call syntax, and so on.

Although the most important difference between C++ and D, in my 
opinion, is the absence of the damn #include statement!! That 
archaic assembly-language-inspired way of cramming billions of 
lines of code into a single text document; then compiling it; and 
then bitching about redefined symbols and incompatibilities 
between headers has caused me more hours of hair-tearing 
frustration than any single other language "feature".

Garbage-collection I can live without. Closures, properties and 
events I really miss when they're not available. But header files 
were the single worst thing to ever befall coders.
July 21, 2012
Re: Just where has this language gone wrong?
On Sat, 21 Jul 2012 23:14:12 +0200
"Stuart" <stugol@gmx.com> wrote:
> Let me just add, I really *like* the terse syntax of D. Lambdas, 
> uniform function call syntax, and so on.
> 

Yea. I used Java in college and ever since then I've been a fan of
non-verbose systax - ie syntax that's the *opposite* of Java ;)

> 
> Garbage-collection I can live without. Closures, properties and 
> events I really miss when they're not available. But header files 
> were the single worst thing to ever befall coders.

I agree, a proper module system was one of the first, biggest things
that drew me to D - It was one of the handful of things Java actually
got *right* compared to C++ (another big one being reference semantics
for classes). When I use C++, a proper module system is one of the
biggest things I miss.

Aside from the issues you mention, there's another big benefit to
killing off the #include system and switching to D: Type names and other
identifiers aren't cluttered up with the noise of a make-shift module
system. (Yea, there's namespaces, but not everyone seems to use them.
I assume there's probably good reasons for that...besides easier
integration with D ;) )

For example, I'm using the IwGame C++ library
( http://www.drmop.com/index.php/iwgame-engine/ ) and fucking *EVERY*
type name is prefixed with "CIwGame...". And anything from the
underlying Marmalade starts with "CIw..." so basic vectors are
named convoluted shit like "CIwFVec2". Of course, this is on top of the
fact that until C++11 becomes more widespread there isn't a damn bit of
type inference anywhere, so those horrific full names have to be used
EVERYWHERE. With a proper module system like D's, there'd be no
problem with names like "ImageActor" and "FVec2" instead of
"CIwGameImageActor" and "CIwFVec2", because conflicts could be easily
detected and dealt with.

And of course the other real obvious benefit of killing #include: None
of that separate cpp/h file bullshit.

C++ is living in the 70's. It should have a mascot wearing a leisure
suit.
July 21, 2012
Re: Just where has this language gone wrong?
On 7/21/12 6:16 PM, Nick Sabalausky wrote:
> Yea. I used Java in college and ever since then I've been a fan of
> non-verbose systax - ie syntax that's the *opposite* of Java ;)

On slide 19 of the OSCON slides there's this sample:

auto s = ["abc", "a", "xz"];
auto m = s.argmin!((x) => x.length);

People in the audience were quite pleasantly surprised to figure that 
although there's no mention of a type, that code is all the compiler 
needs to figure there's a lambda that takes a string and returns an 
unsigned integer etc.


Andrei
July 21, 2012
Re: Just where has this language gone wrong?
On Sat, 21 Jul 2012 18:24:04 -0400
Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:

> On 7/21/12 6:16 PM, Nick Sabalausky wrote:
> > Yea. I used Java in college and ever since then I've been a fan of
> > non-verbose systax - ie syntax that's the *opposite* of Java ;)
> 
> On slide 19 of the OSCON slides there's this sample:
> 
> auto s = ["abc", "a", "xz"];
> auto m = s.argmin!((x) => x.length);
> 
> People in the audience were quite pleasantly surprised to figure that 
> although there's no mention of a type, that code is all the compiler 
> needs to figure there's a lambda that takes a string and returns an 
> unsigned integer etc.
> 

Exactly. And what many people (depressingly) don't realize, is
that dynamic typing (or OO boxing) is NOT needed to achieve that.

I was actually impressed with that slide, too, but for a different
reason: I've come across need for a function like argmin on occasion,
but I didn't know it existed (Don't recall if it was actually in D, may
have been another language I was using). That really is a fantastically
useful function.
July 22, 2012
Re: Just where has this language gone wrong?
Nick Sabalausky wrote:
> On Sat, 21 Jul 2012 18:24:04 -0400
> Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
> 
> > On 7/21/12 6:16 PM, Nick Sabalausky wrote:
> > > Yea. I used Java in college and ever since then I've been a fan of
> > > non-verbose systax - ie syntax that's the *opposite* of Java ;)
> > 
> > On slide 19 of the OSCON slides there's this sample:
> > 
> > auto s = ["abc", "a", "xz"];
> > auto m = s.argmin!((x) => x.length);
> > 
> > People in the audience were quite pleasantly surprised to figure that 
> > although there's no mention of a type, that code is all the compiler 
> > needs to figure there's a lambda that takes a string and returns an 
> > unsigned integer etc.
> > 
> 
> Exactly. And what many people (depressingly) don't realize, is
> that dynamic typing (or OO boxing) is NOT needed to achieve that.
> 
> I was actually impressed with that slide, too, but for a different
> reason: I've come across need for a function like argmin on occasion,
> but I didn't know it existed (Don't recall if it was actually in D, may
> have been another language I was using). That really is a fantastically
> useful function.

Where is argmin defined? I couldn't find it.

Jens
July 22, 2012
Re: Just where has this language gone wrong?
On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote:
>
> Where is argmin defined? I couldn't find it.
>
> Jens

Argmin don't exist, but it could, and that's what counts. The
important thing in these slides is proof of concept, rather than
actual code snippets.

However, std.algorithm does have minPos, but it works a little
differently. For starters, it requires a binary pred, as opposed
to an unary weight function. second, it returns a range.

Anyways, this gets you the same result:

auto m = s.minPos!((a, b) => a.length < b.length).front;
July 22, 2012
Re: Just where has this language gone wrong?
On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote:
> Where is argmin defined? I couldn't find it.

On the slide before that… ;)

David
July 22, 2012
Re: Just where has this language gone wrong?
Am 22.07.2012 00:16, schrieb Nick Sabalausky:
> On Sat, 21 Jul 2012 23:14:12 +0200
> "Stuart"<stugol@gmx.com>  wrote:
>> Let me just add, I really *like* the terse syntax of D. Lambdas,
>> uniform function call syntax, and so on.
>>
>
> Yea. I used Java in college and ever since then I've been a fan of
> non-verbose systax - ie syntax that's the *opposite* of Java ;)
>

Actually that verbose sintax is quite helpful when dealing with gigantic
code bases in big corporation projects like where I work.

The type of "programmer clogs" we have in our projects are so low skill,
that I have bad dreams what they could do in more powerfull languages.

Already C# is highly advanced for some of them!

What I hate in Java is the abuse of annotations to avoid introducing new
keyworks, like @overload. This recalls me of a software project where 
the DSL in use, got so many annotations that it become unmanageable.

>>
>> Garbage-collection I can live without. Closures, properties and
>> events I really miss when they're not available. But header files
>> were the single worst thing to ever befall coders.
>
> I agree, a proper module system was one of the first, biggest things
> that drew me to D - It was one of the handful of things Java actually
> got *right* compared to C++ (another big one being reference semantics
> for classes). When I use C++, a proper module system is one of the
> biggest things I miss.
>
> Aside from the issues you mention, there's another big benefit to
> killing off the #include system and switching to D: Type names and other
> identifiers aren't cluttered up with the noise of a make-shift module
> system. (Yea, there's namespaces, but not everyone seems to use them.
> I assume there's probably good reasons for that...besides easier
> integration with D ;) )

Legacy code. As some compilers took several years to fully support the
standard. This was one of the things that got my interest in Java back 
in 1996.

Finally a C++ like language, where I could make use of modern C++ 
features, without getting the source code full of #ifdef.

>
> For example, I'm using the IwGame C++ library
> ( http://www.drmop.com/index.php/iwgame-engine/ ) and fucking *EVERY*
> type name is prefixed with "CIwGame...". And anything from the
> underlying Marmalade starts with "CIw..." so basic vectors are
> named convoluted shit like "CIwFVec2". Of course, this is on top of the
> fact that until C++11 becomes more widespread there isn't a damn bit of
> type inference anywhere, so those horrific full names have to be used
> EVERYWHERE. With a proper module system like D's, there'd be no
> problem with names like "ImageActor" and "FVec2" instead of
> "CIwGameImageActor" and "CIwFVec2", because conflicts could be easily
> detected and dealt with.
>
> And of course the other real obvious benefit of killing #include: None
> of that separate cpp/h file bullshit.
>
> C++ is living in the 70's. It should have a mascot wearing a leisure
> suit.
>

Very true.

I never understood why C++ could not have a module system. It would 
still be possible to compile C code anyway. In fact, in Turbo Pascal you
get both, a preprocessor with includes and modules(units).

The sad thing is that most languages designed in the early 80's all had
proper modules.

--
Paulo
July 22, 2012
Re: Just where has this language gone wrong?
On Sun, 22 Jul 2012 20:24:19 +0200
Paulo Pinto <pjmlp@progtools.org> wrote:

> Am 22.07.2012 00:16, schrieb Nick Sabalausky:
> > On Sat, 21 Jul 2012 23:14:12 +0200
> > "Stuart"<stugol@gmx.com>  wrote:
> >> Let me just add, I really *like* the terse syntax of D. Lambdas,
> >> uniform function call syntax, and so on.
> >>
> >
> > Yea. I used Java in college and ever since then I've been a fan of
> > non-verbose systax - ie syntax that's the *opposite* of Java ;)
> >
> 
> Actually that verbose sintax is quite helpful when dealing with
> gigantic code bases in big corporation projects like where I work.
> 
> The type of "programmer clogs" we have in our projects are so low
> skill, that I have bad dreams what they could do in more powerfull
> languages.
> 
> Already C# is highly advanced for some of them!
> 

Yea, I've dealt with far too many such "programmers" myself. I'm
convinced, no hyperbole, that such people need to be unemployed (I hear
McDonald's is always looking for mindless drones.) All they ever do is
fuck things up, get in the way, make 100x more work for the rest of us,
and collect a salary for THAT. And then get promoted to management
where they can do even more damage (at least it gets their inept,
retarded ass out of the fucking codebase).

Yea, I have no sympathy for such...subhumans.

And the whole reason those societal leeches ever gets hired in the first
place is because the even MORE retarded HR fuckwads actually look
specifically FOR revolving-door-moron-certificates (aka "college
degree") and 500 years experience in *one and ONLY one* language and
it's inevitably something rancid like PHP.

If they would just kick these fucks out in the street where they
belong (and I genuinely mean that), then productivity would skyrocket,
costs would plummet, and there's be no need for such kiddie, retard,
"tricycle *with* training wheels" languages like Java.
July 22, 2012
Re: Just where has this language gone wrong?
On 7/22/12 12:32 PM, David Nadlinger wrote:
> On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote:
>> Where is argmin defined? I couldn't find it.
>
> On the slide before that… ;)

I think argmin is intuitive, popular, and useful enough to warrant a 
presence in std.algorithm. Would anyone want to do the honors?


Thanks,

Andrei
2 3 4 5 6 7 8 9 10
Top | Discussion index | About this forum | D home