The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Enviroment for small application development

Hi All,

I'm hoping for a little advice. I spend most of my time writing embedded code on proprietary platforms, device drivers, real time etc. However occasionally I need to write a windows application to interface with an embedded device. To do this I'm still using Visual C++ 6.0, and occasionally VB6 if there is a lot of GUI related functions. This solution is starting to get a bit long in the tooth to be honest.

I'd like to get myself back into line with current technology but there seem to be many options available. Features I need are,

* Good access to hardware, serial ports, USB etc.
* Easy networking via TCP/IP
* Good community support.
* Easily create modern looking GUI's
* Some sort of managed file access would be usefull, XML etc.

So my current thinking is to look at C# on .NET. I was wondering if anybody had comments/experience to share.

Thanks,

Andy
Andy Send private email
Tuesday, June 13, 2006
 
 
There are lots of other posts on this topic out here already. I can boil them all down to the following:

C# is awesome as long as having to distribute the .NET Framework isn't an issue for you. If you are writing Enterprise apps this probably won't be a problem. If you are writing shrink-wrapped consumer apps then this could be an issue as many users won't have it installed yet and may not want to have to install it just to use your application. That's pretty much it.

Some other bits of advice:

1) Don't let anyone try and talk you into VB.NET just because you listed VB6 as prior experience. Learn C#.

2) If you are just looking to get your feet wet then download the Visual Studio Express edition. It's free and pretty much fully functional.

3) C# has great interop support so you can easily call COM components, native DLL's, and much more.

4) Take any anti-.NET rants with a grain of salt. Some people are just so anti-Microsoft it isn't even funny. You are specifically asking about how to easily create good Windows apps on the Windows OS. Why not use the premiere tool provided by Microsoft for such a purpose?

5) Learning C# pretty much gives you Java for free. They are so close in syntax that you literally can't tell the difference sometimes. I learned C# first and picked up Java in a couple of hours.

Good luck and have fun. Coming from a similar background I can tell you that after learning C# I never wanted to go back!
anon
Tuesday, June 13, 2006
 
 
Oh, and having the .NET Compact framework available for writing apps on WinCE and PocketPC devices is also a major plus.
anon
Tuesday, June 13, 2006
 
 
thanks for the advice. I have had a read of post's on this topic before but not quite from this angle. I've not really been considering VB .NET as C type syntax is my first language.

Distributing a run time libary isn't too much of a problem as the user base for these application's is relativly small.

So I guess my next question is can anybody reccomend a good book to get started in C#? Ideally something targeted at a C/C++ programmer looking to get up to speed on the practicalities + GUI development. If it could include some low level stuff, driver interfaces, dll's etc that would be usefull.

Thanks,

Andy
Andy Send private email
Tuesday, June 13, 2006
 
 
Personally, I believe C# to be an excellent language for rapid application development, while also allowing you to get down into the nitty gritty of things (after all, you can do pointers in C#).  It is a bit more verbose than scripting lanugages (Perl, Lisp, Python, Ruby), but coming from C/C++ or Java, it'll feel natural.  There is lots of community support and lots of free code on the internet.
Joshua Volz Send private email
Tuesday, June 13, 2006
 
 
That's my only worry about C# really Josh, low level capability. Ocassionally I have to dig down to the bit level, so pointers etc are pretty important.
Andy Send private email
Tuesday, June 13, 2006
 
 
you can always write some code in plain old unmanaged c++ and use p/invoke to call it from c#.
starving coder
Tuesday, June 13, 2006
 
 
+1 for anon's post. Spot on.
Vince Send private email
Tuesday, June 13, 2006
 
 
I think its interesting how, years later, the issue of deploying the .NET runtime is still so prominent on these and other forums. (I totally agree that this is a major issue, but a lot of smart people have been blowing it off for years).
NetFreak Send private email
Tuesday, June 13, 2006
 
 
> Good access to hardware, serial ports, USB etc.

That probably isn't C#, but from C# you can call C and C++ DLLs (including the Win32 API).

>
* Easy networking via TCP/IP
* Good community support.
* Easily create modern looking GUI's
* Some sort of managed file access would be usefull, XML etc.
<

That's C#.

> can anybody reccomend a good book

