I am fluent in most of Java and have thought about moving on to a .Net language. Obviously C# and Java are very similar so I have chosen to learn C#. When programming in Java I would always use Eclipse as my IDE, which doesn't have a Drag and Drop system for creating the UI. I noticed, however, that Visual Studio does for all .Net languages. I love to keep my code clean and format it in my own away and do not like how Visual Studio formats it. I have looked for tutorials on how to program the GUI instead of using Drag and drop but cannot find any tutorials. Any help? Do I have to use the Drag and Drop system. (By "the Drag and Drop System" I meant he form creator.)
Code generators increase productivity...
Code generators available in Visual Studio are here to make your life easier. This includes the one which generates code for Windows Forms.
A graphical tool like that is particularly useful when you need to communicate that this button is large and is positioned here, while that one is small and is just in this corner, but not too close to the border: having to position the elements through code would be much harder. If you're not convinced, try to do both techniques while sitting near a stakeholder or a designer who actually takes decisions about the look of a form; what would be more productive: to have an immediate visual feedback after every change, or to have to recompile and rerun the app every time, trying to guess whether "close enough to the border" should be 11, 12, 13, 14 or 15 pixels?
... so be productive
As a programmer or a developer, you're expected to write clean code when it is beneficial for the project. Following the clean code dogma in every case makes you unproductive: in other words, you become a burden for the project.
It's your job to determine right where clean code matters, and where anybody couldn't care less.
A piece of business-critical code which will be read thousands of times by you and your colleagues over ten years period and frequently modified has every reason to be as clean as possible. On the other hand, boilerplate code nobody will read doesn't have to be well commented or nicely indented.
Code generators also have a benefit compared to a human: machines have less chances to introduce a subtle bug. Guess how much bugs I've found in code produced by code generators for the last five years? Zero. On the other hand, when repetitive and monotonous tasks are performed by humans, errors have a great risk of being introduced. A bug at this level would only decrease your productivity.
Side note: as a recruiter, I'll probably reject a candidature of a .NET WinForms programmer who claims that he don't use WinForms code generator because he prefers writing clean code by hand. While I favor persons who are able to write clean code, I don't need a person who is wasting my money typing by hand boilerplate code.
Code generators don't necessarily produce ugly code...
Talking about clean code, Windows Forms code is not the ugliest one. It could certainly be better (and at least be compliant with the official style guidelines enforced through StyleCop and official recommendations enforced through Code analysis), but in all cases, the usage of partial classes with two
SuppressMessage and a
GeneratedCode similarly to this example makes it possible to abstract completely this part of the code and prevent it from spawning useless warnings during static checking.
... but not all code generators are equal
Code generator for ASP.NET (WebForms) is a very different beast. It's not particularly useful: unless a programmer doesn't know HTML, he'll be as efficient (if not more) writing code directly. My recommendation is to never use this code generator.
Code generator for WPF is quite useful when you don't know the exact names. On the other hand, it often produces code which is much more complicated than it should be. My recommendation is to use this code generator selectively, and try to write most XAML code by hand¹.
Code generator for LINQ to SQL and for Entity Framework is a must-have. There is no need to write boilerplate code by hand. T4 is an excellent feature which reduces even more the necessity to write repetitive code.
This being said, nothing forces you to use those code generators. You can create a form directly in code, including through Visual Studio.
¹ I have used WPF in Visual Studio 2010 only. Things may have changed since then, and if I remember well, next versions of Visual Studio were advertised for having a much better WPF editor.