October 25, 2023
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.
October 25, 2023
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.
October 25, 2023
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.

October 25, 2023
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.
October 25, 2023
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.
October 25, 2023
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.

October 26, 2023
On Thursday, 26 October 2023 at 03:15:00 UTC, Walter Bright wrote:
> 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.

Fwiw, I thought it was a good talk, because this is the kind of thing many people ignore because they think it's "trivial".

But what I have learned over 25 years of coding is that less is always more.

The best code is code that can be understood.

Don't try to be cleaver. It's almost always a bad idea.
October 26, 2023

On Monday, 2 October 2023 at 17:28:19 UTC, Mike Parker wrote:

>

It's been a long, long while since I published anything on the blog. I do intend to get pick it up again down the road, but Walter recently surprised me with plans of his own. He's taken the topic of his DConf '23 talk and derived a blog post from it:

https://dlang.org/blog/2023/10/02/crafting-self-evident-code-with-d/

I guess he got impatient with the pace at which I'm getting the talk videos uploaded :-)

And for anyone who'd like to engage in any Reddit discussion that comes up:

https://www.reddit.com/r/programming/comments/16y2h36/crafting_selfevident_code_in_dlang/

Good talk.

Many very clever people would achieve more if they tried to understand why a v. experienced developer would care to spend so much time talking about what might appear to be such basic points.

The key challenge: If this stuff was so obvious & everyone did it or it didn't matter so much that they didn't, why would Walter care about it so much?

October 26, 2023
On 10/26/2023 2:30 AM, John Colvin wrote:
> Good talk.
> 
> Many very clever people would achieve more if they tried to understand why a v. experienced developer would care to spend so much time talking about what might appear to be such basic points.
> 
> The key challenge: If this stuff was so obvious & everyone did it or it didn't matter so much that they didn't, why would Walter care about it so much?

Like user interfaces in an airplane cockpit, it all looks obvious. But, as I was told by the lead engineer for the 757 cockpit, every aspect of it was paid for with somebody's blood.
October 27, 2023

On Saturday, 7 October 2023 at 12:37:37 UTC, sighoya wrote:

>

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

This was finished possible:

import std;

enum State : bool
{
  Off, On
}

void main()
{
  State machineState;
  "The machine ".write;

  if(machineState == State.On) {
    "may be ".write;
  }
  machineState = State.On;
  
  if(machineState == State.On) {
    "definitely ".write; 
  }
  "runnning!".writeln;

// BONUS: TriState
   int engineHP = -500;
   "The engine ".write;
  
   final switch(engineHP.sgn)
   {
     case TriState.Off: "was off!".writeln; break;
     case TriState.Start: "was start!".writeln; break;
     case TriState.On: "running!".writeln; break;
   }
}

enum TriState
{
    Off = -1, Start, On
}

SDB79