Visual C++ / C# / VB / Java / ETC. - Page 1
Forum section: electronics / beginners

author: sidharth
author_rank: Newbie
timestamp: November 22, 2013, 05:56:03 am
content: Hi,Occasionally there are projects that come my way which need a computer GUI other than the usual micro controller based embedded system.A project came my way that I had to let go of, for various reasons, one of them being, I did not know how to develop this GUI by myself. Now I know there there are people that do this for you... but... these guys are not used to doing things at an embedded level, they think more along the lines of a desktop level. Anyway, I decided that I need to start learning this sort of thing.Here's a brief description of that project I was referring to:The application was that of a basic low cost medical treadmill where the patient walks / runs as per the doctors input on a PC. Designing a micro controller based system with RS232 or may be even USB seemed easy, but the treadmill interface GUI needed to be developed from scratch & this had some very specific requirements too.Now, I am not looking to get into IT or become a software engineer or something... but I would like to take on projects as the one described above. From my preliminary research there are a plethora of languages that can accomplish this. Also Microsoft seems to be phasing out VB.Finally, my question is... as an electronics engineer... which programming language/s is best suited for this sort of application? Is it VB, or VC++, perhaps C#, may be even java. Your thoughts?!!Thanks,Sid

author: ivaylo
author_rank: Frequent Contributor
timestamp: November 22, 2013, 06:33:08 am
content: If you know VB, do VB (are they really phasing it out?).Had to do something similar myself last week. Just downloaded the latest Netbeans whipped the GUI I needed in Java (easily found all the crazy libraries I needed). But I've done it before (although years ago). With the Java/Swing IDEs you have to know what to trust to delegate to the IDE and what to do yourself (quite a bit more than with VB). Until you learn Swing and don't need the IDE any more. This has the advantage of running on any OS too.Many people do this in the browser too. Just run a small server somewhere. It has it's advantages, but if you haven't done any web stuff it is another can of worms.

author: Kjelt
author_rank: Super Contributor
timestamp: November 22, 2013, 07:45:22 am
content: Depends on the GUI, if you really have to do nice and fast graphical displays I would recommend C#, you can use Visual Studio.But I have to warn you, the learning curve can be steep, esp. if you have to do fancy stuff and you have to know the target OS (platform).I am currently finding this out and I only have to do some buttons and text and comboboxes, still it is another language which is quite different from ansi C as I am 90% doing and it needs a different kind of thinking (more OO, classes, seperation of the GUI parts from the calculations etc.).You also probably need stackoverflow.com (as F1 HELP site) to find out how to do thingsVB is kinda old (will not say obsolete but for new students I would not recommend it), C++ is now being replaced with C# so better go that way. Java also good candidate if you have to build web based stuff, which is platform independent but the html won't let you give the nice GUI experience as a real platform program would.So it depends on your assignment. IT is so wide and big you can not do it all, you have to choose.If I would have to do such projects I would still team up with a senior C# programmer, split the project in two, let him do the GUI and take care of the electronics and embedded stuff myself, they are two different worlds.

author: Anks
author_rank: Frequent Contributor
timestamp: November 22, 2013, 10:23:37 am
content: I use C# and get things done quick in VS but if you need cross platform Mono works well but can come with some headaches especially if you need something that's in Microshafts version that's not been implemented. These situations now are few and far between but 3 years ago were common.VB is very basic hence the name but its amazing what people can do with it but given the new direction companies seem to be going I would still chose C#. As of C++ it was my preferred language but now it takes too much time just to get a simple GUI together that its hardly practical.At the end of the day someone will pop up and say its horses for courses so chose your weapon.

author: Rigby
author_rank: Super Contributor
timestamp: November 23, 2013, 12:27:44 am
content: Quote from: Anks on November 22, 2013, 10:23:37 amChoose C# or Java if you don't want a lot of headaches later.edit: I say this because finding skilled Java and C# developers later to take over is as easy as pie.

