本文介绍了哪些功能应该在Java 7起要鼓励从C#转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#有目前的良好势头。什么是你的需求的有顺序切换(或退货)到Java的特点是什么?

C# has a good momentum at the moment. What are the features that you would need to have in order to switch (or return) to Java?

这也将是如果相当有用人们张贴这些解决方法对于当前的Java版本,例如: Nullables被缠自定义类,使之成为一个更有趣的wiki。

It would also be quite useful if people posted workarounds for these for the current Java versions, e.g. Nullables being wrapped around custom classes, to make this a much more interesting wiki.

推荐答案

作为一个.NET / C#开发这里缺少的功能,激怒了我。这个列表中没有特定的顺序 - 就像想法浮现在脑海中:

As a .NET/C# developer here are the missing features that annoy me. This list in no particular order - just as thoughts come to mind:


  1. Java库太小。对于常见的事情,我有竞争的开源产品,因为缺乏在许多方面的基本库。

  2. 这是一个面向对象的编程语言右5之间做出选择?为什么在赫克基本类型不能从对象继承?

  3. 指针

  4. Lambda表达式

  5. 瓶盖

  6. 部分类和程度较轻的部分方法

  7. 仿制药

  8. 实时支持使用语句和处置 - 这对我来说是真正的跆拳道。你真的要在try / catch块明确关闭连接。 Java的可怜的家伙!

  9. 的将是不错

  10. 无符号整数 - 再次跆拳道?我必须使用数字类型大于我需要什么目的一遍吗?

  11. 在Java中,你可以从try / catch语句的最终块将返回。一位同事通过引入一个bug这样混淆了地狱了我几个小时。这种行为应该被禁止在C#。

  1. The Java library is too small. For common things I have to choose between 5 competing open source products because the base library is lacking in so many ways.
  2. This is an Object Oriented programming language right? Why in the heck do primitive types not inherit from "object"?
  3. Pointers
  4. Lambdas
  5. Closures
  6. Partial Classes and to a lesser extent partial Methods
  7. Real support for Generics
  8. Using statements and Dispose - this was a real WTF for me. You really have to explicitly close connections in try/catch blocks. Poor Java guys!
  9. Yield return would be nice
  10. Unsigned integers - again WTF? I have to use number types larger than I need for what purpose again?
  11. In Java you can return from final blocks of try/catch. A co-worker confused the hell out of me for hours by introducing a bug this way. This behavior should be prohibited as in C#.

我很少有使用Java,当我这样做,我有各种WTF时刻

I rarely have to use Java and when I do, I have all sorts of WTF moments.

编辑:我删除了,每个基于事实的评论不再缺少的Java功能,因为1.5

I Removed for-each comment based on the fact it is no longer a missing Java feature since 1.5.

这篇关于哪些功能应该在Java 7起要鼓励从C#转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 07:52