4 ms·
The core is very good, the OOP aspects can be really quite poor. Let me write a function without 50 tokens of boilerplate!
by mhh__ 2y ago
The core is very good, the OOP aspects can be really quite poor.
Let me write a function without 50 tokens of boilerplate!
- jayd16 2y agoYou just need to put them in a static class to act as a name space. What is the big deal?
- metaltyphoon 2y agoLove C# but public static implicit operator ClassA(ClassB b) Is very verbose. There are probably worse offenders. C# devs also love to add access modifiers even when its not needed. For example, private for anything that is meant to be private or the suffix `Async` even though you don't have a sync version of a method.
- jayd16 2y agoThe private keyword is needed because the default access is public to the same assembly. Usually that's very different from private. As for the implicit cast, two extra tokens in an uncommon case doesn't seem so bad when you consider all the nice common things like var, the lambda syntax, initializers, pattern matching, LINQ, delegates, etc. etc.
- neonsunset 2y agoDefault visibility for type members is private, default visibility for not-nested types is internal. Defining implicit cast operators frequently (especially ClassA -> ClassB) might be a sign that a better implementation is required. In practice, it's not done often. Agree on unncessary Async suffix. It is a common mistake (it is one) to add it for methods that cannot or will not offer non-async variants.
- metaltyphoon 2y agoIn a sense, internal is just another way of viewing it as “private to the assembly”. If i don’t need something to be reached by another assembly, then typing `internal` when not necessary is just too much. Note: I’m ignoring <InternalsVisibleTo> csproj property.
- mhh__ 2y ago1. It's very long winded. 2. It encourages everyone to think about nouns rather verbs.
- vips7L 2y agoWhat’s wrong with nouns?
- mhh__ 2y agohttps://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html?m=1 https://steve-yegge.blogspot.com/2006/03/execution-in-kingdo... It's not as extreme as java but the smell is there.
- vips7L 2y agoI honestly did not find that blog to be a compelling argument. Maybe something more recent or more serious would help explain better.
- mhh__ 2y agoUltimately it just clashes with my taste. I don't really know how else to enunciate it anymore than how I don't like Taylor swift music or whatever.
- vips7L 2y agoYeah, I don't know, the argument here I think is just dated if I'm interpreting it correctly. There's nothing there in Java that forces you to make classes that are actions or verbs. You could do the same in any language that has classes. Java has long since supported lambdas and functions that can be passed around.
- neonsunset 2y agoCan you make an example of “poor”?
- mhh__ 2y agoMy concerns are mostly in the space between files and whole projects so I can't be super precise but one micro-scale thing that really worrys me is the lack of any discriminated unions in the language. There a time when class hierarchies are ugly but fine, completely fine, and genuinely a bit dangerous: C# doesn't seem to have an option for the latter
- pjc50 2y agoJust have an editor macro that expands "def" to "public static void"