On Sunday, September 05, 2010 08:29:36 am Mohammed R. wrote:
I need to develop a application which can be used in desktop environment
and web environment. The code/core classes written for desktop version
must be reused for the web also. code REUSE is a must property.
I had two option
- To use C++ for desktop and ruby for web.
Using a library/interface/extension to access the cpp code on web (dont
know about the package needed)
use ruby for web and desktop
So will it be easier to use/reuse (inherit) the classes wrtitten for
desktop version by the web page written in ruby.?
What was the question?
If code reuse is your only priority, you haven’t actually provided
information to choose one or the other.
If readability, efficiency of coding, and maintainability are
might consider Ruby for web/desktop, and you have all sorts of options
doing the desktop version. Depending on your users, the easiest might be
something like Rawr:
If raw speed on the desktop is an issue, you might use C++. But chances
very good that it isn’t. You can be “fast enough” quite easily, and the
difference between “slow” and “fast enough” is almost always choice of
algorithm and program structure, and not choice of language.
It might not be as much of a consideration as you’d think, though. Using
something like Rails, you can create a very good REST API, and pretty
every language has good support for the ideas of REST – especially
minimum needed is just good HTTP support. You’d have to describe your
much more detail, but unless the web app and the desktop app are
duplicate functionality, I don’t know why they’d need to share much code
unless the desktop app needs to work offline, it could simply be a
UI that ultimately results in the same model operations on the server.
By the same token, if you don’t need it to work offline, chances are you
produce a Web app which works as well as any desktop app would. Then