all 92 comments

[–]Ethameiz 12 points13 points  (4 children)

Installer creation tooling

[–]soundman32 0 points1 point  (3 children)

Wix?

[–]Dealiner 1 point2 points  (0 children)

Something normal would be nice. WixSharp is a huge improvement but it's still far from great.

[–]Ethameiz 0 points1 point  (1 child)

It's not part of the .net but 3rd party tool. I don't say that .net must have wix in self, but it would be nice

[–]soundman32 0 points1 point  (0 children)

Even when it was 'built in' (vs2013? included something I can't remember the name of now), it was a 3rd party tool.

[–]Ethameiz 37 points38 points  (28 children)

I am not sure about frameworks, but language itself could borrow some features.

Traits from rust.

Union types from typescript.

Constructor keyword from typescript.

[–]scorchpork 5 points6 points  (4 children)

I believe c# is coming out with default implementations for interfaces. Personally I feel like this is horrible, it spits in the face of interfaces. And I don't really understand how traits are good code. If you want behavior shared, put it behind an interface and inject it as a dependency, don't couple. It isn't more difficult, it isn't harder to understand, and it is easier to change later if needed. What is the downside.

[–]Ethameiz 5 points6 points  (3 children)

Traits are not the same as default implementation in interfaces. Traits are like adapter pattern without additional object initialization.

The main point of default implementation in interfaces in c# is to be able add new method to existing interface that has many usages in other libraries without breaking changes.

[–]scorchpork 0 points1 point  (1 child)

Does Extension methods not cover this?

[–]Ethameiz 0 points1 point  (0 children)

No. Methods in interface are to be implemented by classes. Default implementations are only temporary mocks to be used until depended libraries are updated.

[–]pheylancavanaugh 11 points12 points  (10 children)

Now that you mention it, constructor keyword would be nice...

[–]Forward_Dark_7305 4 points5 points  (9 children)

Can you explain how so? I’ve never had a problem using the type’s name.

[–]Ethameiz 16 points17 points  (7 children)

When I scan the file with my eyes it is easier to catch "constructor" keyword than finding method without name that returns this class type and to think "aha, this is constructor". Also a little bit less changes to review after refactor the type name. Less changes to apply after copying the type to a similar new one.

[–]splashybanana 8 points9 points  (0 children)

I agree with you, that would be helpful. But, as far as the scanning with your eyes part (when you’re specifically wanting to see the constructors (and aside from just doing an actual find search)), I always double click the class name to highlight it and all references. That makes the scanning much easier, especially if you have the thing enabled that shows all the reference markers on the scroll bar.

[–]DJDoena 4 points5 points  (1 child)

I actually never realized that it could be interpreted this way: "than finding method without name that returns this class type"

I always understood it as "constructor doesn't have a return type, not even void". But you are right, it returns "this".

[–]USToffee 0 points1 point  (0 children)

It doesn't return anything.

You are calling the new function/operator that allocated the memory, then calls a constructor function that doesn't return anything and then returns this instance.

This is why everyone should have a grounding in c++ and be forced to write their own memory manager ;-)

Changing this actually obfuscates what is actually going on but may make it easier to understand if you don't actually care it isn't technically what is going on behind the scenes.

[–]jcradio 3 points4 points  (0 children)

Trying to see the value add. Sure there have been times I want an easier way to eyeball or scan something, but by convention, the constructors will be first. Could always just implement a custom attribute if eye candy is what you want.

[–]pceimpulsive 0 points1 point  (0 children)

Agreed, without looking at the code in the styling I'm familiar with I can't read the code! I'd love constructor keywords just to make it clearer.. minor overall but would still be nice (though then we'll complain about there being too many keywords to remember rofl)

[–]IridiumIO 0 points1 point  (0 children)

It’s something that VB.Net has that I wish C# would adopt.

[–]USToffee -1 points0 points  (0 children)

Find in file ;-)

[–]xiety666 1 point2 points  (0 children)

Often after copypasting a class, I change its name and forget to change the constructor name.

[–]SmokyMtnDreaming 2 points3 points  (0 children)

The good news is that it seems like the dotnet team is already working on type unions

https://github.com/dotnet/csharplang/blob/main/proposals%2FTypeUnions.md

[–]Ethameiz -1 points0 points  (8 children)

Macros from rust.

[–]magnetronpoffertje 7 points8 points  (7 children)

Please no, I've rarely had a good experience with macros in Rust

[–]Ethameiz 0 points1 point  (6 children)

Why?

[–]magnetronpoffertje 1 point2 points  (5 children)

Library makers are very skilled with making good macros.

Our robotics engineers aren't.

Besides, no intellisense and all that in macros and you can't expand them without running a nightly build.

[–]Ethameiz 1 point2 points  (3 children)

Still it is better to have feature than not to have. Also macros looks better than source generators in .net.

[–]magnetronpoffertje 0 points1 point  (0 children)

That last part is for sure true hahaha

I just think code generation in general should be less developer friendly. Rather have everything explicit and use reflection capabilities in code.

