News for hackers. Stuff that matters.
Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni... by _kst_ on Tuesday August 08, 2023 @09:50PM (#37057836)
I admit I only skimmed the article, but it looks like the only implicit operators discussed are implicit conversions.

There are plenty of implicit conversions in most languages. The C# feature being discussed is the ability to define your own implicit conversions.

I was expecting something like the "x y" or "xy" mathematical notation that means "x*y" (or x×y if you prefer).

Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni... by hinkley on Tuesday August 08, 2023 @10:04PM (#37057916)
When things are cheap, I have some hope that they are actually healthy.

When they are free, I know that there's a huge pile of externalities I can't even begin to imagine yet.

Javascript gets itself (and us) into trouble all the time with implicit conversions.

Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni... by Guvante on Tuesday August 08, 2023 @11:54PM (#37058525)
C# uses the syntax `operator bool` to define conversion so sometimes they get called operator accidentally.
Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni... by _kst_ on Wednesday August 09, 2023 @12:34AM (#37058739)
You mean it uses `operator bool` where `bool` is the target type of the conversion, yes?

I have no problem with the idea that conversions are operators. My point is that the title suggests something far more general that what the body of the article actually discusses. If the title had said "Implicit Conversions" rather than "Implicit Operators", it would have been much clearer and I wouldn't have commented.