November 15th, 2009, 02:53 AM
What programming language should I use?
I need a quick pointer for a suitable programming language to learn.
I need something that I can use for developing PC-located applications with a graphical user interface.
- text editor
- upload/download assistant (to be used by users of my community website to interact with their account or with other site users from their PC)
I am coming mainly from a PHP server-scripting background.
I have looked into C++ a few times in the past, but something that repeatedly has been a stumble block for me in C++ is how to create GUIs. So this time I am looking for something simpler than C++.
A programming language that:
- is suitable for producing executables
- won't require any special interpreter to be installed on a person's PC for the programs created to run
- is suitable and easy to use for creating GUIs
November 15th, 2009, 06:33 AM
If the PC's you're working with are all running Windows (and as much as it pains me to say this) I'd recommend looking into Visual Basic. It'll allow you to tap into all of the Windows API calls, meaning you can rapidly create the functionality you mention in your post. There are drag-and-drop features in Visual Studio that will get you up and running w/ the specs you want quickly. The downside to this approach is any development "skills" you pickup using VB / VS to create Windows apps won't easily translate into other areas. But, you'll be able to work pretty quickly.
If you're working in an environment where the OS isn't 100% Windows, your best bet is to go the Java route, allowing you to create a GUI-based application which will run on multiple OSes. The upshot to using Java is the development skills you learn will be very useful in a variety of other environments; the downside is creating the functionality you mention will take a bit longer.
Hope that helps...
November 15th, 2009, 07:21 AM
My language of choice is Python. It is both easy to learn AND easy to use. These are not the same thing - VB is easy to learn, but is a pain to develop programs of more than moderate size or complexity.
Python has a choice of GUI frameworks - the most popular are Qt and wxPython, both of which have GUI designers available. It is an interpreted language, but there is a program called py2exe which will bundle the interpreter and your code into a single installable application.
There is also IronPython which runs on .Net. The .Net runtime should be installed by default on Windows systems from XP SP2 onwards so should not need to be downloaded by most of your users.
As drgroove says, there is also the Java option. Personally I dislike Java the language, but there are a lot of alternative languages that run on the JVM including Jython (yep, Python again). I am currently looking at Clojure, which is an implementation of Lisp on the JVM. Lisp is not to everyone's taste, but it is an incredibly powerful language, in many ways even more so than Python. Other popular JVM languages include Scala and JRuby. IMHO all of them are better languages than Java, and they all give you access to the huge set of libraries that are available to Java.
November 15th, 2009, 08:49 AM
DevCoach, you can always be counted on to recommend Python
Well, if we're going to go the 4GL route, and you already know PHP, for that matter you could use the GUI facilities available for PHP, and stick with what you know. Frankly, I see little reason to learn another 4GL language (PHP, Ruby, Python, Perl, ColdFusion, ASP) if you already know one.
Knowing one 4GL language is great, for purposes of rapid web development. However, at some point you're going to have to learn a more (dare I say) powerful language, be it C, C++, Java, or (again, as much as I hate to recommend anything Microsoft) VB. Why? Because at some point you'll hit a brick wall with the 4GL language, and you'll need to know another language.
In this case, the brick wall is GUI development. Sure, you can do GUI development with Python. You can also do GUI's with PHP. I wouldn't recommend it, though, for a litany of reasons.
tcjohans, it's time to expand your horizons a bit, and learn a more powerful language. Personally I'd go w/ Java or C++, but if you're under a tight deadline, and working in a 100% Windows shop, you might as well aim for VB.
No offense, DevCoach - I think Python is great, too, but you know what they say... if all you have is a hammer...
November 15th, 2009, 11:37 AM
I think we have profoundly different definitions of "powerful". I like to stick with the definition from physics - work done per unit of time.
Originally Posted by drgroove
By that definition a more powerful language is one that lets you get more done in the same time. Studies have shown that once a programmer is proficient in a language he will code at about the same number of lines per day, regardless of the language used. This means that a language that is more expressive and takes fewer lines of code to implement the same functionality is, by definition, more powerful than one that takes many more lines. By this measure languages like Python or Ruby are more powerful than C++ or Java, typically by about a factor of 5.
I am curious as to your definition of language power, and the reasons that C++ and Java are more powerful than the likes of Python or Ruby.
I have done quite a bit of GUI development with wxPython and not had any problems. I would be interested in hearing your litany of reasons.
Originally Posted by drgroove
I agree with the comment "if the only tool you have is a hammer..." - I think any serious programmer should learn a wide range of languages. I have programmed professionally in C, C++, Java, Assembler, Perl, Python and several other languages, and learnt several more for my own interest. I am not claiming that Python is the best or only language that you should use, but in my experience it is the one I find the most productive. I think Ruby is similarly productive, but is so similar in scope to Python that I don't have a compelling reason to switch.
Clojure is interesting because it can combine the productivity of a dynamic language with the runtime efficiency of Java.
November 15th, 2009, 12:31 PM
On this side note, I would argue that a language like Python has a bell-shaped productivity curve. While it is better at the small scale, it does become less productive as the development team becomes larger. The performance issues, such as its poor concurrency support, can become an issue. The weak typing provides rich expression support easily, but does make it harder to have a contract-first model which can mean refactoring becomes more challenging.
Much of the expressibility is possible in a language like Java, too, if the libraries (utilities, frameworks) are written well. The productivity gains are there at the beginning and when little thought to the design is made, but do drop off and can be matched with thoughtful development. And that's the rub, most development is done
haphazardly leaving it to others to clean-up the mess.
November 16th, 2009, 02:58 AM
Do you know this from experience on working on large Python projects, or is it a hypothesis? I have worked on a sizeable Python project (~250,000 lines of Python code, a dozen or so developers) and have not found it to be a problem.
Originally Posted by NovaX
Also what is a large project in Java is only a medium sized project in Python - the 250,000 lines of would be 1 million+ lines of Java, and probably would need a much bigger team to develop.
I agree that the performance of Python is not as good as Java so would not use pure Python for high performance number crunching. But for most things I have found it to be good enough. It is also easy to mix Python with C or C++ for the performance critical parts - Python is widely used in the scientific community and for movie CGI generation.
I agree that Python threading does not make good use of multi-core systems, at least for the C implementation - IronPython and Jython do not have issues. Anyway threads are not a good answer to concurrency, either in Python or Java. In many cases it is better to spawn multiple communicating processes and there are plenty of Python libraries to do that.
Good libraries can help to some extent, but can only go so far if the language itself is inherently bloated. Besides dynamic languages hosted on the JVM can use the same libraries but in a more expressive way.
Originally Posted by NovaX
November 16th, 2009, 03:27 AM
Thank you for the great feedback, all!
Python with wxPython, Java, C++ and Clojure all sound interesting, and I will check up all of them in a little more detail before I decide.
In case I do go for C++ or Java, does anyone know if there happen to be any good, easy-to-use, and free libraries around for GUI development for these languages?
By the way, I am developing on Windows Vista, if that is relevant.
November 16th, 2009, 03:41 AM
I'd recommend Java + SWT (sent you a private message regarding this); you can use Eclipse as your IDE. All free, very powerful. Plus, the skills you learn coding Java and SWT will actually come in useful in your career, as many companies leverage Java + SWT for enterprise GUI development.
Originally Posted by tcjohans
December 10th, 2009, 05:36 PM
Comments on this post