Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 21:23:24 UTC, ProtectAndHide wrote: The more I look at D, the more I like C++. I should correct that. The more I look at D, the more I like C++, C#, Java, Kotlin, Swift, Javascript .. and the list goes on.. All D needed to provide, was a way to let the prog

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 22:03:48 UTC, Adam D Ruppe wrote: On Saturday, 18 February 2023 at 21:23:24 UTC, ProtectAndHide wrote: The more I look at D, the more I like C++. cya of course, I do have my own fork ;-) where you CAN declare private members for your class. and.. where all

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 22:03:48 UTC, Adam D Ruppe wrote: On Saturday, 18 February 2023 at 21:23:24 UTC, ProtectAndHide wrote: The more I look at D, the more I like C++. cya I bet that's what you say to anyone who dares want to have hidden members inside their class. All the thre

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 21:23:24 UTC, ProtectAndHide wrote: Here is (one example) of the change I would like to see in D: if private is declared against a member inside a class (or struct), then that member is visible only inside that class or struct. That is what most programmers

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 07:49:03 UTC, RTM wrote: On Saturday, 18 February 2023 at 06:55:49 UTC, ProtectAndHide wrote: More likely is comes from my experience .. otherwise I wouldn't be surprised ;-) Now that's a screaming sign: https://media.licdn.com/dms/image/C4D12AQEymZALzWVDXQ/

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-18 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 07:49:03 UTC, RTM wrote: Implying that D language maintainers should prefer your personal taste over modern practice? So it's now modern practice to dump the principle of data hiding? I'm sure that will surely advance the science of programming. Don't like

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-17 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 18 February 2023 at 06:12:47 UTC, RTM wrote: No offense, but it looks like your surprise comes from your inexperience. More likely is comes from my experience .. otherwise I wouldn't be surprised ;-) btw. I love the way that Brayan Martinez (Senior Developer with Azure, Spr

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-17 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 22:58:19 UTC, ProtectAndHide wrote: Actually, I just now understand 'why' (as opposed to 'how') private works in D the way it does. In D, private within a module is (more-or-less) like static used in C outside of a function. That is, in C it restrains the v

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-17 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 04:58:17 UTC, RTM wrote: Data hiding is overrated. ... Actually, data hiding is at the core of using objects, and objects are at the core of doing OOP. " Hiding internal state and requiring all interaction to be performed through an object's methods is known

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-17 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 09:56:26 UTC, RTM wrote: On Friday, 17 February 2023 at 06:56:08 UTC, ProtectAndHide Thirty years passed since. Lessons were learned. Out of three PLs of the newer generation (Rust, Swift, Go), two are not OOP, basically. And no private/public/protected: https

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 04:58:17 UTC, RTM wrote: Data hiding is overrated. Furthermore, OOP is overrated :-) https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7 What is 'Object-Oriented Programming'? (1991 revised version) Bjarne Stroust

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 04:58:17 UTC, RTM wrote: Data hiding is overrated. Furthermore, OOP is overrated :-) https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7 Submit a request to the C++ Committee to remove private from the language.

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 17 February 2023 at 04:43:11 UTC, RTM wrote: On Thursday, 16 February 2023 at 20:56:00 UTC, ProtectAndHide wrote: Both the module type, and the class type need this capability. No, they are not. Look at Go. Go does not have classes.

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 21:56:03 UTC, bachmeier wrote: On Thursday, 16 February 2023 at 21:23:53 UTC, ProtectAndHide wrote: Forcing programmers to use a design mechanism rather than a language mechanism to achieve the above abstraction is wrong. This seems to be the source of the dis

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 21:56:03 UTC, bachmeier wrote: On Thursday, 16 February 2023 at 21:23:53 UTC, ProtectAndHide wrote: Forcing programmers to use a design mechanism rather than a language mechanism to achieve the above abstraction is wrong. This seems to be the source of the dis

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 20:56:00 UTC, ProtectAndHide wrote: My agrument is this: Objects are data abstractions with an interface of named operations and a hidden local state. Does anyone disagree with this? D does not have a language mechanism, but rather a design mechanism that

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 13:39:13 UTC, H. S. Teoh wrote: On Thu, Feb 16, 2023 at 08:51:39AM +, FeepingCreature via Digitalmars-d-learn wrote: [...] Springboarding off this post: This thread is vastly dominated by some people who care very much about this issue. Comparatively, for i

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 02:56:28 UTC, ProtectAndHide wrote: What a joke. Even Javascript can do this (and the compile will enforce it too). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 02:26:44 UTC, Mike Parker wrote: On Wednesday, 15 February 2023 at 20:10:31 UTC, ProtectAndHide wrote: What Mike is arguing, is that I don't need a 'data hiding' mechanism for a user-defined type, because that is already provided to me by the 'data hiding' m

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 16 February 2023 at 02:26:44 UTC, Mike Parker wrote: On Wednesday, 15 February 2023 at 20:10:31 UTC, ProtectAndHide wrote: What Mike is arguing, is that I don't need a 'data hiding' mechanism for a user-defined type, because that is already provided to me by the 'data hiding' m

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 20:34:13 UTC, thebluepandabear wrote: On Wednesday, 15 February 2023 at 20:06:18 UTC, bachmeier wrote: On Wednesday, 15 February 2023 at 07:13:41 UTC, thebluepandabear wrote: Time to move on to OCaml programmers telling us D doesn't have floating point arithmet

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 20:10:31 UTC, ProtectAndHide wrote: ... this is not to be personal, just to make an analogy about the point being made: if Mike was a car salesperson, he'd be arguing that I don't need an automatic transmission. I can already do it manually. Why should we

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 20:01:12 UTC, bachmeier wrote: On Wednesday, 15 February 2023 at 19:44:50 UTC, ProtectAndHide wrote: A user-defined type is a type that has a mechanism to keep it representation private. D does not support this. It only enables it. You (and others) may well

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 19:44:50 UTC, ProtectAndHide wrote: "The basic support for programming with data abstraction consists of facilities for defining a set of operations (functions and operators) for a type and for restricting the access to objects of the type to that set of op

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 10:17:30 UTC, Mike Parker wrote: I referenced that in my post. The exact same problem exists *inside* the class when your class file is very long. You can easily manipulate the private member even when it's only supposed to be accessed by a specific function.

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 08:56:00 UTC, Mike Parker wrote: Our friend of many forum handles misses no opportunity to return to this putrid horse corpse to beat it some more, but the meaning of private isn't going to change. This is D's approach to encapsulation. It seems the only be

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 08:56:00 UTC, Mike Parker wrote: Our friend of many forum handles misses no opportunity to return to this putrid horse corpse to beat it some more, but the meaning of private isn't going to change. This is D's approach to encapsulation. It seems the only be

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 10:17:30 UTC, Mike Parker wrote: We keep repeating the same arguments over and over and over again on this. I still haven't seen any convincing argument for changing things when it's already possible to do what you want to do. I repeat for the umpteenth time:

