Console vs WinForms

Cavar

Well-known member
Joined
Sep 5, 2006
Messages
60
Programming Experience
5-10
Is there any benefit to writing a utility app, no GUI, as a console app vs. a winforms app that never shows a form?

There's the obvious import/using differences, but what else?

My boss won't create a console app and forces me to make every small utility app as a winform app.

CT
 
Just to throw this into the mix, but it is possible to make windows services too, which is a GUI-less app
 
how about creating a mix of console app and winform? that should satisfy the both of you. add a switch or something to run in console mode.

Yeah, I made a database schema comparison tool that uses this method. It runs as a console via a scheduled task, then I can just run the exe to get a GUI to view differences.

CT
 
You've got the question the wrong way around. The question is whether there's a benefit to using a WinForms app and the answer is "no". You have the overhead of loading the System.Windows.Forms.dll assembly AND the System.Drawing.dll assembly and creating a Form object for absolutely no reason. What reason can your boss provide for this apparently arbitrary decision? What benefit have they imagined?
 
What reason can your boss provide for this apparently arbitrary decision? What benefit have they imagined?

No clue what he's thinking, he just says that until I am in charge, I'll continue making the utilities using WinForms, so I do.

Who knows, maybe one day he'll change his mind, it did take me awhile to convince him that he didn't need a .Dispose call inside a using block as below.

VB.NET:
using (SQLConnection conn = new SQLConnection("connection_string_here"))
{
     conn.Dispose();
}

Thanks,
CT
 
I'm not sure how defensive he's likely to get but you could tell him that you've consulted some experts and you've been told that using forms that never get shown adds an unnecessary overhead for no benefit. Ask him if he'd care to let us know what he perceives the benefit of using WinForms to be so we can see if we agree. That said, if someone is just too juvenile to admit that they're wrong then you're just stuck doing it their way. At least it's not a big deal to do it in WinForms.
 
I'm not sure how defensive he's likely to get but you could tell him that you've consulted some experts and you've been told that using forms that never get shown adds an unnecessary overhead for no benefit. Ask him if he'd care to let us know what he perceives the benefit of using WinForms to be so we can see if we agree. That said, if someone is just too juvenile to admit that they're wrong then you're just stuck doing it their way. At least it's not a big deal to do it in WinForms.

Yeah, he's just too set in his ways to change, so I won't even argue with him about it.

I can't tell you how many times he's done a complete re-write of a utility app just because he doesn't want to bother how to understand how it was written to begin with.

Anyways, thanks for the input.

CT
 
Back
Top