On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
AFAIKS
On Sunday, 2 March 2014 at 09:12:08 UTC, deadalnix wrote:
No.
Gotta love the well thought out responses...
On Saturday, 1 March 2014 at 13:54:49 UTC, Araq wrote:
Araq: could you list the problems you see in the OO world?
I could list the problems, but that would fill books. So, I'll
focus on a single aspect instead here: Favour composition over
inheritance. This is commonly regarded as the better
On Sunday, 2 March 2014 at 01:28:32 UTC, deadalnix wrote:
So, to make refactoring easier, you refactor. I knew the
functional crowd liked recursence, but I just learnt that tail
recusrion can also be used to crate circular logic.
I can't find what I'm thinking of, but Conditional Proof seems
On Saturday, 1 March 2014 at 16:27:45 UTC, Araq wrote:
That's an ADT then, not OOP. (I follow Cook's definition of OO
here.)
2. Encapsulation and information hiding
That's a module system, not OOP.
Can you create an instance of a module? Then it's not an object
in the sense of OOP.
The anti OO world don't need that, as they know all future
evolution at day one. Probably because they do not have users.
The idea that *more* code makes your code easier to evolve only
comes from OO people, makes no sense and has largely been proven
not to work. Even the OO people realized
On Sunday, 2 March 2014 at 08:16:43 UTC, Araq wrote:
The anti OO world don't need that, as they know all future
evolution at day one. Probably because they do not have users.
The idea that *more* code makes your code easier to evolve
only comes from OO people, makes no sense and has largely
On 02/27/2014 02:27 PM, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
auto foo = bar?.baz?.fun:hun;
While at the moment it may seem like a must have feature. If D is
going to get better nullability handling, like the proposed
@nullable or Nullable!X, then the safe navigation operator is not
really needed. The explicit nullability would provide the needed
safety.
auto x =
I sometimes come across situations like this:
writeln_or_whatever(person ? person.name : );
(This is a case of means something.)
Using `person?.name` is a bit shorter and DRYer. But it would
be more useful if I could specify the default value it
returns. With an explicit `maybe` this would
On 3/1/14, 4:10 AM, Araq wrote:
Even if that would be true, the refactoring über alles OO crowd
couldn't care less... You refactor. Problem solved. Massive code
restructuring is embraced in the OO world because OO encourages
bad design like no other paradigm.
Araq: could you list the problems
Even if that would be true, the refactoring über alles OO
crowd
couldn't care less... You refactor. Problem solved. Massive
code
restructuring is embraced in the OO world because OO encourages
bad design like no other paradigm.
Araq: could you list the problems you see in the OO world?
I
On 2014-03-01 14:54, Araq wrote:
I could list the problems, but that would fill books. So, I'll focus on
a single aspect instead here: Favour composition over inheritance.
This is commonly regarded as the better solution (and I agree with it
btw). Ok, fine, so we favour composition and don't
You have other parts of the OO paradigm as well, which I would
consider more important:
1. Combining data (instance variables) and behavior (methods)
as a single entity (object)
That's an ADT then, not OOP. (I follow Cook's definition of OO
here.)
2. Encapsulation and information
On Saturday, 1 March 2014 at 07:10:56 UTC, Araq wrote:
The problem when you chain is that you make a lot of code
dependent on the structure of the project, which makes it hard
to evolve or maintain the project, as any change in the
structure will impact more code than it should.
Even if
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
Chaining . operation is a code smell to begin with
It is? Why?
If a system is well-designed, then null state either means
something (and needs to be explicitly handled) or is not possible.
?. provides simple and easy way to
On Friday, 28 February 2014 at 11:11:28 UTC, Dicebot wrote:
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
Chaining . operation is a code smell to begin with
It is? Why?
If a system is well-designed, then null state either means
something (and needs to be explicitly
On Friday, 28 February 2014 at 11:11:28 UTC, Dicebot wrote:
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
Chaining . operation is a code smell to begin with
It is? Why?
If a system is well-designed, then null state either means
something (and needs to be explicitly
On Friday, 28 February 2014 at 11:21:47 UTC, Marc Schütz wrote:
I sometimes come across situations like this:
writeln_or_whatever(person ? person.name : );
(This is a case of means something.)
Using `person?.name` is a bit shorter and DRYer. But it would
be more useful if I could specify
On Friday, 28 February 2014 at 12:28:22 UTC, John Colvin wrote:
Do you mean:
Chaining operations that can return null (or some other
known-to-be-invalid state) is a code-smell.
That's quite different to saying:
Chaining operations using . is a code-smell.
which is what deadalnix said.
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Friday, 28 February 2014 at 12:28:22 UTC, John Colvin wrote:
Do you mean:
Chaining operations that can return null (or some other
known-to-be-invalid state) is a code-smell.
That is the worse.
That's quite different to saying:
Chaining operations using . is a code-smell.
which is
On Friday, 28 February 2014 at 11:21:47 UTC, Marc Schütz wrote:
On Friday, 28 February 2014 at 11:11:28 UTC, Dicebot wrote:
On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
Chaining . operation is a code smell to begin with
It is? Why?
If a system is well-designed, then null
Yes. That must not be understood as a hard rule, but something
that is true most of the time. You want to look up Law of
Demeter.
No, it's not true most of the time. It's just another piece of
arbitrary crap from the object oriented cargo cult that has no
scientific basis.
The problem when
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
I was
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
I like
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
Wish I
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
D doesn't
On Thursday, 27 February 2014 at 16:08:26 UTC, Robert Clipsham
wrote:
D doesn't need this, you can implement monadic null checking in
the library:
By that argument, I can implement anything that D can do in
assembler, hence I don't need D.
On Thursday, 27 February 2014 at 16:32:18 UTC, Chris Williams
wrote:
On Thursday, 27 February 2014 at 16:08:26 UTC, Robert Clipsham
wrote:
D doesn't need this, you can implement monadic null checking
in the library:
By that argument, I can implement anything that D can do in
assembler, hence
On Thursday, 27 February 2014 at 17:02:02 UTC, Robert Clipsham
wrote:
On Thursday, 27 February 2014 at 16:32:18 UTC, Chris Williams
wrote:
On Thursday, 27 February 2014 at 16:08:26 UTC, Robert Clipsham
wrote:
D doesn't need this, you can implement monadic null checking
in the library:
By
On Thursday, 27 February 2014 at 17:25:22 UTC, Chris Williams
wrote:
just(myObject).method1().method2().method3()
You can't do that. You're reducing your example code - which
was several dozen lines and only applied to objects for which
you had added the special handler code - to the end
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
Chaining
On 2014-02-27 14:27, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
What do you think how well would this work in D2 ?
I like it.
--
/Jacob Carlborg
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Thu, 27 Feb 2014 16:20:47 -0500, Peter Alexander
peter.alexander...@gmail.com wrote:
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Thu, 27 Feb 2014 16:45:11 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
ifnull(parent).child.child.child
brain fart...
ifvalid(parent).child.child.child
-Steve
On Thursday, 27 February 2014 at 20:49:59 UTC, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
On Thursday, 27 February 2014 at 21:49:20 UTC, Steven
Schveighoffer wrote:
On Thu, 27 Feb 2014 16:45:11 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
ifnull(parent).child.child.child
brain fart...
ifvalid(parent).child.child.child
-Steve
What you want is a maybe monad, and we
On Thu, 2014-02-27 at 20:49 +, deadalnix wrote:
On Thursday, 27 February 2014 at 13:27:14 UTC, Remo wrote:
Apparently C# will get it in the next version.
http://blogs.msdn.com/b/jerrynixon/archive/2014/02/26/at-last-c-is-getting-sometimes-called-the-safe-navigation-operator.aspx
43 matches
Mail list logo