top | item 44614638 (no title) zvrba | 7 months ago > Pushing these into an IDE is the Windows way of doing things.s/Windows/modern/> To win in Unix land, C# needs to be editable in a plain text editor.I guess hard-core unix users still use sticks and stones to make fire. discuss order hn newest jeswin|7 months ago I just want to focus on writing functions. Here's a trivial example.I would like: // math/adder.cs public static add(int x, int y) : int { return x + y; } Instead of: // math/adder.cs namespace math { class adder { public static add(int x, int y) : int { return x + y; } } } Both are callable as: math.adder.add(10, 20); zvrba|7 months ago C# allows file-level namespaces so you can write namespace Math; static class Adder { public static int Add(...) { ... } } (one nesting level less). Next, elsewhere you can write namespace Whatever; using static Math.Adder; class CC { void M() { var z = Add(10, 20); // no NS qualification needed due to using static above } } Java enforces directory structure to reflect package names, and this feature is not universally popular. metaltyphoon|7 months ago I agree with the first example. I wish C# could do “free” floating functions which just lives in the namespace itself. Your second example could do with the extra namespace indentation by doingnamespace math; load replies (1) politician|7 months ago Consider: // math/adder.cs package math; …code… claytongulick|7 months ago Just Linux (not counting other *nix) has a ~63% server market share. [1]That's a lot of sticks and stones.[1] https://en.m.wikipedia.org/wiki/Usage_share_of_operating_sys... pjmlp|7 months ago Plenty of those servers run Java, which is where C# kind of comes from due to J++ lawsuit. speed_spread|7 months ago Server != Dev Workstation
jeswin|7 months ago I just want to focus on writing functions. Here's a trivial example.I would like: // math/adder.cs public static add(int x, int y) : int { return x + y; } Instead of: // math/adder.cs namespace math { class adder { public static add(int x, int y) : int { return x + y; } } } Both are callable as: math.adder.add(10, 20); zvrba|7 months ago C# allows file-level namespaces so you can write namespace Math; static class Adder { public static int Add(...) { ... } } (one nesting level less). Next, elsewhere you can write namespace Whatever; using static Math.Adder; class CC { void M() { var z = Add(10, 20); // no NS qualification needed due to using static above } } Java enforces directory structure to reflect package names, and this feature is not universally popular. metaltyphoon|7 months ago I agree with the first example. I wish C# could do “free” floating functions which just lives in the namespace itself. Your second example could do with the extra namespace indentation by doingnamespace math; load replies (1) politician|7 months ago Consider: // math/adder.cs package math; …code…
zvrba|7 months ago C# allows file-level namespaces so you can write namespace Math; static class Adder { public static int Add(...) { ... } } (one nesting level less). Next, elsewhere you can write namespace Whatever; using static Math.Adder; class CC { void M() { var z = Add(10, 20); // no NS qualification needed due to using static above } } Java enforces directory structure to reflect package names, and this feature is not universally popular.
metaltyphoon|7 months ago I agree with the first example. I wish C# could do “free” floating functions which just lives in the namespace itself. Your second example could do with the extra namespace indentation by doingnamespace math; load replies (1)
claytongulick|7 months ago Just Linux (not counting other *nix) has a ~63% server market share. [1]That's a lot of sticks and stones.[1] https://en.m.wikipedia.org/wiki/Usage_share_of_operating_sys... pjmlp|7 months ago Plenty of those servers run Java, which is where C# kind of comes from due to J++ lawsuit. speed_spread|7 months ago Server != Dev Workstation
pjmlp|7 months ago Plenty of those servers run Java, which is where C# kind of comes from due to J++ lawsuit.
jeswin|7 months ago
I would like:
Instead of: Both are callable as:zvrba|7 months ago
metaltyphoon|7 months ago
namespace math;
politician|7 months ago
claytongulick|7 months ago
That's a lot of sticks and stones.
[1] https://en.m.wikipedia.org/wiki/Usage_share_of_operating_sys...
pjmlp|7 months ago
speed_spread|7 months ago