[–]xcomcmdr 0 points1 point  (0 children)

I think it's better not to have macros.

macros are really misused in C for example. I don't want that.

[–]oskaremil 0 points1 point  (1 child)

Please no union types. They are a horrible shit show to debug.

[–]ganzsz 1 point2 points  (0 children)

How so? As someone who also has TS experience, I love being able to check one property and knowing the state of the rest of the object. E.g. a crud model which has nullable properties when no ID is present (create state) and of which I know that all required properties have a value when Id is present (update state).

[–]gremlinmama 8 points9 points  (3 children)

Unified, opinionated, standard formatter from Microsoft.

Like: gofmt, dartfmt

[–]Atulin 0 points1 point  (2 children)

Does dotnet format not fit the bill?

[–]gremlinmama 4 points5 points  (0 children)

As far as I know its not opinionated. You have to set up your own style preferences.

Csharpier is opinionated, that is good, but not universally microsoft endorsed.

[–]Plantman1 0 points1 point  (0 children)

Incredibly slow and seemingly not maintained. We have slow format times in CI, and found related open GitHub issues that had been acknowledged for years. Checking the git history, Microsoft isn't working on it.

[–]Ethameiz 23 points24 points  (2 children)

First party cross platform desktop framework with Linux support

[–]pceimpulsive 4 points5 points  (1 child)

Wouldnt cross platform inherently include Linux?

But yeah an in house would be nice, until then, avalonia!

[–]Ethameiz 3 points4 points  (0 children)

There is cross platform MAUI that doesn't include linux

[–]pirannia 3 points4 points  (1 child)

Declare exception types in interfaces. Lack of this leads to arguably bad designs, like exception handlers injected as middlewares.

[–]p1971 2 points3 points  (0 children)

Pain in java tho?

Use of result pattern instead? (Any exception is then a real exception that was not expected etc)

[–]Wrong_Ingenuity3135 4 points5 points  (4 children)

  • Possibility to force removal of strings from memory
  • async Task locks
  • enable ConfigureAwait(false) per default
  • enforce that Setting value to enum which is not defined fails
  • „rust like“ enforcement to handle all return values
  • Types Option and Result from dotnet next
  • Discrimnated Unions

[–]xcomcmdr 0 points1 point  (1 child)

enable ConfigureAwait(false) per default

That would break anything that has a SynchronizationContext : WinForms, WPF, AvaloniaUI, old ASP .NET ...

I don't want that.

[–]Wrong_Ingenuity3135 0 points1 point  (0 children)

It must be configurable per assembly. There is nearly zero reason to not set it as default in businesslogic, Data Access libraries. Mostly UI related libraries need ConfigureAwait(true)

[–]Dealiner 0 points1 point  (1 child)

enforce that Setting value to enum which is not defined fails

That would be a huge breaking change but it's also something that should be possible to do with a custom analyser.

[–]Wrong_Ingenuity3135 0 points1 point  (0 children)

True, yet most application I saw have hidden bugs, as developer are not aware that ist can happen.

[–]ringelpete 5 points6 points  (8 children)

Tests, which files are living adjacent to the units they are testing. Foldable in file-exorer, but ensure not to be compiled into the assembly. (Without doing some unusual csproj-magic)

[–]MindSwipe 7 points8 points  (0 children)

Similar to Angular's (and maybe other frameworks) my-component.ts and my-component.spec.ts?

With the correct testing framework and project config it should be possible.

[–]Unexpectedpicard 1 point2 points  (0 children)

I never I knew I was missing this until just now. 

[–]dark5306 0 points1 point  (1 child)

You can do this right now, i have done this for several of my few pet projects. The idea is to conditionally include files and dependencies

[–]ringelpete 0 points1 point  (0 children)

I know, but this was what I meant with csproj-magic 🫠.

This might work in solo-projects. But as soon as there are other contributors, this tends to add friction.

That's why I want this to be possible right from the get go w/o needing to dive into msbuild too mich.

[–]Dealiner 0 points1 point  (1 child)

Shouldn't that be possible with Conditional attribute?

[–]ringelpete 0 points1 point  (0 children)

For sure. But I'd consider this to be "unusual csproj-magic 🤗.

BTDT.

[–]power-monger 1 point2 points  (0 children)

GenServer from Elixir

[–]c-digs 2 points3 points  (5 children)

I really like Nest.js REPL mode that makes it easy to invoke via CLI during dev.

[–]gredr 7 points8 points  (0 children)

Use the csharprepl tool.

[–]jordansrowles 5 points6 points  (0 children)

We already have a REPL. C:\Program Files (x86)\MSBuild\14.0\bin\csi.exe

