[C#] Latest nightly C# code gen produces awful looking code
See original GitHub issueFrom the inception, the main differentiator for AutoRest (as opposed to other code generators) has been that it produced beautiful code that always compiled and looked like it was hand written. Unfortunately the latest changes in the C# code generator go completely against this paradigm.
// Construct URL
var _baseUrl = this.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "status").ToString();
// Create HTTP transport objects
System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
System.Net.Http.HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
Please bring back “usings” and find a better way to avoid type conflicts.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Ask HN: What's the largest amount of bad code you have ever ...
It is close to 25 million lines of C code. What an unimaginable horror! You can't change a single line of code in...
Read more >Invalid LLVM coverage data produced when compiled with -C ...
I tried this code: use num_integer::Roots; fn main() { let a:u32 = 54321; ... new version in the works, so generating both Rust...
Read more >10 Key Learnings in Rust after 30000 Lines of Code
10 Key Learnings in Rust after 30,000 Lines of Code. I used to love C and C++. If we date back to the...
Read more >In 10 years, Clang has become 2x slower, but generates code ...
According to this, Clang has become 2x slower and runs a highly manually-optimized, largely C-like codebase (see earlier blog post, "Is C++ fast ......
Read more >Suspected bad code generation for x64 Release build
C :\Users\Nobody\source>cl Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25835 for x64 Copyright (C) Microsoft Corporation. All rights reserved. usage: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed as of #1617
Agreed. We’ll prioritize the fix.