Knowing VC v6 already I didn't need a book to learn C#: reading the C# language reference and then the .NET framework documentation (both part of the MSDN online help) was sufficient.
Christopher Wells Send private email
Tuesday, June 13, 2006
 
 
"I totally agree that this is a major issue, but a lot of smart people have been blowing it off for years"

The truth is, however, that of all the issues this is the most major and yet it's still almost a non-issue.  The first .NET application I installed simply downloaded the framework from the 'net as part of the installer and kept on going. 

I assume if I hd the CD copy (mine was a download copy) that it would have been automatically installed then too.
Almost H. Anonymous Send private email
Tuesday, June 13, 2006
 
 
Also, don't forget that C# itself has pointers in the language, not just references. You need to use "unsafe" code to do it, but if you need raw memory manipulation you can do it directly from C# without having to drop down into C++.

Unsafe code isn't allowed to run in some circumstances (downloaded code, ASP.NET on a web server) but will work just fine in the "deploy .exe to the machine it will run on" scenario.
Chris Tavares Send private email
Tuesday, June 13, 2006
 
 
Learning C# is trivial - what you need to learn is the .NET Framework.  I recommend the 'bible' - Applied Microsoft.NET Framework Programming by Jeffrey Richter
Mike Send private email
Wednesday, June 14, 2006
 
 
Or rather, the new edition which is called "CLR via C#". :)
Chris Nahr Send private email
Wednesday, June 14, 2006
 
 
I don't intend to run down C# here.  It seems to be a fine language and it's probably an excellent choice for you to work with.

Have you considered sticking with C++ and using one of the nicer GUI libraries like Qt or wxWidgets?  Both libraries have very nice layout tools available and let you continue using native code.  That deals very well with your requirement to handle low-level interaction.

Again, C# may well be the right choice for you.  I just wanted to cry out as the lone voice in the wilderness in favor of native code.
Clay Dowling Send private email
Wednesday, June 14, 2006
 
 
Another option is C# for the majority, and C++/CLI for the low-level stuff. This would work fantastically, and indeed is what I use here for some stuff.
K
Wednesday, June 14, 2006
 
 
I use C# everyday, but for this purpose, I would strongly consider Java. There are some issues that are similar, e.g. having to download the environment. The device independence might save your bacon sometime.

Java is free, but somewhat more trouble in the design of Windows forms (the downside of device independence). As noted above, the syntax is very similar but the libraries are so different that it's not really the same. I wouldn't want to be switching back and forth.
Peter Vanderwaart Send private email
Wednesday, June 14, 2006
 
 
"I use C# everyday, but for this purpose, I would strongly consider Java."

Huh? Why in the world would you recommend Java? The guy wants to write Windows apps not cross platform apps. The next logical step is C# based on what he said he wants to do and where he is coming from.

I don't see why Java is a better choice. You say yourself that doing windows apps on Java is more painful. Also, calling C++ code from Java and interacting with devices on Java is much harder. "Device independance" means that it doesn't really do any specific device "well". He wants to get down and dirty with specific devices. C# lets you do this either directly (serial ports, etc.) or indirectly through interop. Doing the same thing with Java is much more painful. Sorry, I just don't see your logic. But maybe I'm missing something.
anon
Wednesday, June 14, 2006
 
 
I'm keen to stick with C type syntax as that's what I use for most of the day. I've seen Java app's on windows and to be honest it's not quite what I'm looking for. Really I want to build modern looking applications and merge my current combination of VB6+MSVC++6 into one enviroment. Rapid development here is key.

I've had a go at pulling some old USB code into a winforms  app and it's turning out to be pretty non trivial due to reliance on the Windows DDK. It seems that your a bit on your own if you want to do any sort of driver development on MSVC++ 2005.

Has anyone read Ivor Horton's Beginning Visual C++ 2005, it has a couple of good reviews on Amazon. Basically I'm looking  for an intro to C++/C# 2005 aimed at an experienced C programmer with some C++ experience.

Thanks for the help guys,

Andy

Wednesday, June 14, 2006
 
 
Go to the Microsoft Visual C# Express site and download the program and the videos under Learning Resources.