Re: How can I easily determine the last charachter of a file?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Tuesday, 14 February 2023 at 18:30:05 UTC, seany wrote: Hello Consider the content of a file First line \n Second line data data data data ... last char My goal is to find out whether the last character is a new line or not. Please not, it will be sufficient if this w

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 09:51:41 UTC, zjh wrote: On Wednesday, 15 February 2023 at 08:57:27 UTC, Mike Parker wrote: I meant to say, it "wouldn't add more". What if two classes in the module that are several meters apart make `mistakes` that change the privite variable of `another

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 07:23:39 UTC, thebluepandabear wrote: On Wednesday, 15 February 2023 at 02:14:30 UTC, Mike Parker wrote: On Wednesday, 15 February 2023 at 01:16:00 UTC, thebluepandabear wrote: I think what you could say is that D lacks _encapsulation_ which is also an OOP

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-15 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 15 February 2023 at 08:57:27 UTC, Mike Parker wrote: On Wednesday, 15 February 2023 at 08:56:00 UTC, Mike Parker wrote: If private were restricted to the class/struct, it would add anything more for encapsulation in D. I meant to say, it "wouldn't add more". Well, to quote St

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-14 Thread ProtectAndHide--- via Digitalmars-d-learn
On Tuesday, 14 February 2023 at 15:34:17 UTC, bachmeier wrote: On Tuesday, 14 February 2023 at 10:16:47 UTC, ProtectAndHide wrote: In any case, there is nothing 'picky' about wanting to be able to explicately 'declare' a member of my class type as being private. That to me, is what a programm

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-14 Thread ProtectAndHide via Digitalmars-d-learn
On Tuesday, 14 February 2023 at 08:15:37 UTC, Kagamin wrote: My point is you know you're just picky. Well.. it seems to me, that your 'point' is to just have a go at me. In any case, there is nothing 'picky' about wanting to be able to explicately 'declare' a member of my class type as bein

Re: Simplest way to convert an array into a set

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 18:04:40 UTC, Matt wrote: Obviously, there is no "set" object in D, but I was wondering what the quickest way to remove duplicates from an array would be. I was convinced I'd seen a "unique" method somewhere, but I've looked through the documentation for std.array

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 09:14:18 UTC, Kagamin wrote: On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote: Chris Lattner outlines the reasons for removing it in Swift 3.0 here: https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.m

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-13 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 13 February 2023 at 07:19:49 UTC, Kagamin wrote: On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote: Well in Swift, there is no problem .. at all. Why is it a problem in D then? (and I mean technically). What about the increment operator `++` ? Remember, that a one

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 11 February 2023 at 02:17:09 UTC, thebluepandabear wrote: I'm not an advocate of any style in particular. I'm happy to use any style that is clear to understand and use, suitable, and can provide reasonable guarantees around memory safety and correctness. But a language that clai

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 11 February 2023 at 02:18:48 UTC, thebluepandabear wrote: What attracts me to D, is the inability to program outside of a class in C#. I think they are trying to find ways to make this happen, but I wouldn't hold my breath. programming outside of a class is overrated though in m

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Saturday, 11 February 2023 at 02:15:37 UTC, thebluepandabear wrote: That's not entirely correct. I don't use any Apple hardware products. Never have, and never will. I use Swift on Linux only. There are of course some library features of Swift tied to Apple products. But I have no need f

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 02:57:42 UTC, zjh wrote: On Friday, 10 February 2023 at 02:04:06 UTC, ProtectAndHide wrote: "Before practicing Zen, mountains were mountains and rivers were rivers. While practicing Zen, mountains are no longer mountains and rivers are no longer rivers. After re

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 23:24:11 UTC, thebluepandabear wrote: I think the 'real' problem, is that some core D people just refuse to allow D to provide such an option to the programmer. I think a lot of it has to do with the fact that heaps of D programmers write procedural code and don

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 23:22:34 UTC, thebluepandabear wrote: A good example of a language that does everything right is C#. If C# wasn't tied to Microsoft, it would honestly be pretty much the perfect language. Java is also pretty good, but it has its downsides. I don't agree with all

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 23:19:31 UTC, thebluepandabear wrote: I think the 'real' problem, is that some core D people just refuse to allow D to provide such an option to the programmer. For what reason, I cannot fathom, since Swift can do this just fine. I think it's some kind of bias aga

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-10 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 14:50:59 UTC, bachmeier wrote: On Friday, 10 February 2023 at 07:04:31 UTC, Max Samukha wrote: Having class-private doesn't preclude module-private. Dennis even submitted a PR implementing class-private, but it stalled because people couldn't agree on whether cla

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-09 Thread ProtectAndHide via Digitalmars-d-learn
On Friday, 10 February 2023 at 00:18:59 UTC, Ali Çehreli wrote: Not everybody shares that view. So, there must be something deeper here: maybe some people are blind (including me), or others have expectations that they carry from other languages, or something else... But look at the contrast:

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-09 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 9 February 2023 at 23:05:35 UTC, Hipreme wrote: On Thursday, 9 February 2023 at 22:34:29 UTC, ProtectAndHide wrote: On Thursday, 9 February 2023 at 20:05:06 UTC, Ali Çehreli wrote: On 2/8/23 04:07, zjh wrote: > Last time, someone proposed to add `private` like `C++'s`, We've disc

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-09 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 9 February 2023 at 23:13:00 UTC, Ali Çehreli wrote: ... Well, the only thing we can say for sure now, is that since 'class', 'oop', and 'private' have all been mentioned in this thread, some 'key D people' (wink wink) will come out to derail this thread by further pointing out

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-09 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 9 February 2023 at 20:05:06 UTC, Ali Çehreli wrote: On 2/8/23 04:07, zjh wrote: > Last time, someone proposed to add `private` like `C++'s`, We've discussed the 'private' topic very many times already. C++'s private necessitate the 'friend' keyword, which comes with it's own prob

