How to cout bytes for winforms programs? Just met a strange situation here:
C#, 120 bytes
using System.Windows.Forms;class P{static void Main(){var a=new Form();a.Controls.Add(new CheckBox());a.ShowDialog();}}
This code assumes console application and contains full code that can be compiled.
C# (Windows Form Application), 82 bytes
using System.Windows.Forms;class F:Form{public F(){Controls.Add(new CheckBox());}}
Assumes winforms application. There should be additional autogenerated file with code for running the form. And that code is out of calculation... Because of project type?
Is it like some preset we should not count assuming that C# and C# WinForms are different?
VB.NET, 67 (program) + 37 (additional switches) = 104
Class F
Inherits Form
Dim C=New CheckBox With{.Parent=Me}
End Class
vbc.exe *.vb /main:F /imports:System.Windows.Forms
It's a full code and command line for compiling and running it.
/main:F /imports:System.Windows.Forms
takes more than a half of program weight.
But what if I use VB.NET WinForms?
I do not have any explicitly generated files (like I do have in C#) I do not need any command line updates and I have that imports by default. So I'll get just 67 instead of 104?
I see it in such way
- Some-Lang and Some-Lang Winfroms are different languages
- If form designer is not used and
designer
file should be deleted, only code is counted. - If form designer is used, size of
designer
file should be added. - All other files and settings except startup form name are kept unchanged and are not counted.
But:
- What if they are not unchanged?
- What if there are some changes in progect settings?
Some-Lang
I meant any language that can be used for console application (as default) or for winforms application with autogenerated solution (or project) template. So the difference is pregenerated code in multiple files. \$\endgroup\$