Welcome to WebmasterWorld Guest from **54.163.25.166**

Forum
Moderators: **brotherhood of lan & mack **

How complicated does the maths one needs in order to code dynamic websites get? I just read something about a very successful programmer in game development who said he was rather bad at maths in school. Apparently logical thinking and problem solving seem to be big in coding, but how important are pure maths in web development (or coding in general for that matter)?

Do you ever need advanced statistical stuff (regression, clustering, decision trees,...) for algorithms you code?

thanks!

(P.S.: I'm not scared of maths :-), it's more a curiosity thing)

It really depends on the type of coding you're doing.

I don't use anything complicated on the front end, but use some slightly more complex math on the backend for stats and looking for trends to focus on.

If you're doing a lot of DB work, set theory would probably be helpful, but I'm not sure how advanced you'd need to go.

Logical thinking and problem solving are definitely critical.

I think a good understanding of math makes for good code.

Yes you can code without knowledge of math but doing advanced algorithms usually involves some advanced math stuff but you don't have to know it, just be apt at understanding when you need it.

A simple example....

When I was in school we had to do a calculator project, we had to custom code a calculator in a java applet to run on the web.

One guy in my class kept swearing and getting pissed off. We asked him what his issue was and he was having an issue creating a positive/negative button that would toggle the value to positive or negative.

He was doing some wacky int to string conversion to check for a '-' then would try to parse it out or add one then convert back to an integer. It was ugly.

I asked him what would you do in math to make a number negative or positive without changing the number value and he looked at me like I was asking advanced math...

All he needed to do was multiply the value by -1 and that would toggle the positive/negative value without caring what the current value is positive or negative, because if you know math you know that multiplying by 1 won't change the number value but multiplying by -1 will make it negative if it is positive and vice versa.

I can think of lots of other examples where code is better because of a good understanding of math. His method would have worked but as far as good code goes not so much.

Just look at "bubble sort" vs "selection sort" algos.. math makes a difference.

Game programmers will likely run into it more often than standard application development but yes, sooner or later you are probably going to be doing some math. The best part is, you can get your math from a mathematician if necessary. For example, when I first set out to code a "dealer locater" based on United States zip code (latitude and longitude), I found a theory and formula from a man that worked for NASA. I asked him if it was OK for me to use his formula in my code and upon granting me the go-ahead I merely translated his formula into code.

Don't let the math be too intimidating to you. I would say logic is going to play a much larger part in your coding than math. Now, if you are lacking in the logic department, that's a whole new ballgame ;)

All he needed to do was multiply the value by -1 ...

Hoo-boy, if this is considered "complicated math"... :)

[**edited by**: LifeinAsia at 5:28 pm (utc) on April 1, 2008]

First of all thanks for the replies!

Hehe the * (-1) really was complicated math :-) but I think I get your point.

@coopster: Actually I don't find maths intimidating. Actually I kind of like it - as long as it doesn't get overly theoretical (that's the kind of stuff I don't like!)..so I was mostly wondering whether one would almost have to have a PhD in maths to be a great developer or whether being plain "good" at maths was enough to become a good developer.

How about statistical stuff such as regression, clustering, etc. though? I'm majoring in business (want to go into e-commerce) and my two statistics classes were my favorite classes (lol). Is that ever needed for algorithms or not really? (just curious!)

thanks again!

Do you ever need advanced statistical stuff (regression, clustering, decision trees,...) for algorithms you code?

Understanding the advanced statistical stuff might be a big help when you are designing a database driven site where the amount of data can grow huge. Understanding how the data can be sorted and organized, which queries will be used in most cases and which paths through the data give the fastest results may make the difference between a turtle site or a cheetah.

I, too, was paying more attention to the locks of golden hair in from of me than the math lessons. :-) I really regret it now. It does become important, but as said, you can figure out what you've forgotten in math, it's just regretful you should have to. Should have been paying better attention, it turns out there really **was** a use for math in the real world.

Shipping calculations that consider volume and final dimensions of a package for multiple items, that one kept me kicking myself in the pants for a month or so. :-(

Hi lammert & rocknbil,

@lammert: I think this is one of the things where I have to think to myself "it (statistical techniques) might be of some help at some point, but my time is probably better spent on learning the things I need to know - and if I learn other algorithms that are frequently used for programming, etc. that should keep my mind fresh when it comes to these things, so I won't have a big problem if I ever have to (or feel) like learning stats".

However, are decision tree algorithms such as CHAID (frequently used in database marketing, I think) not used in programming? Aren't decision tree algorithms used in coding a lot (or is it just that CHAID is never used :-))?

@rocknbil: Actually, I feel about it exactly the same way..I was never interested much in maths, but if I'd go to school once again, it would be one of the select few subjects I'd try to be good at and learn something I can actually use later hehe

In over 25 years in IT I have never needed anything more complicated than basic algebra but that has been essential.

In my previous job I set a simple apptitude test:

Write 1 + 2 * 3 in two ways to get the answers 7 and 9

Anybody who could manage that was capable of learning SQL. I had never thought it necesary until I was given a trainee who really couldn't understand why 1+(2*3) and (1+2)*3 were different. He quit fairly rapidly.

- Register For Free! -
**Become a Pro Member!** - See forum categories - Enter the Forum

- Moderator List | Top Contributors:This Week, This Month, Jan, Dec, Archive, Top 100 All Time, Top Voted Members

- February 2016 AdSense Earnings and Observations
- Google Updates and SERP Changes - Feb 2016
- What to do When a Site Drops in Google's SERPs
- Google Targeting Bad Ads With New Deceptive Site Label
- Report: LinkedIn Stock Dropped $10-billion
- The Head Of Google Search, Amit Singhal Is Leaving The Company
- Facebook Opens Up Its Audience Network (Beta)
- Google Updates and SERP Changes - Jan 2016
- Google Webmaster Guidelines Updated, 2016
- Someone building exact match links to my site

- What to do When a Site Drops in Google's SERPs
- Report: LinkedIn Stock Dropped $10-billion
- Google Targeting Bad Ads With New Deceptive Site Label
- Facebook Says Its Version of Six Degrees of Separation is Three Point Five
- The Head Of Google Search, Amit Singhal Is Leaving The Company
- Google Updates and SERP Changes - Feb 2016
- Google Webmaster Guidelines Updated, 2016
- Yahoo To Cut 15pct of Staff and Close Some International Offices
- E.U. and U.S. Agree New Data Transfer Deal Replacing Safe Harbor
- Alphabet Q4 and Year End, 18pct Up to $21.329 Billion