August 01, 2013 Re: Article on programming language adoption (x-post from /r/programming) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tofu Ninja | On 08/01/2013 08:01 AM, Tofu Ninja wrote: > Simple example, why would I want to type "node->next" when I could just > type "node.next". However, that distinction allows accessing members of the pointer versus the members of the pointee. (Imagine 'node' is a type that overloads operator-> like smart pointers do.) On the other hand, D's reference semantics make the distinction disappear for classes. But then there is the inconvenience of not being able to access the class variable versus the class object at least for some operations: auto o = new MyClass(); While almost everything else that is accessed by the dot operator is applied to the object, o.sizeof is applied to the variable. One thing to keep in mind... Ali |
August 02, 2013 Re: Article on programming language adoption (x-post from /r/programming) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tofu Ninja | On 8/1/2013 8:01 AM, Tofu Ninja wrote:
> Simple example, why would I want to type "node->next" when I could just type
> "node.next".
The real problem with node->next as opposed to node.next is if node changes from being a reference type to being a value type - then you've got to edit every dang use of it.
C++ also uses :: instead of .
|
August 05, 2013 Re: Article on programming language adoption (x-post from /r/programming) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 8/1/2013 9:21 AM, Dicebot wrote:
>> They see more value in unit
> tests than types, both overall and as a debugging aid. Fur- thermore, how features are presented strongly influences developer feelings about them, such as prioritizing class in- terfaces much higher than static types
>
> Stop the world, I want to get out!
This does not surprise me. TDD has been sold as One True Way of programming for decades now. A lot of modern developers just throw the code (and tests, which are also code) at the problem until it seems solved. Using type system or declarative functional programming to eliminate certain errors is often not considered during development.
|
Copyright © 1999-2021 by the D Language Foundation