author: Rory
author_rank: Frequent Contributor
timestamp: November 23, 2013, 12:44:51 am
content: Been using Powerbasic for several years. Doesn't require a runtime library installation like VB.net does.

author: Maxlor
author_rank: Frequent Contributor
timestamp: November 23, 2013, 12:57:06 am
content: I like to use C++/Qt because of its cross-platform capabilities. I've done control applications for embedded projects that started in a lab environment where having a PC nearby wasn't a problem, but ended up running on something like a Raspberry Pi, i.e. ARM/Linux, bundled together with the custom electronics as an appliance.

author: Stonent
author_rank: Super Contributor
timestamp: November 23, 2013, 04:02:15 am
content: You might also look into Processing. It's the precursor to Wiring and Arduino, but it isn't MCU focused. If it will only be you working with the code, it won't matter as much, however if others are expected to work on it, you should probably stick with VB or some type of C .

author: free_electron
author_rank: Super Contributor
timestamp: November 23, 2013, 05:15:05 am
content: Quote from: Rory on November 23, 2013, 12:44:51 amYES ! Now there is a kickass compiler!

author: marshallh
author_rank: Unknown
timestamp: November 23, 2013, 05:16:41 am
content: If you want to have simple, straightforward GUIs and write straightforward code, get Visual C# express. It's free.C# is what Java could've been if the architects weren't wanking about with theory so much. It is more practical IMO. They are 95% the same. Doing GUIs in Java is not easy and consistent as with Visual C#.And forget C++ and its requisite gui toolkits if you just want to get it done yesterday.With Visual C# you just draw the buttons, windows and entry boxes. Then write code that runs when you push buttons or whatever.By the way, VC# and VB are essentially 100% the same, the only difference is the language syntax. All the tech running them is identical.

author: hagster
author_rank: Frequent Contributor
timestamp: November 23, 2013, 07:36:35 am
content: I agree that C# or VB.net are the way to go. Both langauges run virtually identically. The only real difference that I can make out is pointers in c#.The next question would be wether to use WPF(windows presentation framework) or regular Forms. WPF is very powerful, looks great and can do really smooth transitions etc. However I have never been able to get my head round it and always ended up using Forms to get the job done.

