Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/3/2023 8:10 AM, matheus wrote:
I understand the advantages of the UFCS, I was just pointing out that the 
example given in that post are NOT equivalent, if it was deliberated or not I 
don't know, but I think it was just a small mistake, otherwise the author 
woundn't say they are equivalent.


It was a mistake made by me.



Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/18/2023 11:51 AM, Max Samukha wrote:

On Tuesday, 3 October 2023 at 19:03:00 UTC, Walter Bright wrote:


$0.


true


It's one reason why donations to the DLF go a long way. We try hard to squeeze 
the most out of every dollar.


Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/8/2023 6:21 AM, sighoya wrote:
I have another thing to add. You argued about reasons not to use macros but 
these reasons don't apply to AST Macros, they won't allow constructing new 
languages like in Lisp or in Neat.


Typed AST Macros would only accept parseable D source code with correct typing 
while untyped AST Macros would relax typing issues but syntax is still valid D.


It's still inventing one's own undocumented, incomprehensible language.

> Scala

I've heard from an expert insider source that Scala macros destroyed the 
language.

Macros are like selling your soul to the devil. At first it's a honeymoon, which 
may last for a decade or more, but eventually you discover you're in a trap you 
cannot escape.


Seeing the life cycle of macros over and over is one advantage to me having been 
programming for well over 40 years.


Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/7/2023 5:37 AM, sighoya wrote:

Thanks, I think we need more of this as D has become a large language already.
There were some points I even never considered before.


I'm glad it's a win for you!


I disagree however in all binary types should be just boolean.
I prefer machineState=State.On or State.Off than isMachineOn=true or false.


Give it time. You'll come around! I've gone done many paths over the years on 
this stuff, to arrive at what I presented. I may evolve further in the future.




Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/5/2023 10:21 AM, angel wrote:
I don't mind if it does not compile without the `ref`, but it should be on the 
table - WYSIWYG.


It's a good point. Consider the refactoring angle. If I wished to switch from a 
struct to a class, and vice versa, and can just change the definition. If `ref` 
was needed everywhere, I'd have to refactor a lot of code.


This is also why D uses `.` instead of `->`. Easier to refactor.


Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/5/2023 6:30 AM, claptrap wrote:
While I agree with the overall gist I didn't find his examples very interesting 
or convincing. They were pretty much all made up to illustrate, outdated, or 
disingenuous (the first one with the intentionally obfuscated code).


I know they look trivial, but I trivialized them to get them to fit on a slide. 
There are few more worthless slides than ones with 50 lines of code on them. 
Nobody can understand 50 lines of code in a minute, let alone hear the presenter 
talking about it.




It would have been far better if he had actual real code examples he'd cleaned 
up.


With many of them I included a link to a pull request that cleaned up a real 
example in DMD. (The real examples, of course, tend to be a bit more complicated.)



I'm sorry you didn't find it worthwhile.


Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/4/2023 5:53 PM, claptrap wrote:
I have never once said he cant talk about whatever he wants to, I've explicitly 
said the opposite. All I said is that by virtue of who he is has more 
interesting things to talk about than whether "enum { yes, no }" is a good idea 
or not.


When I stop seeing that kind of thing in the dlang code base ... :-)

Arguments about the things I talked about show up again and again in the n.g. 
They are not commonly accepted.


Lastly, it seems obvious. But that's the point! It's very hard to write 
self-evident code, and it looks trivial after the fact.




Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/4/2023 12:50 PM, claptrap wrote:
Yes he can do what he likes, nobody has the right to demand anything from him. 
But his position and experience and knowledge is such that him doing a talk on 
coding guidelines is disappointing.


Considering how few people follow the coding guidelines I presented, it's 
worthwhile. It isn't the usual guidelines I see, either.


Re: Blog post: How we are using D to develop Aspect from the ground up

2023-10-25 Thread Walter Bright via Digitalmars-d-announce

On 10/23/2023 12:02 PM, Sönke Ludwig wrote:

Link: 
https://aspect.bildhuus.com/blog/posts/how-we-are-using-d-from-the-ground-up


https://x.com/WalterBright/status/1717077828255228223