Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Mathematics eq CompSci

by demerphq (Chancellor)
on May 02, 2005 at 08:33 UTC ( [id://453168]=note: print w/replies, xml ) Need Help??


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

That said, you certainly do not need to master all kinds of advanced math to be able to handle this kind of counting. For instance expertise in differential equations will not prepare you to understand why a quicksort is on average better than a bubblesort, and why a mergesort has better performance guarantees than quicksort, even though its average performance is worse (if all memory is equally fast to access).

Indeed. One might even go so far as to say that what most programmers do does not require this math at all as one is mostly selecting from a set of prewritten libraries (and thus algorithms) whose properties are reasonable well known and documented. For instance those writing software that is heavily DB based probably will never consider what sort algorithms are in use as its handled by the DB. And those that do need to use sorting algorithms rarely need to self-determine the algorithms performance as some clever math type already did it and wrote it down in such a way that we can make educated choices without requiring the math skills. Of course if you dont understandthe underlying principles you end up making bad decisions.... (Like maybe there are circumstances where its better to use bubble sort, or where using splays is extremely inefficient....)

---
demerphq

Replies are listed 'Best First'.
Re^3: Mathematics eq CompSci
by tilly (Archbishop) on May 02, 2005 at 14:27 UTC
    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.

      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.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found