9 Replies - 1722 Views - Last Post: 15 June 2009 - 08:14 PM

#1 Hiram  Icon User is offline

  • D.I.C Head

Reputation: 69
  • View blog
  • Posts: 203
  • Joined: 02-June 09

Question about what language to use

Posted 02 June 2009 - 05:42 PM

I'm not sure where this would go, but this seems like the most general programming section, so I thought I'd put it here.

I'm coming to the end of my course, and part of the last semester includes doing a project for someone, and it can be whatever language you like. I'm trying to work out what language to do it in, out of C++ or Java.

Basically the program is going to be a small genealogy program for cattle, for my dad. The thing is his computer isn't really that fast so obviously speed is an issue, which pushed me more towards C++.

I talked to one of my teachers about it, and he told me I should do it in Java because nearly all computers have a web browser. He's a huge Java advocate though so he's very biased when it comes to C++ or Java (he walked in the other day to tell everyone that "C++ is officially dead!") While that's true that nearly every computer has a java compatible browser, I remember using my dad's computer when I was young, and the computer would suddenly freeze and I would be forced to restart, or it would take ten minutes to unfreeze, when certain pages loaded up in the browser. What ended up causing this was in fact some Java applet on a page.

Obviously though I don't know as much as other people would on this issue, so I want to know what other people think? Should I use Java or C++?

Other things I've taken note on, are that I'll be trying to make it as cross-platform as possible so I can give/sell copies to other people (me and my dad use Linux primarily). If I'm trying to sell it to other farmers, I think it's a reasonable assumption that they won't all have up to date, fast computers. I knew a farmer who had only upgraded to Windows 95 a year or two ago, because that's all he needed.

If I chose to do it in C++ I'll be using either wxWidgets or Qt (free edition) for the gui, which I'm also not sure on the differences with.

TL;DR: Which language should I use to write a program for slower machines, C++ or Java?

Is This A Good Question/Topic? 0
  • +

Replies To: Question about what language to use

#2 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Question about what language to use

Posted 04 June 2009 - 04:49 AM

Personally I would suggest Java.

The fact that the GUI is, effectively, built in means it's a lot less hassle than C++ for making the sort of program I think you are looking at here.

And if you want to share it with other farmers having it run on the universal JVM means you'll be really able to give it to them without concern.

But if you are keen on the C++ approach that's a fine idea too.

Also if your teacher is telling you not to use C++ do you really expect them to be very helpful or to give you full credit for your work? It's not fair but the world is a political place and to ignore that is unwise in the extreme.

