Every now and then, developers will ask – or will be asked – what is one of the most important things I should learn in order to get involved when writing code?
Obviously, this assumes that the person already knows how to write code, likely knows how to upload a site or compile the source code into an executable or any of that, but maybe they’re looking for something to amp up their development process.
Whatever the case, the rest of this content is for those who have been working with WordPress for a while, but are looking for some additional tools to help improve their development-fu. If you’re an intermediate to an advanced developer, this may not be of much interest.
But for the rest of you, I can’t recommend source control and differential utilities enough when amping up your development.
Source Control and Diff Tools
There’s probably some overlap in what all developers would suggest, but there are two things that I think are essential – especially if you’re working in open source – but even if you just want to maintain solid control of your codebase.
Of course, your suggestions may vary based on the type of code you’re writing or the type of environment in which you’re working, but if you’re a WordPress developer, then these are two things I think every WordPress developer should know.
1. Source Control
If you’ve ever submitted a plugin to the WordPress plugin repository, then you’ve used Subversion – one type of source control system. But when you’re in the process of just using Subversion to commit a plugin or a theme, you aren’t exactly using source control to its maximum potential.
There’s a lot of really neat, really useful functionality that comes with working with source control systems (and, for the record, I’m more of a fan of Git than Subversion especially when it comes to working with teams).
I won’t rehash all of the benefits that source control brings (because there’s plenty of stuff on the web about it), but if you’re looking to take the next step in your development, then look into using source control.
As I mentioned, I’m personally a fan of Git and I’m a fan of Tower.
2. Diff Tools
If you’re going to be using source control to improve your development workflow, there’s also a chance that you’re going to be working with other people on a codebase. This may be on a team of which you’re already a part of this may be in the form of merging, say, pull requests for one of your projects on GitHub.
Whatever the case, you’re inevitably going to hit what’s called a ‘merge conflict.’ Generally speaking, this happens when you and a peer (or peers) are working on the same file and then commit changes to the same branch or when you’re merging your branches into the same brach.
At this point in the process, the source control system can’t figure out which version to use so it leaves it up to you to grab the parts from each file and, you know, merge them into one.
That is to say that you have the ability to look at all of the version of the file and basically “put together” all of the proper changes into a single instance of a file to be committed to the repository.
I’d argue that this is one of the most important aspects of source control to learn especially because when you’re working on large codebase with a team (of any size), you’re inevitably going to hit merge conflicts.
I’d underscore this with a mention of using branches. Rather than working off of a master branch, each developer should be working in their own branch before merging it back to to the master branch. But, again, that’s just to underscore the importance of knowing how to resolve merge conflicts. Dealing with branches is the topic for another post.
Ah, and as evidenced by the screenshot above, Kaleidoscope is my favorite diff tool.
There Are Other Things
Sure, there are more (and I’m all about seeing them in the comments!) but these are three of the most important things that I think anyone who is getting involved with serious WordPress development should be using in their day-to-day work.
Leave a Reply
You must be logged in to post a comment.