Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Mathematics eq CompSci

by tilly (Archbishop)
on May 02, 2005 at 14:27 UTC ( [id://453256]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Mathematics eq CompSci
in thread Mathematics eq CompSci

One might go so far, but I think that one would be wrong.

I've solved enough real-world performance problems due to subtle algorithm issues that I firmly believe that there is real value in being able to estimate scaleability. Furthermore if you ever want to have hope of treating databases as more than magic black boxes, you'll need an understanding of algorithms to see how they work.

Replies are listed 'Best First'.
Re^4: Mathematics eq CompSci
by demerphq (Chancellor) on May 02, 2005 at 14:38 UTC

    I dont think it would be wrong, as I dont really consider someone like you (or to be honest even me) to be representative of the programming world. I do agree that the ability to estimate scalability is important, but simply reading a page on what big-oh notation is and then reviewing standard lists of algorithms and their performance will be sufficient for the vast majority of programmers out there. As for the comment about DB's I hope youll explain what you mean, I'm having difficulty thinking of how a knowledge of algorithms will help with the use of a DB. Sure it might explain why sometimes when you drop indexes and then recreate them the record order may change, but beyond that?

    ---
    demerphq

      Here are a few sample questions which understanding the database can help with:
      • Why is my query slow?
      • Why do I need indexes?
      • Why isn't the optimizer using my indexes?
      • Why is it important to use joins rather than putting all merge logic in code?
      • Why is the database falling over?
      I've seen every one of these. I've sped up queries by breaking one flexible one into multiple similar ones (each one fed a different condition which causes a different query plan to be best). By having many similar one be replaced by one parametrized one (to reduce parsing). By telling it to use a particular index. By getting it NOT to use a particular index. By pushing logic down to the database. By pulling logic out of the database into code (because I knew how it should do it and the database optimizer got it wrong).

      There is no simple rule for when to do each thing. But every case I could explain why I did what I did if you understood algorithms. (And if you didn't understand algorithms, my explanation would have made no sense.)

        Theres a big difference between "understanding the database" and "having the mathematical skills required to produce an analysis of the algorithms used". Nothing you listed requires the later skills. A competent DBA can answer every single question like this (and more) and not know the first thing about how to analyse mathematically the algorithms used. While your mathematical background may have assisted you in your analysis there not much there that can't be answered with rote learning and experience. A DBA or something without mathematical background probably would provide much the same answers and similar explanations for them that you have, but without the mathematical aspect. And I suspect that while the math part of your explanation may have rattled some brains (if my math skills can do that to people then im sure yours can too :-) the "common sense" and "folk science" part would have been quite comfortable with your explanation.(Ie if you say "combinatorial explosion" you may get puzzled looks, say "the number gets too big too fast" and you won't.)

        Look, to be clear here, I know and understand the importance of mathematics in programming and computer science. All things being equal the more math you have the better off you are. But its a mistake to assume that because your experience of computing is so related to your mathematical understanding that others require the same understanding to do more or less the same stuff as what you do. Unless you are actively involved in algorithm research or R&D in general most of math involved in Computer Science is unnecessary. A case in point is Knuth's Art of Programming. In that book he takes care to mark and seperate the mathematical sections from the general explanations. When he goes into detailed analysis of an algorithm he does it first in laymans terms to show whats going on and then proceeds on to mind boggling stuff. I think that this organization and Knuths own comments about it being unnecessary to understand the analysis to understand the algorithms speak volumes on this subject.

        ---
        demerphq

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://453256]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-20 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found