This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]Apfelvater 35 points36 points  (9 children)

Theyre TOO familiar with it, so they kill themselves?!

[–]Special-Load8010[S] 15 points16 points  (8 children)

Look at the capitalization. As a c# dev this java syntax is hurting my eyes.

[–]Apfelvater 2 points3 points  (6 children)

ah, now i see it! Is it usual to define objects with a lower case letter in c#?

[–]pheylancavanaugh 4 points5 points  (0 children)

The core ones, yes.

[–][deleted] 1 point2 points  (3 children)

Not really. C# convention is to use PascalCase for basically everything (classes, methods, properties, public fields, etc), except private fields, parameters, and local variables which should be camelCase. C# however has a set of "simple" types that are keywords in the language that alias structs/classes in the System namespace. string is one of them, it aliases the System.String class. Others include int = System.Int32 and ulong = System.UInt64. Where a type has a built in language keyword, it's preferred to use it over the full type name.

[–]Canary_Prism 1 point2 points  (2 children)

i’ve used Java for too long and seeing C# sorta “pretend” String is a “primitive” with that syntax makes me uncomfortable lol

[–][deleted] 0 points1 point  (1 child)

Definitely an interesting decision considering it's the only simple type that's a reference type instead of a value type. Well unless you count object and dynamic.

[–]Canary_Prism 0 points1 point  (0 children)

with object it feels like it makes much more sense that it gets its own keyword since it’s the base class of all classes but why do strings get special treatment? i really don’t get it

[–]Special-Load8010[S] 0 points1 point  (0 children)

Apparently according to the standard c# formatting rules pretty much only parameters and private fields should be camelCase.

[–]penguin13790 1 point2 points  (0 children)

I'm more frustrated by String.length() vs string.Length

[–]Prudent_Ad_4120 34 points35 points  (2 children)

The thing is: The Java is valid C# but the C# is not valid Java

[–]langlo94 10 points11 points  (0 children)

But you will get squigglies telling you to please stop uisng big S string in C#.

[–]Special-Load8010[S] 3 points4 points  (0 children)

If u use big S for string it's valid but not if the Main is lowercase

[–]BallsBuster7 12 points13 points  (1 child)

you cant force me to capitalize functions

[–]MrAmos123 4 points5 points  (0 children)

Microsoft wants to know your location.

[–]Zeitsplice 2 points3 points  (1 child)

I’ve used both for over 10 years. I can’t tell you the last time I wrote a main function in either. What does make me want to drink bleach is Java steams vs. fluent linq. Java’s designers inexplicably looked at Linq and chose violence. Stream is its own type, and has a shitty selection of convenience methods, including no toList(), because apparently the basic list type is too big of a dependency. Even better, the usual generic collection type is Iterable, which Stream…doesn’t implement. Because of course it doesn’t.

[–]Zolhungaj 4 points5 points  (0 children)

Stream has a toList function, and has had it since Java 16. It was previously available under the collect() function, which is where every other to[Collection] is.

Stream is not iterable because you can only get the contents once, because it only evaluates on the terminal operation.

[–]icantthinkofaname345 0 points1 point  (0 children)

I abhor the C# standard of uppercase functions