Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
How much math is required to learn javascript or php?
Old 02-19-2010, 09:56 PM How much math is required to learn javascript or php?
YoshiGoneMad's Avatar
Novice Talker

Posts: 7
Trades: 0
Just about done learning HTML/CSS and will probably venture off to javascript next. When I went to take programming class for C++, it requires that I take rigorous math courses.

Is this the same for javascript and php? What sort of math is involve in this?

Thanks.
YoshiGoneMad is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-20-2010, 12:20 AM Re: How much math is required to learn javascript or php?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
There is next to no math involved in just writing code (granted this depends on the program you are writing). If you know how to add and subtract you can learn to write code. If you want to determine the time and memory complexity of an algorithm you're going to need a bit more.

In general, the further you move away from programming and the closer you get to computer science, the more math you'll need.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 02-20-2010, 04:38 AM Re: How much math is required to learn javascript or php?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Agree. Math where never my strongest point in school, and it never had handicaped me in programming.

Except for that one time where I had to implement the computing of a distance between 2 points given by latitude/longitude.
But if you ever had something like this to solve, and with internet at disposal, you won't have much problems solving it.

Thanks again, Google...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-22-2010, 11:51 AM Re: How much math is required to learn javascript or php?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I've always been pretty good at math, and it helps me when doing client-side programming (JavaScript). I've built a couple of things that I needed to calculate positions on the screen with a limited amount of data available to me, so math was pretty important for this. However, for me, it was more a matter of drawing diagrams and eliminating what I didn't need, like a logical reduction to find the answer I needed.

People that are good at math tend to be able to be good programmers, since math is pure logic. But we have more freedom since programming is more about creative solutions to problems using logical steps than finding the one and only answer to fit the solution. There are also more skills involved such as pattern recognition and memorization that are mostly intuitive and not purely mathematical.

I've never been a computer science student, but my understanding is that students often study linguistics to better understand the language of computers. I don't know if this is true or not any more, but it makes sense, seeing how computer languages have evolved to be understandable like a reduced real language.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 02-23-2010, 01:02 AM Re: How much math is required to learn javascript or php?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I have a BA in math with a minor in CIS (Computer Information Systems). Mathematical knowledge comes into play in a variety of instances in coding where non-mathematically-oriented individuals will have more trouble than those with a background. Namely,

1) Logic. I'd suggest this is the fundamental reason for requiring mathematical knowledge. Logic will help you significantly in determining a best routine. I don't mean "common sense", but mathematical logic.
2) Knowing the difference between rounding, flooring, and ceiling functions
3) Understanding order of operations -- these are applicable for conditional expressions.
4) On a more advanced level, Big-O calculations to increase efficiency.

Also, in many elementary coding classes, problems are presented where you need to find an unknown. Being able to take a word problem, convert it to an equation, solve it, and then express it as code is a big help.

Finally -- for this post -- knowing different bases (e.g. binary, decimal, and hex) will make many tasks easier.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-23-2010, 03:53 AM Re: How much math is required to learn javascript or php?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
1) Logic. I'd suggest this is the fundamental reason for requiring mathematical knowledge. Logic will help you significantly in determining a best routine. I don't mean "common sense", but mathematical logic.
2) Knowing the difference between rounding, flooring, and ceiling functions
3) Understanding order of operations -- these are applicable for conditional expressions.
4) On a more advanced level, Big-O calculations to increase efficiency.
For the first point, do you relate it to your studies ?
I always had an curious mind, tearing my toys open as a kid to understand how they work, reading VCR schematics later for the same reason.
Trying to repair everything that broke on my own, even when the product was under warranty, just to try it.

Sure, math can help you develop a logical mind, but I believe that some people can have such a tendency without having to learn them.

The day I was introduced to OOp, it made so much sense to me that my first question was "Why haven't every (programming) languages been designed that way ?", which made my "mentor" chuckle.

For the second point, I find it hard to understand, honestly.
I am not a native English speaker, but even just the semantic of those words is way enough to understand what they means.
And those concepts are not very abstracts..

The third point is in fact scaring me....
The order of operations is something I learned between the 4th and 7th year of my mandatory school cursus.
Don't tell me that students, anywhere where there is basic mathematics, don't learn that multiplication and division are of an higher priority than additions and substractions (not sure about that word, but you understand me.)

