Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Best Language to Perform Basic Calculations

What language is best for a user input data into a form, post that data to a server have that server perform basic calculations (addition and multiplication) then return user input along with the calculated values? When would one use JAVAScript vs Python vs Ruby vs any other server side language?

4 Answers

Joe Ainsworth
Joe Ainsworth
13,588 Points

It depends what you want to do with the data that is input and the calculation. If you need to save the data or the calculation to a database you'll want to use a server side language like Ruby or Python. JavaScript is client side so for simple calculations why not use the users processing power rather than send it server side?

DON'T SPAM!!!

Dylan Shine
Dylan Shine
17,565 Points

It's all the same at the end of the day, I prefer Python...better libraries for handling data.

Andrew Kiernan
Andrew Kiernan
26,892 Points

Hi Yolanda:

For something like that any language will work, and I doubt there would be much if any difference in response times, etc. So you can use whichever you like best!

-Andrew