Programming language to learn?

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 1496 Views - Last Post: 15 May 2013 - 11:48 AM

#1 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Programming language to learn?

Posted 07 May 2013 - 11:20 PM

You guys probably get this question a lot, and I'm not really sure where to post this, but here we go:

I have an engineering background and recently made some hardware that I want to control with my laptop via USB. I want to make some software to control the hardware with a GUI interface. The GUI will not be particularly complex, and I'm looking for a language that's:

(1) extremely easy and quick to learn (i'm not trying to learn hardcore programming here -- just prototype);
(2) cross-platform (the application must be able to run on both Windows and Mac; I don't care about linux);
(3) has a free development kit.

My key priorities here are prototyping as rapidly as possible without getting into too much programming nitty gritty and cross-platform support.

I have an in-depth background in PHP, Javascript, HTML, CSS, Visual Basic, a little bit of Java and a little bit of C++.

I was looking into possibly either using Qt and C++, or some language with .NET. Any advice would be really appreciated!

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Programming language to learn?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9207
  • View blog
  • Posts: 34,589
  • Joined: 12-June 08

Re: Programming language to learn?

Posted 08 May 2013 - 05:42 AM

Moving from VB.NET to software dev.
Was This Post Helpful? 0
  • +
  • -

#3 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7749
  • View blog
  • Posts: 13,106
  • Joined: 19-March 11

Re: Programming language to learn?

Posted 08 May 2013 - 05:54 AM

View Posticydash, on 08 May 2013 - 01:20 AM, said:

You guys probably get this question a lot, and I'm not really sure where to post this, but here we go:


Yes, we do, but usually not so well thought through.

Quote

I have an engineering background and recently made some hardware that I want to control with my laptop via USB. I want to make some software to control the hardware with a GUI interface. The GUI will not be particularly complex, and I'm looking for a language that's:

(1) extremely easy and quick to learn (i'm not trying to learn hardcore programming here -- just prototype);
(2) cross-platform (the application must be able to run on both Windows and Mac; I don't care about linux);
(3) has a free development kit.

My key priorities here are prototyping as rapidly as possible without getting into too much programming nitty gritty and cross-platform support.

Thanks!



This sounds like python to me. Python is very easy to learn, and it's a language that generally gets out of your way and lets you work.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9207
  • View blog
  • Posts: 34,589
  • Joined: 12-June 08

Re: Programming language to learn?

Posted 08 May 2013 - 06:46 AM

View Posticydash, on 08 May 2013 - 01:20 AM, said:

... snip ...
I have an engineering background and recently made some hardware that I want to control with my laptop via USB. I want to make some software to control the hardware with a GUI interface. The GUI will not be particularly complex, and I'm looking for a language that's:
... snip ...

A better answer sort of depends on this mysterious hardware...
Was This Post Helpful? 0
  • +
  • -

#5 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5832
  • View blog
  • Posts: 12,685
  • Joined: 16-October 07

Re: Programming language to learn?

Posted 08 May 2013 - 07:08 AM

1. None. Though, granted, some are more friendly to get going than others. I'd also put Python up there in the "just start doing stuff" category.

2. You have just removed all .NET languages from the running. Don't let anyone tell you Mono will fill the gap; just ignore them if you don't only want to do Windows.

3. All or Few, depending. Any computer language will have some kind of development kit. You have a compiler that you feed code and get something that runs; that's development. The scope of what you expect from your IDE will limit you again.

For unknown hardware that need to be controlled remotely, I'd think of a web interface. Even the stupidest hardware can usually muster up an HTTP listener. I'd got PHP then. Of Python, you can ad hoc an HTTP server very easily in Python.

Wait, USB control only? Well, then, your options are extremely limited. You'll want some kind of device driver? You'll be restricted to what can talk to that driver. If you haven't written one, then you're looking as something like C for the bare metal stuff.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,870
  • Joined: 12-December 12

Re: Programming language to learn?

Posted 08 May 2013 - 07:11 AM

"cross-platform" (practically) rules out .NET. (Well.. it is possible?!)
Edited: I agree with baavgai; scrub .NET as a possibility.

Me like Python :)

This post has been edited by andrewsw: 08 May 2013 - 07:15 AM

Was This Post Helpful? 0
  • +
  • -

#7 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Re: Programming language to learn?

Posted 08 May 2013 - 07:35 AM

Hey guys, thank you all so much for your responses.

It's really important that the program work on both Mac and Windows, as I may try to sell it in the future along with the hardware, so that's a big deal for me. It sounds like you guys think .NET will be a headache to get cross-platform with, so I'll rule that out.

It seems like the big favorite is Python or just having the program link to a website and doing the whole thing as a web-based PHP script. I haven't played with Python before, but I thought it was more command-line-ish, not GUI-ish (I would like to make the program look pretty as it may be for consumers eventually). I will be mostly using the program to grab use settings and send them over USB to my hardware, but I think most programming languages now in days have -some- kind of USB library I can just include to make that happen; I don't think sending USB commands will be the hard part.

Where should I get started with Python and making a GUI? Do you all have any good recommendations for tutorials or development kits I can download?

Edit: I would also prefer not to use the web-based approach because many places where people may be using this device may lack internet access.
Was This Post Helpful? 0
  • +
  • -

#8 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Re: Programming language to learn?

Posted 08 May 2013 - 07:41 AM

Another edit: for clarity, on the hardware side, the device just coverts the USB signals it receives to UART and shoots them into a microcontroller that controls the rest of the circuit. So I literally just need to be able to send command signals over USB to the device and nothing more.
Was This Post Helpful? 0
  • +
  • -

#9 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,870
  • Joined: 12-December 12

Re: Programming language to learn?

Posted 08 May 2013 - 07:50 AM

tkinter is the standard Python module for creating a GUI, although there are others.
Was This Post Helpful? 0
  • +
  • -

#10 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7749
  • View blog
  • Posts: 13,106
  • Joined: 19-March 11

Re: Programming language to learn?

Posted 08 May 2013 - 07:53 AM

Python has several GUI libraries. Probably the most widely used is tkinter - I've played with tkinter a little, not a lot, but it looks like you can do a fair bit with it.

Quote

Another edit: for clarity, on the hardware side, the device just coverts the USB signals it receives to UART and shoots them into a microcontroller that controls the rest of the circuit. So I literally just need to be able to send command signals over USB to the device and nothing more.


I haven't tried anything of this sort, but I'm constantly surprised by what's available in python, and how often it "just works".

Quote

Where should I get started with Python and making a GUI? Do you all have any good recommendations for tutorials or development kits I can download?


The python language website has lots of good references and some tutorials, so it's a good place to start. David Beazley's Essential Reference is a great volume to have on your desk - I seriously think that book is bigger on the inside than it is on the outside.
Was This Post Helpful? 0
  • +
  • -

#11 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Re: Programming language to learn?

Posted 08 May 2013 - 08:40 AM

Awesome. I just found this library for Python that provides USB support: http://pyusb.sourcef...0/tutorial.html

So with tkinter, is it like something I can just download and install, or do I have to download/install some Python development kit and then tkinter is like a plugin or whatever?
Was This Post Helpful? 0
  • +
  • -

#12 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5832
  • View blog
  • Posts: 12,685
  • Joined: 16-October 07

Re: Programming language to learn?

Posted 08 May 2013 - 08:42 AM

I'd also throw Java in there. The thing I like about Java is that the GUI is already there, most machines already have some form of Java, your distribution can be just be a jar file and maybe a batch file to bootstrap it.

View Posticydash, on 08 May 2013 - 10:35 AM, said:

Edit: I would also prefer not to use the web-based approach because many places where people may be using this device may lack internet access.


Having a local HTTP server does not require the internet. Indeed, it doesn't even require a network; just a computer with an open port and a browser to look at.
Was This Post Helpful? 0
  • +
  • -

#13 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Re: Programming language to learn?

Posted 08 May 2013 - 09:08 AM

I was initially thinking about Java, but I had some experience with that trying to make Android Apps, and it was more difficult than I was expecting it to be. I still was able to figure it out to an extent, but I'm looking for something a little bit easier.

Also, I was able to get Python/Tkinter installed by following the instructions here: http://www.tkdocs.co...al/install.html (just in case anyone in the future reads this thread and wants to know what I did).

As to having a HTTP server, I think I'm confused with what you mean ... are you suggesting haing the consumer install something like WampServer and then open my GUI in a browser, using something like PHP/Java/JQuery to build out the GUI? Because while that is definitely an interesting idea, it seems like it would require the installation of a lot of unnecessary files on the customer's computer, and I'm not sure if websites like that can interact with USB?
Was This Post Helpful? 0
  • +
  • -

#14 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5832
  • View blog
  • Posts: 12,685
  • Joined: 16-October 07

Re: Programming language to learn?

Posted 08 May 2013 - 10:56 AM

An HTTP server is just a service that listen to a port. It processes requests. It's easy to listen to a port. Every programming language in the world has a proof of concept http server. Point a browser at it and instant gui.

Here's some simple code to give an idea:
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import os

PORT_NUMBER = 8070

class ReqHandler(BaseHTTPRequestHandler):
	def do_GET(self):
		self.send_response(200)
		self.send_header('Content-type','text/html')
		self.end_headers()
		self.wfile.write("<html><head><title>Ad hoc server</title></head><body>")
		self.wfile.write("<h1>Hi!</h1>")
		self.wfile.write("<p>You asked for: " + self.path + "</p>")
		self.wfile.write("<p>I could parse than and execute anything on this box</p>")
		self.showDir()
		self.wfile.write("</body></html>")

	def showDir(self):
		path = os.getcwd()
		self.wfile.write("<p>Current directory is: " + path + "</p>")
		self.wfile.write("<p>Contains</p><ul>")
		self.wfile.write("".join("<li>" + f + "</li>" for f in os.listdir(path)))
		self.wfile.write("</ul>")
		 

try:
	server = HTTPServer(('', PORT_NUMBER), ReqHandler)
	url = "http://localhost:" + str(PORT_NUMBER) + "/"
	print 'Listening to' , PORT_NUMBER
	print 'Url ' , PORT_NUMBER
	try:
		import webbrowser
		webbrowser.open_new(url+"puppies")
	except:
		pass
	server.serve_forever()
except KeyboardInterrupt:
	server.socket.close()



It works. If you have the webbrowser python module, it will even pop open your browser to point to the page.

It probably won't suit your needs, but it's a good trick to know.

Try this as well:
python -m SimpleHTTPServer



With that one liner, you can start up an http server is the directory you're in can copy files anywhere else on a shared network.

I wrote a wee web server aeons ago for a CD browser project. The caveat is that modern computers will often firewall you, so its not the elegant solution it once was.
Was This Post Helpful? 0
  • +
  • -

#15 icydash  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 07-May 13

Re: Programming language to learn?

Posted 08 May 2013 - 02:03 PM

Ah I see what you're saying. Interesting idea, though like you said, I'm not sure it'll suit my needs for this project. But I'll definitely keep it in mind for future projects.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2