The fourth point is the main reason I regret not having that background. Because that, I think, is something a lot harder to acquire without being taught.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2010, 04:15 PM Re: How much math is required to learn javascript or php?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Quote:
Originally Posted by tripy View Post
For the first point, do you relate it to your studies ?
I always had an curious mind, tearing my toys open as a kid to understand how they work, reading VCR schematics later for the same reason.
Trying to repair everything that broke on my own, even when the product was under warranty, just to try it.
Yes, I learned that in my "Introduction to Mathematical Logic" class.

For instance, if (!$a || !$b) is the same as if (!($a && $b)). That's the logic part, but then the coder brain must ask which will be solved faster. For example, given that the expression is evaluated left-to-right, if $a is more likely to be true, we could very often skip the evaluation of !$b, reducing the calculation by 1 calculation (yes, a minor savings in this instance, but we're working with a simple example). The equivalency, on the otherhand, will always require a full evaluation because the ! must be evaluated after the inner parenthesis.

As a more realistic, English example: "If the user is not logged in or does not have access, then ..." is the same as "if the user is logged in and the user has access is a false statement, then ...".

Sometimes we get much more complicated expressions and knowing how to simplify and reduce them while maintaining logical equivalency can mean the difference between an efficient and a less-efficient routine.

Quote:
Originally Posted by tripy View Post
For the second point, I find it hard to understand, honestly.
I am not a native English speaker, but even just the semantic of those words is way enough to understand what they means.
And those concepts are not very abstracts..
I've seen people write code like this:

PHP Code:
$number_of_required_things $number_of_smaller_things/$number_of_things_in_a_package;
if ((int)
$number_of_required_things $number_of_required_things) {
  
$number_of_required_things++;

where they could have just written
PHP Code:
$number_of_required_things ceil($number_of_smaller_things/$number_of_things_in_a_package); 
Having never heard of ceil, they found a way to achieve their goal, but it's less efficient. Sometimes, they've even committed this error:
PHP Code:
$number_of_required_things round($number_of_smaller_things/$number_of_things_in_a_package); 
Which would underestimate in some cases.

I know the variables are well-named, but just to help in the understanding, an example of such a routine would be a solution to the problem: If I have 654 apples and 25 apples fit in a box, how many boxes will I need?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-25-2010, 06:00 PM Re: How much math is required to learn javascript or php?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
PHP Code:
$apples 654;
$per_box 25;
$in_box 0;
$total_boxes 0;
for(
$i 1$i <= $apples$i++) {
    
$in_box++;
    if(
$in_box == $per_box) {
        
$total_boxes++;
        
$in_box 0;
    }
}
if(
$in_box != 0) {
    
$total_boxes++;

Wait, you mean there's an easier way?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 02-25-2010, 06:51 PM Re: How much math is required to learn javascript or php?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Interesting conversation. With the original question you don't need to know math to be a programmer, though it's already been pointed out how the two connect. I think a lot of it comes down to logic and while you don't need to take classes to learn how to be logical keep in mind that from a schools point of view that's how they want to see you learn logic skills. In part it's simply because to them it's an easy way to guarantee you've been presented that kind of information.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 02-25-2010, 07:56 PM Re: How much math is required to learn javascript or php?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Too funny!
Quote:
Originally Posted by wayfarer07 View Post
PHP Code:
$apples 654;
$per_box 25;
$in_box 0;
$total_boxes 0;
for(
$i 1$i <= $apples$i++) {
    
$in_box++;
    if(
$in_box == $per_box) {
        
$total_boxes++;
        
$in_box 0;
    }
}
if(
$in_box != 0) {
    
$total_boxes++;

Wait, you mean there's an easier way?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-25-2010, 08:17 PM Re: How much math is required to learn javascript or php?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The programming equivalent of counting on one's fingers...
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 02-28-2010, 12:07 PM Re: How much math is required to learn javascript or php?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Interesting how such conversations occur and then we get a thread like http://www.webmaster-talk.com/php-fo...unding-up.html to provide an opportunity to demonstrate.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-28-2010, 05:22 PM Re: How much math is required to learn javascript or php?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I read something today that I think demonstrates very well the relationship between math and programming: http://www.robweir.com/blog/2010/02/...er-ballot.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to How much math is required to learn javascript or php?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45827 seconds with 12 queries