Chủ Nhật, 21 tháng 3, 2004

The World's Two Worst Variable Names



C: A Reference Manual (5th Edition)...sometimes you'll find variables where all vowels have been removed as a shortening technique, instead of simple truncation, so you have $cstmr instead of $cust. I sure hope you don't have to distinguish the customers from costumers!



There have also been intentionally bad variable names, where the writer was more interested in being funny than useful. I've seen $crap as a loop variable, and a colleague tells of overhauling old code with a function called THE_LONE_RANGER_RIDES_AGAIN(). That's not the type of bad variable name I mean.



Variable naming conventions can often turn into a religious war, but I'm entirely confident when I declare The World's Worst Variable Name to be:



$data



Of course it's data! That's what variables contain! That's all they ever can contain. It's like you're packing up your belongings to move to a new house, and on the side of the box you write, in big black marker, "matter."




O'Reilly Network: The world's two worst variable names [Mar. 07, 2004]



IBM DeveloperWorks: Bayesian Inference in PHP



An Introduction to Bayesian Inference and Decision, Second EditionOne of the most useful, coolest technologies that has come down the pipe has been Bayesian calculation and filtering. New from IBM's DeveloperWorks this morning is a great piece covering it. Paul Meagher introduces Bayesian inference by discussing the basic mathematical concepts involved and demonstrating how to implement the underlying conditional probability calculations using PHP. In this article, the author discusses how Bayesian inference can be used to build an online PHP-based wizard that guides a user through the process making a medical diagnosis...



This three-part series features interesting applications designed to help you appreciate the power and potential of Bayesian inference concepts. It's good that he starts with some basics like conditional probability (the base of the bayesian functionality) and then quickly moves using this functionality to create a probability function. They roam through various formulas, showing you how each relates to the greater whole, and, in the end, help you create a 'medical diagnosis wizard' for your benefit...
"



IBM DeveloperWorks: Bayesian Inference in PHP

Không có nhận xét nào:

Đăng nhận xét