The videos are aimed at very new users (first time developers), but you should see enough that it should click.

Wednesday, June 14, 2006
 
 
"Don't let anyone try and talk you into VB.NET just because you listed VB6 as prior experience. Learn C#"

How about because VB.Net has more productivity features than C#?

1.) C# doesn't have optional arguments. You have to do a ton of overloading to get the same effect.

2.) Events are easier in VB.Net.

3.) Better error handling in VB.Net (e.g. Catch ex as Exception When CondtionA = True ...)

See more reasons here: http://www.vbrad.com/article.aspx?id=65

VB.Net 2005 also now has operator overloading and increment/decrement operators...so what can you do with C# that you can't do with VB.Net?
Wayne B Send private email
Thursday, June 15, 2006
 
 
However, to Andy (the OP) I say that C# is a better choice for him/her because it sounds like you probably spend more time in C++ not VB.

Anyway, for a really good conversation on the differences betweeen the two languages (I *just* found this while mucking around ch9) see this: http://channel9.msdn.com/ShowPost.aspx?PostID=204924
Wayne B Send private email
Thursday, June 15, 2006
 
 
I tend to favor Clay Downing's view of this; especially since your core market is embedded.  I can't imagine running an interpreted language for embedded stuff.

I imagine your C# works is also for workstation stuff?  Possibly you are interfacing embedded hardware to a PC via serial, USB, parallel, Ethernet, etc...

I would stick with C++ and go with a full GUI IDE.  I'm partial to Borland's products in this area because I know them very well; yet I know Borland's future in this market has a big ? floating over it's head.  I have no doubt, however, that I'm safe and someone will pick up their toos but if I were starting out new, I don't think I'd choose Borland's tools at this point.

There are some really cool open source IDEs under Linux like KDevelop.  Under Windows there is Dev-C++ from bloodshed.

Like Clay, since your in the embedded world, I'd keep my tools together; nothing against C# but things I don't like about C# is that it is single vendor controlled -- noting this is not saying anything about the merits of the language itself.

my 2 cents.
~Eric
Friday, June 16, 2006
 
 
Use C# for the GUI.  If C++ really is required for the low-level parts, that does *not* need to slow you down for the rest of the app.

The thing I truly love about C# is that I can call anything.

.NET DLLs, well, yeah, of course.  C DLLs?  The declare function metadata is not unlike what you've seen in VB6, just more explicitly stated.  COM DLLs?  Add Reference.  C++ DLLs?  Write a .NET-compatible wrapper in C++.  (No metadata - this time you have to write code.)  Java DLLs?  What, there's no such thing?  That just means you haven't found IKVM yet, which translates Java libraries into .NET DLLs.
Chaz Haws Send private email
Sunday, June 18, 2006
 
 
IKVM - That's pretty sweet. It was only a matter of time...
Wayne B Send private email
Monday, June 19, 2006
 
 
Quoting:

"2) If you are just looking to get your feet wet then download the Visual Studio Express edition. It's free and pretty much fully functional."

-------------------

Should be:

"2) You have until June 30 to goto the Microsoft e-learning site and watch three webcasts (basically click the links to get credit) and have them mail you a free Visual Studio 2005 Standard Edition for free."

Just got mine in the mail, too bad I don't need it (had a higher SKU already).  Trying to find some unfortunate person to shell it off to at school or something.

Nate.
Nate Send private email
Tuesday, June 20, 2006
 
 
But you can use the express until then.  Pity they're all split up into different downloads, though.

Nate.
Nate Send private email
Tuesday, June 20, 2006
 
 
"...and have them mail you a free Visual Studio 2005 Standard Edition for free."

Nice tip.  I got mine from going to the launch event. :)
Chaz Haws Send private email
Wednesday, June 21, 2006
 
 
Yes, it's nice.  The Express aren't TOO far behind the standard edition in terms of functionality, but the lack of an "integrated" IDE for each language product is a real pita.  And anyways, they give you the full *real* MSDN library with it.

Nate.
Nate Send private email
Sunday, June 25, 2006
 
 
Hi Nate,

That offer sounds great, could you point me in the right direction. I've had a good search around the e-learning site, but can't see anything.

Thanks,

Andy

Monday, June 26, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz