Jump to content

It 's not just about code!


G+_Lee Crocker
 Share

Recommended Posts

It's not just about code!

 

Padre has emphasized how OO design can help organize your code and make it easier to maintain and modify. But that's not our ultimate goal. What we really want, first and foremost, are useful programs. And the most important part of making useful programs is . . . data structure. If you pick the wrong data structure for your program, your code will be complicated and buggy no matter how clean its design. Pick the right one, and the code writes itself.

 

In 2001 when Wikipedia was starting to grow, Magnus Manske began a project to improve its interface and add some needed features by rewriting the code in PHP. I liked his interface and features, but his code was totally unable to handle the massive growth we then experienced, and crashed under stress. I started a new codebase based on a carefully-tuned MySQL database structure, and had the new code up and running in a few weeks. Tim, Brion, and many others have added to and modified my code to the point where there's probably none of my code left. Is a huge codebase now, and good OO design makes it maintainable (even in a language like PHP, which I dislike). But the reason it works is the underlying data structure.

 

The classic work here is Aho's "Data Structures and Algorithms", which is unfortunately expensive, but well worth it. I'm not fond of similar books that are language-specific, but those by Robert Sedgwick are good.

 

I hope some future module of this show will treat this subject better.

Link to comment
Share on other sites

I could not agree more Lee Crocker 

 

In fact "OOP" (objects) are in fact nothing more than data structures, with the function (methods) attached (and a pointer back to self).

 

It matters not if you are coding new school (objects) or old school (data structures), good, well thought out data members and the code that will manipulate the data not only rules the day, it probably rules tomorrow.

 

Great programmers are often forgotten, not for the bad job they did, but due to the great job they did, as their code probably runs (untouched) perhaps for decades. Almost always, that is a result of great planning at the data structure level.

 

Joe

Link to comment
Share on other sites

 Share

×
×
  • Create New...