Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So... the main argument is that we can use "struct" instead of "class" so class is useless and awful, and that using "class" is brain-dead? And the author cites that use of class is absurd because it makes the default access-specifier "private", thus leading to more code?

Ok for a minute lets consider what this "more" code is. It is simply: "public:" when you want to start specifying the public members. You can even do this at the very start if you want ALL members to be public.

Now lets compare this to java or C# where (to the best of my knowledge), there isn't the ability to say "from here on, all members are private/public" and thus you have to give access specifier with EVERY member.

So the author can't be bothered to write "public:" once, but is ok writing public with EVERY member? Now THAT is absurd.



Correction: the default access level in C# I think is that the name is visible to all the members of the given assembly, but not outside of the assembly. I don't remember what it's called though.


And in Java it's package-visible.


Internal.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: