School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,443 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,516 people online right now. Registration is fast and FREE... Join Now!




Question about what language to use

 

Question about what language to use

Hiram

2 Jun, 2009 - 04:42 PM
Post #1

New D.I.C Head
*

Joined: 2 Jun, 2009
Posts: 39



Thanked: 3 times
My Contributions
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?

User is offlineProfile CardPM
+Quote Post


janotte

RE: Question About What Language To Use

4 Jun, 2009 - 03:49 AM
Post #2

code > sword
Group Icon

Joined: 28 Sep, 2006
Posts: 2,157



Thanked: 152 times
Expert In: C/C++

My Contributions

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.
User is offlineProfile CardPM
+Quote Post

xclite

RE: Question About What Language To Use

4 Jun, 2009 - 06:49 AM
Post #3

LIKE A BOSS
****

Joined: 12 May, 2009
Posts: 629



Thanked: 13 times
My Contributions
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: 4 Jun, 2009 - 06:51 AM
User is offlineProfile CardPM
+Quote Post

Oler1s

RE: Question About What Language To Use

4 Jun, 2009 - 12:12 PM
Post #4

D.I.C Addict
****

Joined: 4 Jun, 2009
Posts: 639



Thanked: 66 times
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

janotte

RE: Question About What Language To Use

5 Jun, 2009 - 05:01 AM
Post #5

code > sword
Group Icon

Joined: 28 Sep, 2006
Posts: 2,157



Thanked: 152 times
Expert In: C/C++

My Contributions
QUOTE(Oler1s @ 4 Jun, 2009 - 12:12 PM) *

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.theosfiles.com/os_windows/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: 5 Jun, 2009 - 05:02 AM
User is offlineProfile CardPM
+Quote Post

Hiram

RE: Question About What Language To Use

5 Jun, 2009 - 05:35 AM
Post #6

New D.I.C Head
*

Joined: 2 Jun, 2009
Posts: 39



Thanked: 3 times
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

xCraftyx

RE: Question About What Language To Use

5 Jun, 2009 - 11:32 AM
Post #7

D.I.C Head
**

Joined: 13 Sep, 2008
Posts: 206



Thanked: 3 times
My Contributions
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 tongue.gif
User is offlineProfile CardPM
+Quote Post

Hiram

RE: Question About What Language To Use

5 Jun, 2009 - 01:31 PM
Post #8

New D.I.C Head
*

Joined: 2 Jun, 2009
Posts: 39



Thanked: 3 times
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

janotte

RE: Question About What Language To Use

7 Jun, 2009 - 01:14 AM
Post #9

code > sword
Group Icon

Joined: 28 Sep, 2006
Posts: 2,157



Thanked: 152 times
Expert In: C/C++

My Contributions

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.



User is offlineProfile CardPM
+Quote Post

cgseif323

RE: Question About What Language To Use

15 Jun, 2009 - 07:14 PM
Post #10

New D.I.C Head
*

Joined: 1 Apr, 2009
Posts: 14


My Contributions
I personally like C++ because it's pretty fast and reliable. Do what you can do best.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:27AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month