5 ms·
I'm complete new to C# and Java but I'm looking into them to choose a new language to learn. I'm mostly worried about memory consumption since I often use a che
by MarvelousWololo 8y ago
I'm complete new to C# and Java but I'm looking into them to choose a new language to learn. I'm mostly worried about memory consumption since I often use a cheap $5 VPS. Would you happen to know which one would be a better fit for my use case? Thank you.
- kankroc 8y agoIf your end game is working professionally just check what is more in demand in your geographic location. Personal opinion C# is a lot better than Java. You have less boilerplate code (getter and setter in 2018, really?) and lambdas are great. But really both are similar so you can pretty much just start with one and still find your way in the other.
- lockje 8y agoHonestly, people still using the getter and setter argument in 2018 as a reason to pick a language should not be taken seriously. Indeed Java has more boilerplate, but honestly I've never been bothered by it (as you can generate most within your IDE) and because its explicitly written down it can make code more readable. And Java also has lambda's.
- wernercd 8y agoYeah... the bigger reason to move away from Java isn't Getters and Setters... The bigger reason is one word: Oracle Whether you go towards C# or other companies... Oracle is a horrible company.
- Accipitriform 8y agoOracle is only one player in the Java ecosystem. OpenJDK owns just about everything now, and most organizations are going to get support somewhere besides Oracle. There's been some good recent innovation with Java, and I think it'll continue due to the new accelerated release schedule. That reminds me, I want to experiment some with AOT compilation and also the new GC plugins.
- jcelerier 8y ago> because its explicitly written down it can make code more readable. more text to read does not means "more readable", it means more effort to do
- walljm 8y agounless that text validates hidden assumptions, or conveys important information to the user. not always the case, but you can't argue that "less text is more readable" any more than you can argue "more text is more readable". what you want is, "just the right amount of text" which will depend on your tastes.
- tigershark 8y agoJava is much heavier to read because of all the boilerplate. And it may have lambda but for example the stream implementation sucks compared to the elegance of LINQ. They had 8 years to make it right and I’m still amazed how did they manage to implement it so badly...
- osd 8y agolambda's are much more limited in flexibility when compared with linq. Because of the way java lambda's work, I imagine there are some scenarios where they are more performant, but it probably comes down to the specific problem/usage.
- yawz 8y agoJava is the most popular language of the JVM ecosystem, but not the only one. If I were to restart from scratch, I would seriously look into Kotlin, which is how Java should have been.
- nicoburns 8y agoIf you're worried about memory usage, then neither is great (C# is a little better than Java), you may want to look into Go or Rust.
- meddlepal 8y agoIf you want to be on the JVM I highly recommend giving Kotlin a look before Java. Great language and excellent tooling.
- bunderbunder 8y agoI would go so far as to argue that Kotlin is the JVM's real equivalent to C#. The syntax is different, but language semantics are much more similar.
- araxhiel 8y agoI would like to learn Kotlin, but I've no prior knowledge about Java... That's a real impediment? If it isn't, do you know (by chance) about some resource(s) for a total newbie/newcomer to the language? thanks in advance.
- osd 8y agojetbrains is doing a very good job of creating good error messages, but just like any other jvm language, you can run into huge, messy, jvm stacktraces. In my experience, Java/jvm proficiency is useful
- nobleach 8y agoI'd say a rudimentary knowledge of the Java ecosystem is required, Maven or Gradle are the preferred deps management and build tools. It's a bit of a bummer as quite a bit of 3rd party docs assume you have already written things in Java, and gloss over things like, importing a library. For someone who doesn't have a magic importer (or worse yet, someone who is not using an IDE), you'll literally have to dig around in API docs just to figure out what comes from where (I'm looking RIGHT AT YOU Vertx!!) Overall, the language feels pretty nice though.
- meddlepal 8y agoI don't think lack of other JVM knowledge will be a big impediment, but it might be a small annoyance bootstrapping a project (e.g. how to do dep mgmt) and debugging (how to read a stack trace).
- nycdotnet 8y agoWe're using .NET Core 2.1 in prod on Linux Docker containers. One of our production services that gets 2-3 requests per second on average (not a ton of traffic, but a legit prod workload) uses between 78 and 90 MB of RAM.