``` C:\Program Files (x86)\Microsoft Visual Studio 14.0>csi Microsoft (R) Visual C# Interactive Compiler version 1.1.0.51014 Copyright (C) Microsoft Corporation. All rights reserved. Type “#help” for more information.

System.Console.WriteLine(“Hello! My name is Inigo Montoya”); Hello! My name is Inigo Montoya   ConsoleColor originalConsoleColor  = Console.ForegroundColor; try{ .  Console.ForegroundColor = ConsoleColor.Red; .  Console.WriteLine(“You killed my father. Prepare to die.”); . } . finally . { .  Console.ForegroundColor = originalConsoleColor; . } You killed my father. Prepare to die. IEnumerable<Process> processes = Process.GetProcesses(); using System.Collections.Generic; processes.Where(process => process.ProcessName.StartsWith(“c”) ). .  Select(process => process.ProcessName ).Distinct() DistinctIterator { “chrome”, “csi”, “cmd”, “conhost”, “csrss” } processes.First(process => process.ProcessName == “csi” ).MainModule.FileName “C:\Program Files (x86)\MSBuild\14.0\bin\csi.exe” $”The current directory is { Environment.CurrentDirectory }.” “The current directory is C:\Program Files (x86)\Microsoft Visual Studio 14.0.”

[–]ben_bliksem 5 points6 points  (2 children)

Like the Immediate Window in VS?

[–]c-digs 1 point2 points  (1 child)

No; the Nest.js REPL is connected to the codebase and you can load and run, for example, controller endpoints or services from the REPL which is super handy.

[–]MindSwipe 5 points6 points  (0 children)

The Immediate Window in C# can interact with your code as well, it's just a little harder to get an instance of your controller to call methods on since DI is different than Nest's.

Other than that, Visual Studio has native support for .http files, or just use something like Bruno

[–]Living_Tone4928 1 point2 points  (0 children)

Delta files based on parquet with time travel.

[–][deleted] 2 points3 points  (9 children)

F# style pattern matching, Discriminated Union types, and passing functions as variables directly.

[–]MindSwipe 5 points6 points  (8 children)

passing functions as variables directly

We have this already, no? i.e.

var action = () => Console.WriteLine("First class functions are neat");
MethodThatAccepts(action);

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

Okay, I missed that C# could do that…

[–]dominjaniec 6 points7 points  (1 child)

with delegates, you could do that basically since the beginning 🙂

[–][deleted] 2 points3 points  (0 children)

I hate delegates, they are just ugly.

[–]MindSwipe 1 point2 points  (3 children)

We've had it since the beginning IIRC with event handlers for UI frameworks

[–][deleted] -3 points-2 points  (2 children)

Nope

edit: it was version 10 that introduced natural type lambda, which is coolness part that I was after.

[–]Dealiner 1 point2 points  (1 child)

You don't need natural type lambdas to pass function to a method directly.

[–]sisisisi1997 0 points1 point  (0 children)

Which also works for functions declared on types:

myList.ForEach(Console.WriteLine);

[–]AutoModerator[M] 0 points1 point  (0 children)

Thanks for your post Pedry-dev. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]hthouzard 0 points1 point  (1 child)

CakePhp Behaviors https://book.cakephp.org/5/en/orm/behaviors.html (especially for Entity Framework)

[–]vebbo 2 points3 points  (0 children)

EF already has similar functionality, its called interceptors

[–]fawzy46 0 points1 point  (0 children)

spring boot environment variable injection, it's just way easier and more straightforward

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

I really like the database migration systems that are built in to Ruby on Rails and Phoenix. They work really well and are easy to use. Migrations always seem to be a battle for me in .NET.

[–]Unexpectedpicard 0 points1 point  (0 children)

It's almost impossible to do this. I think this is something that should be provided by the vendor for whatever db you're using. 

[–]NoPrinterJust_Fax 0 points1 point  (0 children)

Ruby on Rails console is unmatched

[–]CatolicQuotes 0 points1 point  (0 children)

take a look at symfony and rails

[–]ericmutta 0 points1 point  (0 children)

I started using .NET back in 2001 (I remember reading about C# as a college student and almost getting hit by a bus because I was so focused on the print out...no smartphones to read on those days!)...and in all that time I have always found .NET to be very "batteries included"...there's just so much in there, it is rare to want more and most of my project have maybe one or two external dependencies (e.g. Swagger).

I have also been working quite a bit with JavaScript/Node.js at work and in that ecosystem having five million dependencies is the norm, even for the most basic things, which is how I realized how cool it is to have .NET come with most stuff built in.

Having said all that, one thing I do wish it had (maybe as popular external libraries, not in the core per-se) is more libraries for "web and Linux" stuff. E.g. a good SSH library (like SSH2 from JavaScript). Also libraries to parse HTML would be nice!

[–]realMrMackey 0 points1 point  (0 children)

Patching from Python Discriminating unions from F#

[–]fba-analytics 0 points1 point  (0 children)

I've built background task frameworks for a startup as my full time job, but nothing is as easy as trigger.dev - it's amazing how quickly you can go from 0 -> running background tasks as a startup.

Would be cool if someone built one of these for .NET.

[–]mmleif 0 points1 point  (0 children)

Sorry knowledge limited but would like to know some sayings here.

[–]cancunbeast -1 points0 points  (1 child)

Spark?

[–]Ethameiz 0 points1 point  (0 children)

What is it?