开发者

Want to choose between Qt and Java: a newb question

I want to learn a new programming language. I have in mind stuff like

  • file alteration monitoring
  • embedded databases such as SQLite
  • widgets that support drag and drop
  • rich text with widgets inline with the words

for my pet project.

I heard lots of opinions of both of them. They seem to agree that Java is tougher to use and Java code is less readable. But that QT cant implement nifty features like the ones I listed above: its more KDE than QT.

I want to choose the language that generates easily maintainable code and a smooth learning curve. And adding a new feature should be straightforward: search for it, find a tutorial, write my own code; no intellectual gymnastics or low-level tinkering.

This question may be too wide in scope, so please tell wh开发者_运维技巧at other factors are relavent to a newb.


Not only can you do all of those things with Qt, at least two are built in:

  • File Alteration Monitoring - QFileSystemWatcher
  • SQLite - QSQLITE

So be careful whose "opinions" you listen to.

Can Java also do these? Sure, but we need to be honest about the competition.


If you want an easier learning curve, go for Java.

It matches all your requirements, offers good portability (Qt does too, to be fair), and its GUI layer (Swing) has the required niceties. Note that Qt is a set of libraries, not a language. Its underlying language is C++, plus a few tricks that lets it use a 'signal/slots' abstraction that is quite useful (google for meta-object compiler).

I would go for either Java or a higher-level language (Python for instance) for your project. Note that you can use Qt from Python, using the PyQt bindings.

For an embeddable database in Java, you could try hsql.

Note that no language will 'generate easily maintainable code'. The task is up to you. To learn about software engineering in general, I heartily recommand Eric Raymond's text, The art of Unix programming; you can read it online for free.


Some people might say that Java is tough while others will argue QT is challenging. It really depends on the person, how much work you put into it and how determined you are to learning the code. Java was the first language I learned, I don't want to say that it's easy but I would argue that it's not something to shy away from because you heard it was tougher. I have never used QT so I could not compare the two, but from what I see most of your objectives can be completed through learning Java. Remember coding is hard no matter what, so don't beat yourself up if you can't figure something out. Just ask. Hands on coding is the best way to learn, so just code for hours on end. And keep coming back here when your mind reaches a coding roadblock!

Good Luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