author: Skimask
author_rank: Super Contributor
timestamp: November 23, 2013, 08:01:23 am
content: Still using VB6 on Win7HP. Works well enough for what I need to do.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: November 24, 2013, 06:15:35 am
content: I just finished up a similar thing; rs-232 scale communication and a GUI with a real world button on a pendant. Went for Qt/C++ for the same reason as Maxlor. Ended up on a Raspberry pi as well by chance!I am not a programmer, and I had no C++ at all, but I picked it up in a couple days well enough to get out a half decent GUI running three threads (main, RS-232 comm and the pushbutton ISR monitor). My programming background is C, Pascal (fairly dead but I'm most productive in it) and some various assemblies. Being able to integrate C libraries was handy; I was able to use the wiringPi library with no trouble for the pendant button.

author: hagster
author_rank: Frequent Contributor
timestamp: November 24, 2013, 08:45:20 am
content: Quote from: Skimask on November 23, 2013, 08:01:23 amI really recomend you move to vb.net. I used to use VB6 and there are so many things you just can't do, or need to get into some serious COM workarounds. .net is no more difficult and offers so much more power. It's also very easy to translate any C# code you come a across.

author: Skimask
author_rank: Super Contributor
timestamp: November 24, 2013, 09:16:01 pm
content: Quote from: hagster on November 24, 2013, 08:45:20 amNope...that was part of my point. "Works well enough for what I need to do". USB, serial, parallel, basic web interfacing, basic database type stuff, etc. Fits the bill, not much bloat, and most importantly, I'm very familiar with it.

author: Rigby
author_rank: Super Contributor
timestamp: November 25, 2013, 12:29:19 am
content: Quote from: Skimask on November 24, 2013, 09:16:01 pmThat's usually a good reason to stay where you are, and I would definitely second the notion that you look at .net if you ever determine that learning another language is in order.

author: AlfBaz
author_rank: Super Contributor
timestamp: November 25, 2013, 02:06:08 am
content: I'm not up to speed on what ms are doing with their platforms but with regards to the last 3 posts, I read somewhere that with the release of windows 8 they were looking to scale back support for .net as well as a dew other things but vb6 will continue, namely due to the tonnes of code written for it and the die-hard's still at it

author: Paul Moir
author_rank: Frequent Contributor
timestamp: November 25, 2013, 02:07:27 am
content: EDIT: referring to VB6, but it applies to .net too I suppose.Yes, but if you didn't already know it, why would you spend your time learning it? It made it into windows 8 but I think it's doubtful it will go any further. What about other architectures?Showing my age, I know lots of obsolete stuff. Truth is all that junk was not worth learning and I'm a lot more selective about what I spend my time learning now.

author: AlfBaz
author_rank: Super Contributor
timestamp: November 25, 2013, 02:12:34 am
content: at any rate .net is a universe.galaxy.solarsystem.planet.earth.inhabitants.human.brain.emotion.frustration.colloquialism.PITA

author: IanB
author_rank: Super Contributor
timestamp: November 25, 2013, 02:20:20 am
content: Quote from: hagster on November 23, 2013, 07:36:35 amWindows Forms is great for small simple GUIs and it's a good place to start if you are just learning.WPF can be used in the same way as Windows Forms, but you shouldn't use it that way. WPF is better for larger, more complex applications, and for those you need much more structure in your design. To use WPF well you should learn how to use the MVVM design pattern and that has more of a learning curve to it than simple forms applications.So if you have little or no GUI programming experience, use Windows Forms.

author: Skimask
author_rank: Super Contributor
timestamp: November 25, 2013, 04:15:13 am
content: Quote from: Rigby on November 25, 2013, 12:29:19 amI did take a look at the .net side of things way back when. Didn't offer me anything vastly new and/or improved that I really needed. And still doesn't...except for the price tag that goes along with getting the "professional versions" of it all.

author: MacAttak
author_rank: Unknown
timestamp: November 25, 2013, 05:04:06 am
content: Quote from: AlfBaz on November 25, 2013, 02:06:08 amThat is misinformation.Windows 8 introduces a new application mode (it was called "Metro" during the beta period, but found out later that was an infringement on a German trademark). This new mode is in addition to, and does not replace, the existing Desktop mode that Windows has offered since Windows 95.Applications written to support the new "Metro" mode use a new API called WinRT. WinRT has some overlap with .NET, and you can use C# to write WinRT applications, which has led to confusion. When you use a .NET language (like C# or VB) in a WinRT application, it just loads the .NET runtime into the application.Also, you can continue to write GUI applications for the classic Desktop mode using .NET, and just like always these can target either the Windows Forms or WPF UI frameworks.Applications written for WinRT have some significant restrictions. For that reason, and because there is a TON of existing applications written for WinForms/WPF (and other non-.NET frameworks), as well as a very large group of developers who only have experience with Desktop mode development (and may not be interested in WinRT), Microsoft is not going to be scaling back support or anything of that nature.Now, one thing you might be confusing this with is Silverlight. Microsoft did pull a surprise move in the summer of 2011 when they abruptly announced that Silverlight was being sunsetted. This was done primarily because Steve Jobs declared that the iPhone/iPad would never allow Silverlight or Flash to run on it (or any similar platform). This was effectively the end of both Flash and Silverlight. You might have noticed that now that Flash and SL are dead technologies, Adobe and Microsoft are back to being best buddies again.

author: Lifeboat_Jim
author_rank: Contributor
timestamp: November 25, 2013, 09:38:08 pm
content: I'd agree with C#. A modern 'managed' language will relieve you of many complex 'gotchas' (such as memory management, and complex data structures), it will be hard enough for you as it is.However the best language to use is usually the one you know the best (if you know any). Most languages can do 99% of tasks nowadays.The best suggestion is to team up with someone, you do the electronics and let someone else do the GUI.Processing 2 (and it's derivatives) is perhaps something you should look at too.