Re: Sort Associative Array by Key

2023-02-09 Thread ProtectAndHide via Digitalmars-d-learn
On Thursday, 9 February 2023 at 07:19:08 UTC, Alexander Zhirov wrote: foo.byPair .array .sort!((a, b) => a.key < b.key) .map!(a => a.value); Is it possible to specify in `map` to return the result `[a.key] = a.value`? To make the result look like `[key:[val], key:[val]]` Wow. This is an

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-07 Thread ProtectAndHide via Digitalmars-d-learn
On Tuesday, 7 February 2023 at 16:16:48 UTC, Ali Çehreli wrote: On 2/6/23 23:33, ProtectAndHide wrote: > On Monday, 6 February 2023 at 21:46:29 UTC, Ali Çehreli wrote: >> And as 'static class' and 'static struct' are already usable in D, a >> newcomer would definitely be confused with your "terr

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-06 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 6 February 2023 at 21:02:13 UTC, Richard (Rikki) Andrew Cattermole wrote: On 07/02/2023 9:56 AM, ProtectAndHide wrote: On Monday, 6 February 2023 at 08:26:45 UTC, Ali Çehreli wrote: In contrast, D delivers some features in an unprincipled way and the programmers use combinatio

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-06 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 6 February 2023 at 21:46:29 UTC, Ali Çehreli wrote: On 2/6/23 12:56, ProtectAndHide wrote: > I'm not going to 'go write a > DIP'. Nobody will write a DIP about it because very few people ever mentioned this issue over the years. And as 'static class' and 'static struct' are alread

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-06 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 6 February 2023 at 08:26:45 UTC, Ali Çehreli wrote: In contrast, D delivers some features in an unprincipled way and the programmers use combinations of those features the way the see fit. I agree, that D is unprincipled in many ways, and this is perhaps the biggest surprise

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-06 Thread ProtectAndHide via Digitalmars-d-learn
On Sunday, 5 February 2023 at 23:53:35 UTC, Ali Çehreli wrote: I understand disabling the programmer to do certain things are beneficial e.g. to prevent bugs but those above can all be seen as features. What is so terrible about giving the programmer those powers? Ali Interestingly, in Sw

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-05 Thread ProtectAndHide via Digitalmars-d-learn
On Sunday, 5 February 2023 at 23:53:35 UTC, Ali Çehreli wrote: On 2/5/23 14:40, ProtectAndHide wrote: > On Sunday, 5 February 2023 at 10:51:51 UTC, thebluepandabear wrote: >> >> It's not a terrible workaround to be honest. >> > > The 'terrible' part is this: > > - the compiler will allow yo

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-05 Thread ProtectAndHide via Digitalmars-d-learn
On Sunday, 5 February 2023 at 22:40:09 UTC, ProtectAndHide wrote: .. module test; import std; static final class Algo { @disable this(); static this() { Message = "Hello!"; } static: string Message; void drawLine() {}; } void main() { Algo foo1

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-05 Thread ProtectAndHide via Digitalmars-d-learn
On Sunday, 5 February 2023 at 10:51:51 UTC, thebluepandabear wrote: It's not a terrible workaround to be honest. The 'terrible' part is this: - the compiler will allow you to declare a variable of type Algo - the compiler will allow you to declare an array with elements of type Algo -

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-05 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 30 January 2023 at 21:54:49 UTC, thebluepandabear wrote: ... Interesting, so maybe there is a use case for a purely static type or namespace? The standard library as well uses `final abstract class` a couple of times, which can also be thought as a type of namespace. All these

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-01-30 Thread ProtectAndHide via Digitalmars-d-learn
On Monday, 30 January 2023 at 06:09:56 UTC, RTM wrote: On Saturday, 28 January 2023 at 23:19:35 UTC, ProtectAndHide wrote: That is, you can do OOP without classes How so? Every OOP definition includes classes (encapsulation + inheritance). I didn't say you should do it, just that you can

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-01-28 Thread ProtectAndHide via Digitalmars-d-learn
On Wednesday, 25 January 2023 at 15:43:46 UTC, ryuukk_ wrote: using static class and static function is not "OOP way" of doing things, it's a hack to mimic procedural style because Java doesn't have proper modules / scoping mimicking the shortcomings of Java is a bad idea imo D empowers you