PDA

View Full Version : c# or win32 api



kantze
03-29-2008, 04:58 AM
Hello there. Me and my friends are trying to find a good (easy and powerful enough) way to build apps with interface. Till now, I've tryed to learn win32 api using c(i find it too hard).
But these days a friend of mine showed me a program he wrote in c# that amazed me and as he said, was simple to be done.
Is c# a better way to build apps with interface than win32 api?
What language and which purpose would you reccomend me for this purpose?

I'd like to learn not only for fun but also for professional purposes.

P.S. sorry for my bad english ;)

zacs7
03-29-2008, 05:24 AM
For me, I use Gtk+ mainly because it's portable (well more than the Win32 API). You don't need to move languages just to build a user interface ;)

Neo1
03-29-2008, 05:50 AM
Try taking a look at MFC, it's a framework for Win32 which makes everything a bit easier and faster.

VirtualAce
03-29-2008, 07:36 AM
If you want to maintain the C - like syntax and gain a bit more horsepower with GUI then C# is a definite option. As to whether it's better or not really depends on what you are trying to do. Some things are far easier in C# and some are not. MFC has a significant learning curve and C# does not. That fact alone may have already answered your question.

Let's say that C# is yet another way for you to build GUI apps.

DavidP
03-29-2008, 10:11 AM
If you are looking for something with a less-steep learning curve, then C# is definitely a good way to go. C# is a nice language and it definitely helps make GUIs easier in Windows. But yeah you should also look into MFC.

What IDE are you using? Visual Studio Express? C++Builder? If you are using either of those, then there are some drag and drop features that also help in designing a GUI.

kantze
03-29-2008, 02:12 PM
I can't understand what "...a less-steep learning curve" means! Does it mean that c# does the job easier but it's less powerfull? Something like basic??

@DavidP: I'm using visual studio 2008

DavidP
03-29-2008, 04:16 PM
http://en.wikipedia.org/wiki/Learning_curve

IfYouSaySo
03-30-2008, 10:38 AM
I have no idea why someone would recommend MFC or Win32 over C#. C# is easily more powerful for building windows-only apps, and especially GUI apps. There really is no comparison. And if you by chance find something that you can't do with .NET Framework classes, you can always use either COM or calls to unmanaged code. And also, the documentation and online examples on msdn are much better for C# than they are for MFC. This point shouldn't be minimized, because it's important to have good examples when learning this stuff.

maxorator
03-30-2008, 01:05 PM
I have no idea why someone would recommend MFC or Win32 over C#. C# is easily more powerful for building windows-only apps, and especially GUI apps. There really is no comparison. And if you by chance find something that you can't do with .NET Framework classes, you can always use either COM or calls to unmanaged code. And also, the documentation and online examples on msdn are much better for C# than they are for MFC. This point shouldn't be minimized, because it's important to have good examples when learning this stuff.

Simplicity depends 100% on people. It cannot be used as an argument.
API and API wrappers are WAAAAAY quicker than C#. (Want an MD5 test?)
I totally hate the awful lag I get in C# applications.
API and wrappers use the quite useful device called the "processor".
Whereas C# runs through layers of bloatware.
C# is MSs crap, but many wrappers are portable.
Most dumbusers use C# so they need more documentation.
API also uses the software called the "Operating System" where C# still runs through bloatware

Elysia
03-30-2008, 01:21 PM
I want to point out that MFC is C++ and not C and it's only available in Visual Studio Standard Edition+. That means shelling out, like, $300 at least. Unless you are a student, you can get Professional for free.
And all sort of frameworks are far better than pure Win32.

Let's just say that C# is yet another way to build a GUI. It depends on your purpose and the time you want to spend on it. Sure, it's easier to use. Do you need it to create professional looking, shiny GUIs? No. It can be done, yes, but it isn't a requirement. The new 2008 MFC will allow you to do that once it's released.
Plus, not to mention, there are several solutions out there for MFC/C++/C that already does this.
MFC is slower to learn, but it's much faster than C#. It's just to take a pick. No one is going to force you.

