8 tips for the aspiring Drupal developer
Open source is really great. You get to cherry pick from some of the best software out there and build neat stuff with it, fast. Most open source projects will also encourage you to contribute your own work back to the project. Supposedly, so others can benefit from your work.
While that's often an easy, karma-scoring move, it can have some unintended, annoying consequences. For example, people might start sending in bug reports for your code or may offer suggestions on how to improve it. Even worse, meddling know-it-alls may even offer to 'help' with development and do things with it that you never intended. Some projects, like Drupal, even trick you into such forced participation, by automatically supplying issue trackers, RSS feeds, revision control and other, undesirable community interaction.
Luckily, there are several things you can do to keep those pesky contributors away altogether. You can participate in open source without suffering any of its extended effects. Here are some concrete tips for the aspiring Drupal developer. Of course, a true creative will find novel ways of keeping their open source involvement to an absolute minimum!
- Using an existing platform can be daunting. If it does something weird that you really can't explain, just work around it. You have better things to do. Warn others away with a comment that explains that you "Don't know why, but with this, the problem goes away." Avoid getting help from the original coders: they were the ones that broke it, remember?
- Lift pieces from the core and change them. Drupal core provides a rich platform, but the core developers are often short-sighted. For example, several key API functions contain so-called 'security measures' that often just get in your way. Feel free to copy code from core and tweak as needed. Slap a
mymodule_prefix on the function name and you're good to go. Comments about what you tweaked are unnecessary—people can just use diff. And, unlike core, your copy will never be broken by 'fixes' from the community. - Include everything but the kitchen sink. If your project needs several related features, group them together into one big module. This ensures that others will always see something they don't need and can't easily get rid of. The idea of serious remodeling in foreign code is an easy turn-off.
- Forget about backwards compatibility and upgrade paths. If it works for you, that's good enough. Besides, if someone else needs to keep their data, they can still figure out the changes on their own if they're determined. Extra points scored for ensuring that your module can only be installed correctly on a blank site, as this ensures low uptake.
- Avoid conforming to coding conventions. There's nothing like non-standard names and confusing syntax to make that first read through of the code just that little bit more annoying. And really, why should you conform to the whims of a bunch of like-minded zombies?
- Skip code comments when possible. As the original author, you already know what the code does. Plus, leaving out Doxygen sections for functions is a great way to make it harder for someone to 'get the big picture' and see how your code fits together. If you must leave a comment as a reminder, don't use sentences, but just slap some related keywords together. Avoid verbs, as they easily expose data relationships and control logic.
- Don't make it localizable. If you don't speak English, you can even code directly in your native language, and save yourself a lot of trouble translating later. This means you also don't have to deal with those annoying Localization APIs that are over-engineered only to handle the moon language of some godforsaken mountain pygmies anyway.
- If you must, obfuscate and bloat. Some projects are just too large, trendy or otherwise high-profile to not attract a crowd. In this case, going through the trouble of making your code more verbose and complicated is often needed to keep these nosy people at bay. Go through the extra effort—it's worth it.
Some of the better methods include:
- Clustering pieces of your code together in large mega-functions with no clear delimiters.
- Writing out all your control flow in long, repeated logic structures that contain as many squares from the truth table as possible.
- Keeping local data in static and global variables, for much longer than needed.
- Subtly misnaming functions, methods and variables for maximum effect: a
_check()that doesn't, a_save()that deletes or a_form()that returns a table can wreak havoc in the most unexpected places. - Creatively using APIs for accessing internal or otherwise unrelated data. The API reference is a great resource for finding such useful backdoors.
With these simple guidelines, you'll keep even the most seasoned contributor far away before they ever think of submitting a patch!

9. Do NOT include uninstallers
9. Do NOT include uninstallers Why would anyone want uninstall your module? If they don't understand the greatness of your module, they should really keep it until they do. It's also important to use as complicated database schemes as possible to prevent the sneaky users from deleting it directly from the database.
Great
Reverse psychology works much better for me! Thanks ;-)
more
addition to 7. If you speak only English, why take advantage of localization features? Hard code in English to make it more difficult for non-English users to leverage. After all, there can't be that many in the world can there?
Nicely done, Steven
Man, I'll have to try some of these out! I can work on it while I'm on my way to Drupal Hell. :-) Nicely done, Steven. Do you think this is worth adding to drupal.org along with Drupal Hell?
We should have a section for "humorous advise" or something on the site. Or maybe I'll keep suggesting weird things until I have enough non-link text in here that the spam filter lets me post this comment.
Don't provide APIs
10. Don't provide APIs. You are the author of the module, so you know better than anyone on how exactly your module should be used. Providing an API will only allow other annoying developers to use your precious code to do stuff you'll never approve of. Plus, you'll never have to worry about breaking someone's code if you don't ever provide an API in the first place. Eliminate the cause and the effect will obviously be gone!
11. Write your module in another language. Why should you be conformed to PHP? Get creative. For example, implement a VBScript interpreter in PHP, then write your module in VBScript! This will ensure snobby contributors can't patch or improve your module to distract you from Getting Things Done (TM). Bonus point for writing your module in Ook!
12. Don't write modules, write patches! Drupal's hook system is too confining and tedious. To ensure maximum integration with Drupal, you should always directly modify core. Afterwards, compile them into patches so that you can apply your great modifications to the core at anytime. No sane contributors will try to improve it. After all, nobody's insane enough to patch a patch!
13. Don't follow Drupal's
13. Don't follow Drupal's user interface conventions. Add a touch of the exotic in your module by implementing your own UI functionality. Avoid at all costs using core's UI functions: your unique perspective on usability is a gift to be shared with the world.
14th Tip
14. Don't read this and the Drupal hell article.
i'd like to steal this
i'd like to steal this content to handout on a training course.. Would you creative commons your blog post for me?
15. Don't bother reading the FAQ or bug base
Just "fix" whatever bothers you without finding out if the behavior is there for a specific reason.
16. Replicate, replicate, replicate. Cut and paste is your friend. Why go through all the work of putting some useful code block into a loadable module? Just paste it in over and over and over and over...
17. VCS is for girlies. If they really want to know what's different they can use ddt. Diff is for girlies!
Newbie to Drupal
I am a newbie to Drupal - a small time PHP programmer trying to enter the ocean after the waves settle
and hey! you win steven, I DO NOT UNDERSTAND ANYTHING!
Post new comment