Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Advice on a simple calculation applet

I want to write a simple program to embed on a website, in which a user inputs a car wheel diameter and axle ratio. The program then outputs the best two speedometer gears to purchase based on user input.

I'm confident I could write this in a couple of hours in Java. But should I? Never actually implemented a Java applet before.

Is there a reason why I should instead write this in JavaScript? I've never done something like that either.

About the client: It's for my parent's website and tweaking it 3 or 4 times is fine, since web traffic is relatively low volume and whatever I do couldn't be worse than it is now. More on that in a future post.

Thinking I might do both, mostly to get a feel for a Java applet and a JS counterpart. Thoughts?

2 Answers

James Barnett
James Barnett
39,199 Points

I'm confident I could write this in a couple of hours in Java. But should I?

Java is going the way of Flash. You don't have to write it in JavaScript you could do all of the application logic in a backend language like Ruby or Python, PHP whichever you are most comfortable with.

It's for my parent's website and tweaking it 3 or 4 times is fine, since web traffic is relatively low volume

You should probably develop and test the new features on a dev site and only push things live once the client signs off on them.

I hadn't thought of other backend languages. Considering that:

  1. I need to learn about WordPress and PHP in the near future to revamp a different, non-profit organization's website
  2. I want to add a submit email contact for my parent's site

Learning to do the calculation in PHP looks like a better direction to aim.

As far as only pushing out the approved features, yes I know better and maybe shouldn't have written that out loud. Still family and all, but using this design experience to gain the skills needed to deal with non-related clients for profit. You're right. Might as well do things professionally from the beginning.

Brandon Flade
Brandon Flade
2,769 Points

Richard,

James Barnett Has some good points. What technologies do you have available, and what technologies are you comfortable implementing in this project? Each approach you take is going to have Pros and Cons to consider. It will be a little easier to help you choose if we know what you have available.