What is a hack and when is it useful?
Posted by: cnielsen
on Dez 5, 2011
This article reviews approaches to developing custom extensions vs “hacked” code solutions for a Joomla CMS but the principles are more universal in concept.
First let’s explore some of the many definitions of a “code hack”, not to be confused with a commonly known intruder typically known as a “hacker”. Then we need to define what we are referring to as it relates to developing a quality Joomla CMS portal. Below are some quotes I found on the web related to a code hack that range from an appropriate method for solving a coding problem vs someone with limited skill providing a less than adequate mess of “spaghetti code”. The term “hacker” traces its origins back to making rough furniture with a hatchet and a stump. That seems to fit nicely — a very quick solution that solves a particular problem good enough. This approach would not equate to the fine craftsmanship of a quality piece of furniture nor offer the longevity for a sustainable solution.
A few definitions I found online (I am sure there are more):
- “An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed”
- “to cut or sever with repeated irregular or unskillful blows”
- “an appropriate application of ingenuity.”
- “a quick-and-dirty patchwork job”
So the real question here is: When and why should I use a code hack vs a packaged extension?
I want to focus this article’s reference in regard to number 3 and 4. Sometimes there is not enough time or available resources to implement a solution to its fullest extent but you need to resolve a problem quickly yet effectively for the intended purpose. This would mean that you alter the core code in a way that solves your problem but perhaps would need to either be implemented again or maintained over the evolution of your project. Many times though unfortunately developers do not always leave good comments or breadcrumbs for keeping up on these modifications and thus when you upgrade your site you are left with the same problem all over again.
How “Joomla specific” are the developers you are working with?
If your developers are good at sharing comments and notes related to the changes then a hack can often be the “path of least resistance” and least expensive way to meet your challenge. However, if this is not the case then you need to make sure that you work with professional Joomla extension developers to make sure you get a clean bundled installable Joomla extension that can be easily maintained with version control and change logs.
Properly developed and packaged Joomla extensions cost a little more to complete upfront but significantly reduce the headaches, hassle, maintenance and expense over time. It has been our experience on larger more complicated projects you always want to choose to spend the extra time and money up front to have a proper extension built for your solution and when it is not possible to bundle the solution completely that you get clearly defined change logs that you can refer to the next time you have to upgrade your site. Remember in the world of open source you really need to keep your environment up-to-date and current to reduce potential security breaches. Try not to be short sighted in your approach or it may come back to bite you later if a bad guy “Hacker” with ill will finds a way to interrupt the presentation of your web site.
CNP Integrations specializes in developing custom components, plug-in’s, and modules for Joomla! CMS. For more information or a free consultation with a project manager call: 1-508-644-1553



