write less drupal code

9
Let’s write less Drupal code. Alex Barth (alex_b)

Upload: alex-barth

Post on 13-Jul-2015

863 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Write Less Drupal Code

Let’s write less Drupal code.

Alex Barth (alex_b)

Page 2: Write Less Drupal Code

Much of the code we are maintaining

isn’t actually Drupal-specific.

Page 3: Write Less Drupal Code

jquery.js

aggregator.parser.inc

valid_url()

filter_xss()

check_plain()drupal_parse_info_format()

jquery.once.js

drupal_http_request()

drupal_depth_first_search()

password.inc

Page 4: Write Less Drupal Code

Some of these don’t seem to be a big deal:

check_plain()

Page 5: Write Less Drupal Code

Others do:

openid.inc (609 lines)

Page 6: Write Less Drupal Code

PubsubHubbub

Page 7: Write Less Drupal Code

If I had had

check_plain() drupal_http_request()valid_url()

my code would be shorter now and I could have written it in less time.

Page 8: Write Less Drupal Code

RSS/Atom parserRDF parserOAuthActivity StreamsSamanPub/subEver more jQuery for UI

Some existing challenges that will benefit form good external library support:

Page 9: Write Less Drupal Code

1.Allow modules to share external libraries by adding them to the

search path: sites/all/libraries (Libraries module)

2.Move non-Drupal-specific code into a separate include file(s) - make

them externally available?

3.Use drush_make to package modules with external libraries.

(Some) solutions