Do not unnecessary load session or other scopes
Scenario:
settings file:
database_conn = instantiate.object
session_scope.conn_obj = database_conn or
application_scope.conn_obj = database_conn or others
script file:
object.init(application_scope.conn_obj)
You should not do that. It’s easy, indeed, because you can forget now about where and how is defined the object and you always have it handy in your application/session/other scope. BUT you will load your scope with unnecessary data and it’s a bad practice.
Instead, you should give the objects/variables as arguments wherever you need (in a good MVC framework you need to do things only once as in the module controller or settings file).
object.init(database_conn)
Fusebox framework – some cons
As a newcomer to ColdFusion you will quickly find out that Fusebox is your framework. It’s the oldest and the best CF framework out there.
It’s easy to put your hands on the last Fusebox core release, which is 5.5 the moment I’m writing this post. But the next step is to learn it. So you search for the manual, tutorials, articles. And you find a poor official documentation and many commercial online articles and books. It’s somewhat frustrating and a feeling of old and deja-vu overhelm you. It’s years since others popular products have entered the free and open knowledge communities era. At least the manual should be a much more better one because the users knowledge is rated at a high price.
Another con is the difference between versions with poor organized documentation. I’ve seen a company portfolio with several projects built on Fusebox3, 4 and 5. The newcomers junior programmers were dizzy switching from one to another by rights.
Google – user generated/managed search results?
There are rumours on this one since a couple of years. But it’s more than rumours because Google is testing “an experiment that lets you comment on search results and move them around on the result page” (Ben Gomes, Distinguished Engineer, Google blog link).

User managed search results at Google
What do you think, should we expect this feature to be public soon? My opinion is negative as the experience shows us we cannot rely on user generated/managed content without heavy supervising or strong and complex filtering/management software robots. Especially when it’s about very large projects like Google’s search engine. I’m pretty sure that this will be a late feature and much different from what we understand it to be today. Of course, a quick release could be the usual “client side management” feature which means the user will affect the search results on his side/account only (without needing a real login account, based on cookies, temps, sessions, ip etc, you know what I mean
).
Programming frameworks – MVC
If you have no ideea what MVC (Model-View-Controller) is about please read here, here, here and/or here.
When you start-up as a programmer, no matter what language, you first learn iterative programming, then your teacher learns about recursive programming and he shows to you and you are both happy, then you hurry up to do spaghetti programming for tens of projects, then your five years younger neighbour tells you about structured programming and you start to spend weeks on adjusting your projects code, and later you read about OOP in a cookbook and you delete all your projects to start new ones
From the beginning of his career the programmer tries to design and improve nice and efficient frameworks. Depending on the programming language the frameworks have different characteristics, of course, therefore you can’t use the exactly same framework characteristics.
But, as general programming behavior, I’d like to propose some guidelines regarding frameworks:
- Try as much as possible to build/choose MVC frameworks from the beginning for your applications
- Though we don’t like too much theory learning, read and learn about the MVC notions and specialists’ articles in order to improve your architecture logic; you may be surprised to find out that most of the time your application may run faster or be easier to maintain if you do the right customization, even if it’s related to one module of your application only
- If it’s working and it suits your projects, your team is using it and you’ve already built the documentation, stick to it. Don’t try to change the projects’ frameworks on the fly, especially when you have a team using it. It takes lot of time and many issues keeps popping up, trust me. You should only change the framework if it’s bad from the beginning and it can’t be improved.
- Try to choose/buy from the beginning a good framework that suits your needs. There are so many frameworks for almost all programming languages that it’s almost impossible not to find a suitable one. Learn the choosed one, they usually come with good manuals, and adjust it as you wish. It always takes less time and money. Just remember, if you have very complex projects that need too much out-of-the-box-framework customization for power and speed improvement (web big projects usually do), you might be considering as well to start you framework from scratch.
MVC frameworks examples: CakePHP (php), FuseBox (coldfusion, php), Struts (java), Spring (java) and many others (just google).
CERN – science to the limit
Last days the press went crazy. The CERN experiment is the topic of the day and we have hundreds of doomsday scenarios. Like the 2K virus, but now it’s more juicy, with so many scientifically hypothesises full of buzzwords
I am personally happy with hi-tech science experiments. Of course, only when I know there is an army of hi-IQ professionals scientists to supervise
That’s because I believe the mankind evolution is based half on science half on spirit
And I think it’s time to improve our material world, so goooo science.
PHP 6.0 peek (unknown release date)
It’s long since we’ve had the first inside info about the 6th version of PHP. Actually, the very first time I heard about PHP 6 was back in 1999, long before good old PHP 4.3.0
(http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markup)
This Mid Octomber we will have the PHP 5.3.0 release. No word on the PHP6 release date, so we still have to wait. But the news is that PHP 5.3.0 will already have some of the 6th release announced features/improvements (namespace support, improved XML support through use of XMLReader and XMLWriter, SOAP support and others). So no Unicode support yet and you may still play with ereg (you have more time to switch to preg_match, hurry up
)
If you want to peek (again?) on what we’ll have in the PHP 6.0, I have some quick picks for you:
http://php.net/~derick/meeting-notes.html
http://www.ibm.com/developerworks/opensource/library/os-php-future/
http://www.phpro.org/articles/PHP6-Preview.html
http://snaps.php.net/ (php 6 snapshot, developer build)
PS: but of course, we already have the PHP 6 book
(http://www.amazon.co.uk/gp/product/032152599X/ref=cm_cr_pr_product_top)
e-Business romanesc: content si servicii supraestimate?
Ma intreb daca nu cumva efervescenta din web-ul romanesc nu este putin fortata. De ceva timp se tot aud, periodic, voci si opinii exclamative legate de animatia si boom-ul pietei romanesti de online.
De 2-3 ani asistam la anunturi pline de entuziasm ale agentiilor de publicitate si ale regiilor jucatoare (dezvoltatoare). “Anul 2007 va fi marcat de o explozie a pietei, ca la imobiliare la inceputul anilor 2000″, “anul 2008 va fi anul tranzactiilor si proiectelor spectaculoase”, “veniturile din publicitate online vor urca prin tavan” etc. Si totusi, ca utilizator obisnuit, nu observi decat cateva miscari legate de relansari, re-brand-uiri, redesenari, adica aproape acelasi continut in alte forme sau culori noi si ceva mai multa interactivitate. Parca tot timpul esti pus in garda ca vei experimenta cat de curand noi orizonturi iar acestea nu prea isi fac aparitia
Leave a Comment
Internet slang should have DYC!
Filed under: Programming (generic) | Tags: comment code, document your code, programming best practice
Document Your Code! Document Your Code! Document Your Code!
Internet slang should accept the DYC (or DYFC if you’re very angry) acronym. I’m going nut when I have to take over or to debug someone’s else UNCOMMENTED or poor commented code. I will write a tutorial on how one should comment and document his/her applications’ code.
So, please DYC!