> namespace, classes and access modifiers

Yes, those things exists in Nim, just in different form. Sadly I think there's 
nothing could be done to make Nim appear more like OOP.

P.S.

One huge annoyance in Nim is x4 more code needed to initialise an object, 
especially if there's like say 10 props. First you write props in object 
itself, then you write props as args in `initObj` then you declare write props 
in object initialization, repeating each property twice as `someprop: 
someprop`. And after than you also repeat docs for properties on object type 
declaration and then on `initObj`.

Compared with say TypeScript
    
    
    class MyObj {
      constructor(
        public  readonly propertyA: string,
        private readonly propertyB: number,
        private readonly propertyC: number,
        ...
      ){}
    }
    
    Run

Reply via email to