java里单引号与常量
I was poking around in the nGallery site and found these gems, as nGallery is (stunningly) Mono Compliant. I thought that #1 really hit home when it comes to the importance of using such (often thought silly) things like System.Environment.NewLine and System.IO.Path.DirectorySeparatorChar. If there's a constant in the Framework, it's usually there for a reason.
一世在nGallery网站上四处寻找并发现了这些宝石,因为nGallery(令人惊叹)是Mono兼容的。 我认为,在使用诸如System.Environment.NewLine和System.IO.Path.DirectorySeparatorChar之类的(通常被认为很愚蠢)的重要性时,#1真的很受欢迎。 如果框架中有一个常数,通常是有原因的。
Rule #1: Never, ever, ever use the \ to seperate directories when doing any file I/O. Instead, use the System.IO.Path.DirectorySeparatorChar constant. This translates directly over to the *nix world and makes for a smooth transition in Mono.
规则1:执行任何文件I / O时,永远不要使用\分隔目录。 而是使用System.IO.Path.DirectorySeparatorChar常量。 这将直接转换为* nix世界,并在Mono中实现平稳过渡。
Rule #2: Just as most of us have learned case sensitivity in .NET, carry this forward to your file I/O operations, again, and make sure all files and directories are case sensitive.
规则2:正如我们大多数人已经在.NET中学习到区分大小写一样,请再次将其转发到文件I / O操作中,并确保所有文件和目录都区分大小写。
Rule #3: Make sure you don't compile your assemblies with the /incremental flag. Mono can't support incremental compilation. For more details on what "incremental compilation". [Jason Alexander]
规则3:确保不使用/ incremental标志编译程序集。 Mono不支持增量编译。 有关“增量编译”的更多详细信息。 [杰森·亚历山大]
翻译自: https://www.hanselman.com/blog/getting-ready-for-mono-and-the-importance-of-being-using-constants
java里单引号与常量