July 19, 2012
On 2012-07-19 16:50, Alex Rønne Petersen wrote:

> I suspect that you have a C++ background. If this is not accurate,
> ignore the rest. But if it is accurate, my plea to you is: Learn other
> languages. C++ has next to no innovative language features (even C++11's
> take on lambdas is an abomination) and encourages defensive programming
> to the point where it's ridiculous (I mean, no default initialization of
> variables? In 2012?).

In C++ it's even better (irony). It depends on what kind of variable is declared. I.e. a global variable, a local, instance or a class variable (static). Some of these are default initialized, some are not. I have no idea which are initialized and which are not.

-- 
/Jacob Carlborg


July 19, 2012
Am 19.07.2012 22:43, schrieb Jacob Carlborg:
> On 2012-07-19 16:50, Alex Rønne Petersen wrote:
>
>> I suspect that you have a C++ background. If this is not accurate,
>> ignore the rest. But if it is accurate, my plea to you is: Learn other
>> languages. C++ has next to no innovative language features (even C++11's
>> take on lambdas is an abomination) and encourages defensive programming
>> to the point where it's ridiculous (I mean, no default initialization of
>> variables? In 2012?).
>
> In C++ it's even better (irony). It depends on what kind of variable is
> declared. I.e. a global variable, a local, instance or a class variable
> (static). Some of these are default initialized, some are not. I have no
> idea which are initialized and which are not.
>

That is why any C or C++ project should have static analysis tools integrated in the continuous integration build system, plus compiling all warnings as errors.

--
Paulo
July 19, 2012
On 2012-07-19 17:03, Petr Janda wrote:
>> It's just syntax. Eliminating syntax noise is fine. Code should look
>> like what it does.
>
> Not if "eliminating noise" equals to making things harder to understand.
>
> When you say (int x) { return x; } it's clear about what it is, a
> _function_ without name.

It's equally clear when you see: =>.

-- 
/Jacob Carlborg


July 19, 2012
What the _fuck_ guys? How did you get this many posts on what is essentially "this looks weird and I can't be fucked reading the documentation?".
July 19, 2012
On 07/19/12 23:03, Bernard Helyer wrote:
> What the _fuck_ guys? How did you get this many posts on what is essentially "this looks weird and I can't be fucked reading the documentation?".

In other words, see subject.
July 19, 2012
On Thu, 19 Jul 2012 22:45:10 +0200
Paulo Pinto <pjmlp@progtools.org> wrote:

> Am 19.07.2012 22:43, schrieb Jacob Carlborg:
> > On 2012-07-19 16:50, Alex Rønne Petersen wrote:
> >
> >> I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination) and encourages defensive programming to the point where it's ridiculous (I mean, no default initialization of variables? In 2012?).
> >
> > In C++ it's even better (irony). It depends on what kind of variable is declared. I.e. a global variable, a local, instance or a class variable (static). Some of these are default initialized, some are not. I have no idea which are initialized and which are not.
> >
> 
> That is why any C or C++ project should have static analysis tools integrated in the continuous integration build system, plus compiling all warnings as errors.
> 

No, this is why any C/C++ project should be replaced by D ;)

I'm knee-deep in a C++ project right now, and the language is such a pedantic, anachronistic turd. C++'s *only* saving graces are:

- It's a systems language (ie, native compiled with low-level access).
- It isn't PHP, JS, a JS-derivitive (ex, ActionScript), or Son-Of-Flash
  (aka Corona).
- D isn't mature on all platforms yet.


July 19, 2012
> I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination) and encourages defensive programming to the point where it's ridiculous (I mean, no default initialization of variables? In 2012?).

Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have initialized it. IMO this is much better than D's "let's initialize doubles to NaN so that something fishy will happen at runtime if you forget to initialize it" :)

* technically the compiler asks the runtime to bitwise 0-fill everything, but that's just an implementation detail required for the .NET verifier, and the optimizer can ignore the request to preinitialize.
July 19, 2012
On Fri, 20 Jul 2012 00:32:03 +0200
"David Piepgrass" <qwertie256@gmail.com> wrote:

> > I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination) and encourages defensive programming to the point where it's ridiculous (I mean, no default initialization of variables? In 2012?).
> 
> Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have initialized it. IMO this is much better than D's "let's initialize doubles to NaN so that something fishy will happen at runtime if you forget to initialize it" :)
> 
> * technically the compiler asks the runtime to bitwise 0-fill everything, but that's just an implementation detail required for the .NET verifier, and the optimizer can ignore the request to preinitialize.

I've always wished D worked that way, too.

July 20, 2012
On 20/07/2012 00:49, Nick Sabalausky wrote:
> On Fri, 20 Jul 2012 00:32:03 +0200
> "David Piepgrass" <qwertie256@gmail.com> wrote:
>
>>> I suspect that you have a C++ background. If this is not
>>> accurate, ignore the rest. But if it is accurate, my plea to
>>> you is: Learn other languages. C++ has next to no innovative
>>> language features (even C++11's take on lambdas is an
>>> abomination) and encourages defensive programming to the point
>>> where it's ridiculous (I mean, no default initialization of
>>> variables? In 2012?).
>>
>> Actually, C# has no default initialization* of local variables,
>> and I love it. Instead, it is a compile-time error to read a
>> variable if the compiler cannot guarantee that you have
>> initialized it. IMO this is much better than D's "let's
>> initialize doubles to NaN so that something fishy will happen at
>> runtime if you forget to initialize it" :)
>>
>> * technically the compiler asks the runtime to bitwise 0-fill
>> everything, but that's just an implementation detail required for
>> the .NET verifier, and the optimizer can ignore the request to
>> preinitialize.
>
> I've always wished D worked that way, too.
>
vote++
July 20, 2012
On Thursday, 19 July 2012 at 22:32:04 UTC, David Piepgrass wrote:
>> I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination) and encourages defensive programming to the point where it's ridiculous (I mean, no default initialization of variables? In 2012?).
>
> Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have initialized it. IMO this is much better than D's "let's initialize doubles to NaN so that something fishy will happen at runtime if you forget to initialize it" :)
>
> * technically the compiler asks the runtime to bitwise 0-fill everything, but that's just an implementation detail required for the .NET verifier, and the optimizer can ignore the request to preinitialize.

It would be great if D did do this, surely it would not be all
that difficult! and wouldn't it also help in finding unused variables?