On a side note.
Anyone who is running Win95 as anything other than a proof of their uber-geek status is totally and utterly mad.
It is an unsupported virus magnet.
A completely false economy that is likely to cost a huge amount when (there's no if about it) it goes badly wrong and the business info is wiped out.
A new PC box running Vista is a lot less than $1000 and if this is for a business then it is sheer madness to not make the investment in a new PC every 3 years or so.
As you well know using Linux will drop the price even further.
And there are a lot of options for 3 year old PCs for very little money that are a far better idea than 10 year old boat anchors.
If you are seriously dealing with people running hardware older than 7 years and any OS older than XP you are dealing with people who aren't thinking clearly so if your excellent program (as I am sure it will be) prompts them to drop a few hundred dollars into getting some old but worthwhile hardware and installing a decent OS it has done two good things with a single stroke.
Was This Post Helpful? 0
  • +
  • -

#3 xclite  Icon User is offline

  • I wrote you an code
  • member icon


Reputation: 1253
  • View blog
  • Posts: 4,044
  • Joined: 12-May 09

Re: Question about what language to use

Posted 04 June 2009 - 07:49 AM

If you're looking to write a desktop application with a GUI, you might look into C#. If that's not an option (I see you only listed C++ or Java), I'd say just stick with Java, GUIs are easier there than in C++.

Edit: I'm an idiot, I see now why C# is not an option (Linux). I'd say stick with Java then, unless you REALLY want to give Mono a try with .Net.

This post has been edited by xclite: 04 June 2009 - 07:51 AM

Was This Post Helpful? 0
  • +
  • -

#4 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1397
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Question about what language to use

Posted 04 June 2009 - 01:12 PM

Quote

I'm trying to work out what language to do it in, out of C++ or Java.
From your perspective, it really should be what gets you the most academic marks. It's terrible to look at things that way, but that's how the world works. As janotte noted, ignoring your teachers' biases is unwise. It doesn't necessarily mean use Java, but you may want to prepared to defend your choice of C++.

Which also brings up the question of if it really matters. From a real world perspective, absolutely. From an academic perspective, probably not so much. What's more important is that you can get something good completed, even if in practice a large number of farmers won't be able to make use of your work. So, the question you need to ask is: which are you more productive in and comfortable in? Which language are you more likely going to be able to get your project finished with?

Also, if you know other languages, do consider using them. THe last project I worked on was specific to a farming practice, and much of our code was in Python. The circumstances were different, but I'm just saying, don't limit yourself to C++ and Java only. We got a lot done with Python, and it worked out in favor. Priority 1: Get something done.

I disagree with janotte's comments on it being crazy to have a computer with Windows 95. We aren't talking about the majority of the population that actively buys computers. We are talking about someone who has an old computer lying around, and wants to make whatever use of it possible. On aging, not updated computers, Java may be problematic to run. A conservative C++ program would probably fare better. (So would other languages that have implementations that compile to native executables. Like Pascal, etc.). But this discussion might be rather irrelevant since you may not be rewarded academically for such thinking, at least a reward not proportional to the risk you take.
Was This Post Helpful? 0
  • +
  • -

#5 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Question about what language to use

Posted 05 June 2009 - 06:01 AM

View PostOler1s, on 4 Jun, 2009 - 12:12 PM, said:

I disagree with janotte's comments on it being crazy to have a computer with Windows 95.


When was the last security update issued for Win95?
Answer 2002.
http://www.theosfile...ws/ospg_w95.htm

With no security work done for more than 6 years Win95 is wide open to attack.

Anyone running Win95 for any reasons other than showing their retro geek skills or as a deliberate virus honeytrap is behaving as recklessly as someone combining driving, a loaded handgun and lots of tequila.

There is no way the risk can be justified. If someone doesn't have the money for a newer M$ OS then they should install a free Linux distro. When a safe option is free and easily available it is impossible to justify using an insanely dangerous one.

Friends don't let friends run obsolete, virus magnet, OSes.

This post has been edited by janotte: 05 June 2009 - 06:02 AM

Was This Post Helpful? 0
  • +
  • -

#6 Hiram  Icon User is offline

  • D.I.C Head

Reputation: 69
  • View blog
  • Posts: 203
  • Joined: 02-June 09

Re: Question about what language to use

Posted 05 June 2009 - 06:35 AM

Well, that was a complete derailment of my thread.

The guy I was talking about specifically was an example, not the standard.

Also, the teacher I spoke of who recommended I do it in Java was only one of my teachers, I should have clarified a bit. It's another teacher who marks us on our projects. But no matter what language we choose, as long as we can justify our choice, they won't mark us down. Unless of course the language we chose something stupid like LOLCODE or Whitespace.
Was This Post Helpful? 0
  • +
  • -

#7 xCraftyx  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 11
  • View blog
  • Posts: 258
  • Joined: 13-September 08

Re: Question about what language to use

Posted 05 June 2009 - 12:32 PM

For the record, Java's speed is not far off from C/C++ anymore when running desktop apps; for a small school project that requires cross-platform capabilities, I would definitely recommend using Java. Sorry If i missed anything, didn't want to read the entire thread :P
Was This Post Helpful? 0
  • +
  • -

#8 Hiram  Icon User is offline

  • D.I.C Head

Reputation: 69
  • View blog
  • Posts: 203
  • Joined: 02-June 09

Re: Question about what language to use

Posted 05 June 2009 - 02:31 PM

Yah I know the speed isn't too far off, it's more the memory requirements that I was talking about. You start a small, simple program in Java and it takes up 30-40 meg of memory, where as the same program in C++ would take up much much less.
Was This Post Helpful? 0
  • +
  • -

#9 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Question about what language to use

Posted 07 June 2009 - 02:14 AM

Is there a constraint on the amount of memory you have to or want to use?

40 meg is not much to worry about nowadays unless that exceeds some target you have or have in mind.

What I am asking is "Does it matter that you expect a Java program to take up more disk space?"

If it does matter then you have probably answered your own question on language choice to your own satisfaction.
If it doesn't matter then it doesn't matter.
Was This Post Helpful? 0
  • +
  • -

#10 cgseif323  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 01-April 09

Re: Question about what language to use

Posted 15 June 2009 - 08:14 PM

I personally like C++ because it's pretty fast and reliable. Do what you can do best.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1