NeonBlack
03-30-2008, 01:33 PM
API definitely beats C# in every aspect except ease of use. And the .Net framework keeps getting more and more bloated. (It nearly tripled in size from version 2 to version 3)
If you just want something to play around with, then C# is probably fine. And I think in the near future more employers will be looking to hire "C-pound" experts, but anything you use to make windows apps will be eventually built upon the API, knowing a little API will never hurt you.

So at last I say, Why not do both?

maxorator
03-30-2008, 02:58 PM
And all sort of frameworks are far better than pure Win32.
Frameworks are not better than pure Win32, because good != ease_of_use, it depends on many other things too.

You can't simply say something is better, you can only say that something is better at some aspect, because the importance of different aspects depends greatly on people.

And btw, there indeed ARE awful frameworks.

IfYouSaySo
03-31-2008, 12:45 AM
I've written apps both ways (MFC and C#) and I can say I would never willingly choose MFC for a future windows GUI app. C# is just much much easier to use.

BTW...just because something is easy to use, doesn't make it good. Yes, you're right. Absolutely. But if something is easy to use, and it also turns out to be good, then it will be prefered over something that is difficult to use and also good. And that is why I wil always prefer c# (for building windows GUIs or other windows-only apps).

I should say that by trade I code in c/c++ for unix. So it isn't like I'm some m$ loving c#-hugger. I'm just calling it like I see it.

Elysia
03-31-2008, 05:12 AM
Frameworks are not better than pure Win32, because good != ease_of_use, it depends on many other things too.

You can't simply say something is better, you can only say that something is better at some aspect, because the importance of different aspects depends greatly on people.

And btw, there indeed ARE awful frameworks.

Maybe I overworded :p
I suppose I was hinting at that Win32 API is horrible and that most frameworks goes to at least a length to hide that.

maxorator
03-31-2008, 06:01 AM
Maybe I overworded :p
I suppose I was hinting at that Win32 API is horrible and that most frameworks goes to at least a length to hide that.
Horribility depends on what kind of code seems nice to you (for example I don't like the OO look of many wrappers). ;)

BTW...just because something is easy to use, doesn't make it good. Yes, you're right. Absolutely. But if something is easy to use, and it also turns out to be good, then it will be prefered over something that is difficult to use and also good. And that is why I wil always prefer c# (for building windows GUIs or other windows-only apps).
Well, actually it could be seen as:
C# - extremely easy to use - good
Win32 - easy to use - extremely good

:D

indigo0086
03-31-2008, 06:08 AM
Some of you are using the name C# as though it's a GUI API, I think you mean Windows Forms for C#.

maxorator
03-31-2008, 06:11 AM
Some of you are using the name C# as though it's a GUI API, I think you mean Windows Forms for C#.
Details, details. :D

Anyway, how many GUI APIs there are for C# anyway?

indigo0086
03-31-2008, 10:40 AM
Anyway, how many GUI APIs there are for C# anyway?


Well there's...

*Takes vase and runs away*

Prelude
03-31-2008, 10:51 AM
>Anyway, how many GUI APIs there are for C# anyway?
Two, if you only count the ".NET" frameworks: Windows Forms and Windows Presentation Foundation. You can also hook into the Win32 API and other third party libraries if you really want to.

abachler
03-31-2008, 11:12 AM
Hammer's are better than screwdrivers!

Personally I dislike C# and will probably never use it, but that is because it does not meet my needs. Is it C+=2? no, definately not. But I see that it might be Microsofts attempt to get scripters away from Visual Basic and into a more flexible language. If all your job entails is writing gui interfaces for simple applications, then C# may be the way to go if you do not already know win32. Its probably easier to learn for most new users. Even Microsoft admits that for Raw Horsepower you need C/C++, just look at the Express downlaod page and how it describes each package.

My job entails a lot of HPC and custom hardware interface's. I need the low level control and flexibility that C/C++ provides, so C# isn't even an option of last resort for me. Other programer's may have different needs though, so C# may be a better choice for them.