Developers! Y U No Open Source Ur Code?
-
Upload
craig-marvelley -
Category
Technology
-
view
1.260 -
download
0
description
Transcript of Developers! Y U No Open Source Ur Code?
DEVELOPERS!Y U No Open Source Ur Code?
http://ragecomics.memebase.com/
Tuesday, 1 November 11
SOMETHING ABOUT ME
http://www.flickr.com/photos/jimmiehomeschoolmom/
http://www.flickr.com/photos/catatronic/
Craig Marvelley
Developer @ Box UK
@craigmarvelley
boxuk.com
Tuesday, 1 November 11
What is open source software?
http://ragecomics.memebase.com/
Tuesday, 1 November 11
Hands up if you use open source software
http://www.flickr.com/photos/cheesy42/
Tuesday, 1 November 11
http://www.flickr.com/photos/cheesy42/
Hands up if your company uses open source software
Tuesday, 1 November 11
http://www.flickr.com/photos/cheesy42/
Hands up if you release open source software
Tuesday, 1 November 11
http://www.flickr.com/photos/cheesy42/
Hands up if your company releases open source software
Tuesday, 1 November 11
A recent survey of 300 companies found:
Source: Accenture (2010): http://newsroom.accenture.com/article_display.cfm?article_id=5045
28%
22%
50%
Using Open Source Software Don’t intend to use it Experimenting with it
Tuesday, 1 November 11
A recent survey of 300 companies found:
Source: Accenture (2010): http://newsroom.accenture.com/article_display.cfm?article_id=5045
71%
29%
Willing to contribute software back to the community Unwilling to contribute
Tuesday, 1 November 11
• Utilised in many of our products
• Particularly the Amaxus ® Content Management System
• Amaxus is mainly written in PHP
• Version 3 (2002): ~1,439,295 lines of PHP, 3% open source
• Version 4 (2008): ~1,474,994 lines of PHP. ~81% open source
OPEN SOURCE AT BOX UK
Tuesday, 1 November 11
Avoid reinventing the wheel
http://www.flickr.com/photos/rvignes/
Tuesday, 1 November 11
Quality is paramount
http://www.flickr.com/photos/zigdon/
Tuesday, 1 November 11
Make sure it’s accessible
http://www.flickr.com/photos/potatojunkie/
Tuesday, 1 November 11
Check the license suits the usage
http://www.flickr.com/photos/ecastro/
Tuesday, 1 November 11
THE TURNING POINT
Tuesday, 1 November 11
http://ragecomics.memebase.com/
Tuesday, 1 November 11
OBSCURA
• PHP component to perform thumbnailing
•Written for PHP 5.3 - namespaces, autoloading, fully unit tested
• Integrated back into Amaxus
• Could we do another one?
Tuesday, 1 November 11
BOXUK-DI
• Amaxus has an annotation-based dependency injection container
• Uses the Addendum library to parse doc-blocks
•We refactored Amaxus to extract the DI code
• Existing unit tests made sure we didn’t break anything
•We now had two libraries on our hands
Tuesday, 1 November 11
“What if we open sourced them?”
http://ragecomics.memebase.com/
Tuesday, 1 November 11
PRECEDENT
• Zend
• Sensio Labs
• Liip AG
• Gradwell
• openSky
• knpLabs
Tuesday, 1 November 11
GOING OPEN-SOURCE
• Hosted the libraries on a company github account
• Redesigned our ‘labs’ page on boxuk.com
• Authored content for the website to announce and document the libraries
• Tweeted about it from the company account
Tuesday, 1 November 11
Tuesday, 1 November 11
Feedback for Obscura
Tuesday, 1 November 11
Feedback for boxuk-di
Tuesday, 1 November 11
“Lets do some more!”
http://ragecomics.memebase.com/
Tuesday, 1 November 11
BOXUK-ROUTING
• Refactored and extracted the routing system from Amaxus
• Slightly different to other routing components
•Decreased coupling
• Improved code quality
• Improved test coverage
Tuesday, 1 November 11
DESCRIBR
• Component to extract metadata from any file
•Wraps php-reader, adding a plugin architecture
• Encourages others to contribute plugins and functionality
• First library to be used outside Amaxus
Tuesday, 1 November 11
Bringing it all together
http://www.flickr.com/photos/pinksherbet/
Tuesday, 1 November 11
CODING STANDARDS
•We had a defined coding standard
• It was only written down; no way to enforce it
• Enter PHPCodesniffer
•We wrote a set of sniffs to check code conformed to our standard
• Integrated it into our Continuous Integration process
•Open sourced the sniffs on Github
Tuesday, 1 November 11
DEPLOYMENT
•We started using the libraries in live projects
• Git isn’t ideal at dependency management
• Looked into using PEAR as a deployment mechanism
•Wasn’t straightforward to begin with - documentation lacking
• Eventually successful - and it was worth it
Tuesday, 1 November 11
The Future
http://www.flickr.com/photos/alejandroamador/
Tuesday, 1 November 11
MORE OPEN SOURCE SOFTWARE
• Continue to release PHP components
• Perhaps contribute to the Symfony CMF project
• Release code for other languages?
Tuesday, 1 November 11
SUMMING UP
• We have improved our code quality
• We have an enforced coding standard
• We have a PEAR channel
• We have experience using Git and Github
• Our website has more content
• The company has increased visibility
• Our developers can work on diverse, contained projects that make a difference
Thanks to our open source experiment:
Tuesday, 1 November 11
LESSONS LEARNED
• Remember YAGNI - You Ain’t Gonna Need It
• If refactoring existing code for release, choose wisely
• Use the right tools for the job
Tuesday, 1 November 11
THANKS FOR LISTENING!
@craigmarvelley
http://github.com/boxuk
http://joind.in/talk/view/3810
Tuesday, 1 November 11