DEV Community

Discussion on: The niche guy writing

Collapse
 
_hs_ profile image
HS • Edited

I agree.

Personally I love annotations for a lot of stuff. Currently I work as .NET Core and there you need to write something like services.AddScoped() which makes no sense as they have [Controller] annotation. Why not give [Service(scope)]. Also I love that Spring is mainly Singleton style for most stuff at least on projects I worked for like Controllers, Services, Repository. In .NET Core you need to realy think hard before using singleton as most are scoped which in spring is Request scope if I remember correctly. Also forget about @Repository and implements JpaRepository because in C# you have DbContext and try to get your head around it first week you switch from Spring. But all of this is about framework. As a language I do miss some stuff in it.

I love checked exceptions as they make me feel safer and less testing is required but I do miss ?. and ?? from C# in Java. I also miss something like initializing object and filling stuff like in C# new Stuff { a = "", b = 5...} forgot what this is called. When it comes to LINQ I like streams better. I do however still miss anonymous type while using streams. In LINQ C# you can do list.Select(x => new { Att = "", Att2 = 1}) while in java 11 it's still not that simple.

However I like Java and hope to see it get more features/syntactic sugar, but on projects that don't require too much performance why would I not now skip some stuff and use Groovy since it's faster to work with. For example you need quick small API for just simple CRUD and need to use JVM for some reason. Especially with Micronaut out, I'm more excited about it than any other thing recently.