Need advice about programming..

Discussion in 'OT Technology' started by ravravrav, Oct 22, 2005.

  1. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    I've got some writing programs on my site - www.filmfiler.com which I designed and were created in Java. I did this so I could make it available for Windows, Mac and Linux -- however I didn't realise it would be quite slow running etc.

    Anyway I want to update the programs but I'm best at Visual Basic so I was wondering if I should just go back to using that. Obviously the programs would then only be available for Windows.

    Does anyone know of any way to improve the performance of the Java programs (which are like 3mb max.) or another languauge like C? (only problem I'm not that advanced at C). Maybe I should just stick with VB?

    Any advice?
     
  2. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Java is, by its nature and design, slow. Java 5.0 is a big improvement over the previous versions, but it's still slower than an equivalent app written in C/C++/etc... The nice thing about Java, however, is that (like VB) it makes it easy to put a pretty GUI on an app.

    If you still want your software to be cross-platform and have a GUI, but you want it to be faster, perhaps you should look into a scripting language with GUI support like Tcl/Tk or Python. I run a number of Python/GTK apps that are very nice and fast.
     
  3. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    Thanks for the reply, for Java it was quite difficult to find installers and the GUI wasn't exactly the same on different interfaces.
    What are the setup costs for Python and how easy is it to learn?
     
  4. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Setup costs? What do you mean by that? The python interpreter is free, so is your favorite text editor. So none I guess :dunno:

    How easy it is to learn depends on how good you are at learning languages. I've never actually played with Python myself, but I had no trouble at all picking up Tcl/Tk. Python is similar to Perl, so if you've done some Perl before, you shouldn't have too much trouble.
     
  5. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    OK sounds good - what I mean by setup costs is when I've actually written code in Python will I be able to compile into an executable file using free tools widely available? What about GUI tools support - is that free and available easily? If I have a program and want to make it versions for other platforms will I have to purchase new software?
     
  6. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    You don't compile Python into an executable - it's a scripting language, so you need the interpreter to run programs written in it. What do you mean by GUI tools support? Like tools to graphically build a GUI? Python has a GTK interface, so you could presumably use Glade.

    So, say you write a Python/GTK program. You just need to distribute the Python source files to users, and they then install Python and GTK and run the scripts. They can download Python and GTK for any platform. It's that easy.
     
  7. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    I see - so it's different from creating a program file like I currently have. Do you know how big the Python and GTK are? My current programs run in Java and users do have to download some kind of Java machine to run them - I'd rather just have them run straight up like any other .exe would.

    Also can I create a link to a program, like a shortcut on the desktop, and create file associations etc. with this method?

    I think I might stick with a language which just creates an executable file. The question is Java or VB?
     
  8. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Actually, with your programs written in Java, users need to have the Java Virtual Machine installed to run them. I downloaded the Linux version of one of your apps to check this for sure. You could do exactly the same thing you do currently (write the program in Java, then write a script to run it using the JVM) with Python.

    Considering how much work it seems you've put into the apps (they're quite a nice product - very cohesive and nice to use) it's probably not worth changing them over to a different language. They don't really run slowly at all for me (Athlon XP 2500+, 1GB of RAM, Java 5.0), so I see no reason to change.
     
  9. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    Hmm, Ok thanks for the advice - I actually run a s-low machine which is why I have no idea how the programs look on my users' sites but I was thinking I'd like to make them run faster.

    From what you've said - and you seem like you know what you're talking about - I'll just knock the idea on the head.

    By the way you mention using Linux - I was thinking of just working on the Windows versions (I have had downloads for all 3 versions: Win, Mac and Linux but about 80% more in Windows) - do you think it's a good idea to still support Mac and Linux or are they mainly for non-commercial programs?? (by the way I'm not sure what I mean by that, hopefully you will...)
     
  10. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Considering that you're using Java, there should be very little difference in the code for different OSes. That's a big selling point of Java - it doesn't need to be compiled separately for different OSes or architechtures because it's compiled into bytecode that's inerpreted by a virtual machine (the JVM that you can get for most OSes), rather than into machine code. Considering this fact, it shouldn't be much extra work to offer support for all three OSes. In fact, I'm a bit surprised that you have three different downloads, it should be easy enough to just have one download that works on all the Oses.
     
  11. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    :eek5: No way I always thought you could do this but after a little research (a little..) and someone telling me - I realised that you could create code but it would still have to be converted into different bytecode for each different OS - which is why I have each file for each OS.

    I had no idea you could compile once and create something which is available for all 3 OS's. Would this be an .exe file or .js? Do you know how to do this?
     
  12. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Your program, as it is, will already work on all OSes. The only thing that's different between your packages is how it installs the program and the script that runs it.

    You write Java code in .java files. You compile them with javac into .class files. The .class files are interpreted by the java interpreter. This is pretty much the whole point of Java - it's completely portable, so the same app can run on Windows, Linux, PalmOS, etc... without modification. Of course, in practice it doesn't quite work out all the time, but there should still be very few differences between the versions.

    Now, the packaging for each version will probably still be different. You could just offer a .jar file, which will be usable on all OSes, but most Windows users probably prefer an installer that installs things to somewhere in their Program Files and creates links in the Start Menu and such, while most Linux users probably want a nice startup script and such, much the way you have it now.
     
  13. ravravrav

    ravravrav New Member

    Joined:
    Oct 4, 2005
    Messages:
    157
    Likes Received:
    0
    Location:
    UK
    Hmmm, from what you say I think I'm doing things ok for now, thanks for the advice, appreciate it.
     
  14. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Yeah, the program I downloaded (the first one listed on the page I think) looks great. Very professional look and feel. It's probably smart to package the programs separately for each OS, although the codebase should probably be the same for all of them.
     

Share This Page