5 ms·
Have you ever used Visual Studio? It sounds like you're describing the code analyzers that have been available for several years now. For example, with an oppo
by Anon4Now 6y ago
Have you ever used Visual Studio? It sounds like you're describing the code analyzers that have been available for several years now.
For example, with an opportunity for string literals, there will be a light bulb in the left border. Pressing "Ctrl ." will bring up a list of suggested fixes. You can opt to select one, hit Enter, and the changes are automatically applied.
I believe there are similar extensions for VS Code.
- fy20 6y agoVS Code does this for TypeScript out of the box. For example if you have a function with Promises it will suggest it be rewritten (and rewrite it for you) using async.
- emteycz 6y agoIt's very dumb compared to what's available for C#, though. C# code helpers are able to code a simple class with their suggestions.
- smt88 6y agoThe only reason you need your IDE to write classes for you in C# is because C# has nominal typing and tons of boilerplate (ex: getHashCode()). I've written millions of lines of C# and hundreds of thousands of TypeScript, and I use JetBrains JDEs for both these days. Class generation is absolutely not something I need or miss in TypeScript.
- manigandham 6y agoThat boilerplate is automatically added by the compiler. You don’t need an IDE to do it. There are tons of examples of very lean C# that can be written in notepad.
- smt88 6y agoBefore records, the compiler did not generate code required to properly use classes (or even structs) as value types. There's a reason everyone is so excited about records. I have apps with thousands of lines of implementing comparison/equality interfaces, overloading operators, etc. for my data objects. You can definitely write it all in Notepad, but it would be a massive waste of time.
- emteycz 6y agoI also write TypeScript, daily for the past 5 years. I wasn't talking about boilerplate, the C# analyzers like ReSharper can determine which variables are you probably going to use, what methods are you going to call, and what parameters will you give them. I'd love to have them in TS.
- smt88 6y agoJetBrains IDEs do all of that. They just don't really generate code for the most part.