18

I'm really hoping somebody with more experience can edit the question as per my examples of answers:

  • using version control
  • test driven development
  • debugging code (xdebug for php)
  • use of UML diagrams
  • use of OOP for maintainable, reusable code
  • use of frameworks (like Zend Framework for php) for rapid application development

Anything else or an elaboration of what I mentioned above?

Basically, I'm in the middle of forming a team of developers (I'm a developer myself) and I'd like some advice on how professional programmers/designers etc should work together and what standards/paradigms they should use.

Also, if anybody has any books or links on the subject I'd welcome that!

I did find this which I guess satisfies what I'm looking for, or at least part thereof:

http://www.ibm.com/developerworks/websphere/library/techarticles/0306_perks/perks2.html

Nicole
  • 28,111
  • 12
  • 95
  • 143
Damien Roche
  • 880
  • 1
  • 7
  • 20

8 Answers8

8

using version control

SVN is very common, but mercurial is more handsome, powerful and has solid gui support.

test driven development

well, if you do unit testing you're already on the winning side. for tools, it's a matter of choice. testing has to be as easy as possible, thats the reason why i ditched PHPUnit for SimpleTest.

debugging code

with unit tests you will hardly need xdebug. i use xdebug usually for profiling only. (check out KCachegrind btw)

use of UML diagrams

the biggest problem with everything that reflects code logic is that it is a lot of manual work to keep in sync. you can automate some tasks, but it's not that useful, because you usually wanna use uml before you have anything. the other problem is that diagram tools are much harder to use than pen and paper or a whiteboard. use uml if you have to communicate a problem with multiple developers or if you need an abstraction for yourself. ("dia" is a nice free tool. also mind mapping tools are very handy for brainstorming, some can actually compete with pen and paper.)

use of OOP for maintainable, reusable code

well, oop works out to some degree. :) one good advice: composition > inheritance. inheritance is an powerful tool to reuse on the first sight, but maintenance and loose coupling will suffer for it. second good advice: maintenance > reuse. an abstract system can be very powerful, but also hard to maintain.

use of frameworks (like Zend Framework for php) for rapid application development

RAD is a good thing to get your app out early. but some components - especially ORM - will shoot your feet, at least if it comes to scalability. the major problem here is that you tie your domain logic to work with objects, which becomes very hard to factor out if you need a pure scalable database optimized solution. be aware of that and encourage your developers to utilize the database without high level abstraction layers. database abstraction is a myth, orm is a lie.

KISS

newcomers usually wanna apply all those best practices around, set up coding standards, use all the nice tool chains, whatever. it works out for some developers, but some will run into an mental blockade if things a too strict. unit testing and scm is really a must have, but someone new to unit testing really needs to learn it's value before he loves it. don't overdo, apply practices step by step and see how it works out. KISS also boils down to code. sometimes the best way to solve a hard problem, is to solve it wrong. you need a six degrees of separation algorithm? just choose some friends at random. you can create a complete application around it, with wrong logic. if the customer eventually decides to to ditch it, everyone saved a lot of money.

agile

learn about agile methodologies, extreme programming, scrum, etc. there are many books out there. any book will make your team better, but it's the best to get every teammate into it.

alan blaire
  • 346
  • 1
  • 2
  • 1
    Fantastic answer! Thanks. +150 rep for you sir! Feel free to add anything else to the post as will feature at the top of the page under the question. Things like @TODO in code, commenting and documentation software etc – Damien Roche Dec 27 '10 at 18:40
2
  • Version Control: If on windows, TortoiseSVN is the best, most intuitive and easiest to use in my experience.

  • Framework: CodeIgniter. Hands on the best web development platform for PHP.

  • IDE: Netbeans is the best IDE for PHP that I've used on windows.

  • Unit Testing: There are several options, a google search will turn up many. CodeIgniter also has its own unit tester available.

  • Debugger: Xdebug.

  • Javascript Library: Jquery

  • FTP Program: FileZilla

  • Database Administration: PhpMyAdmin

  • Wireframing: Balsimus Mockup, or use a whiteboard.

  • Misc: Use WAMP if on windows to easily install, start, stop, & restart apache, mysql, and php all in one package.

Also, if you are going to be a working on many different websites, and most of those websites will have some common functions like signup, login/logout, an admin section for searching users, etc, I recommend building a small project in whichever framework you choose, and using that project as the base for every new project that you start. Normally I call this project 'skeleton'. If I'm going to start working on xyz.com, I would copy skeleton directory and rename it as 'xyz.com', fill in some configuration files, and I'd have a copy of xyz.com with some of the features already working.

Click Upvote
  • 2,707
  • 3
  • 26
  • 34
  • 1
    After reading this post and seeing I already use several of the recommended items I've decided to try the Netbeans IDE. Can anyone recommend any plugins that would be worthwhile using with it for PHP/Codeigniter development? Also, can it work well with Wampserver? – Gortron Dec 21 '10 at 11:23
  • 1
    @Gortron I use netbeans with codeigniter. There is an autocomplete tool for codeigniter/netbeans: http://rhasan.com/blog/2009/09/codeigniter-auto-complete-with-netbeans/ PHP is really a unix language at heart and developing on a linux virtual machine is a good idea. Also avoid subversion, it's 2010 use something distributed (git, hg, bzr). http://hginit.com/ – Benbob Dec 22 '10 at 01:32
  • `Framework: CodeIgniter. Hands on the best web development platform for PHP.` This, quite frankly is bullshit. If you've ever used symfony, rails or django you will see some major problems. There is no modular directory structure, no command line interface. Then you have core components like forms and models taking up a lot of code. If you know any software patterns at all you'll see that codeigniter sucks big time. At the very least use Kohana, which is CI forked and done properly after the community died. – Benbob Dec 22 '10 at 01:40
  • If you're on Windows, I would recommend SQLyog (they have a [community edition](http://code.google.com/p/sqlyog/)) instead of phpMyAdmin. I've never found a decent replacement for SQLyog on Linux, which is a shame... – Dean Harding Dec 22 '10 at 03:33
  • 1
    @keyo, Thank you for the link. I have added the autocomplete tool to Netbeans, very handy for a project with a lot of functions in the models. I Don't think I'll change from SVN just yet, I'm only an army of 1, no need for distributed systems at the moment I think. – Gortron Dec 22 '10 at 22:38
2

I agree mostly with Click Upvote's post, however if you're working on a relatively large site I would definitely recommend using Symfony framework coupled with the Doctrine ORM.

If you're project is due next year, I would say take the time to invest in Symfony2 and Doctrine2.

Also, I can't stress enough the importance of developing on unix based system, Ubuntu is my preference and an all around great web server. I work primarily on windows but develop on Ubuntu running in a VMWare virtual machine on my desktop (or server when I'm at work).

As for IDE I highly recommend using NuSphere PHPEd or Storm PHP, sadly like all great things they are not free.

xzyfer
  • 121
  • 3
0

Use of UML diagram is nice but is entirely optional. Any diagrams would do as long as your team understand what they mean. Trying to use standard no-one really knows well may lead to issues and lost time.

I would recommend to start each page from a mockup (http://balsamiq.com) or have your designer to draw it for you. Don't expect developers to be good at visual aesthetics and create good pages out of nowhere.

Have someone assigned to code-review duty, if you have several seniour team members - make them do reviews in rotation (Review Board)

Ilya Kochetov
  • 197
  • 2
  • 4
0

When dealing with collaborative work you need:

• using version control: i think that Git or Subversion will work out quite smooth

• test driven development: I'm starting to learn this is a must,but dont take it to extremes

• debugging code (xdebug for php): xdebug is my choice

• use of UML diagrams: This helps when everyones has a working knowledge on OO Programming and DesignPatterns, nevertheless it's always a good practice

• use of OOP for maintainable, reusable code: And FLEXIBILITY, i think this is the key aspect of OOP.

• use of frameworks (like Zend Framework for php) for rapid application development: My Advise is SYMFONY, the first php framework (aint a toolkit). It has a very big commnunity, lots of documentation, and its entirely implemented on php. I've been working with it for a year and it totally binds with OOP

• you may also need a system to track bugs, feature requests, etc. like: Mantis or Track . This sistems are quite easy and straightforward. They also let you bind your subversion and related your commits to certain features or bugs people post.

Finally, it's always important if your going to be leading a dev-team to make small meeting periodically so everyone knows the status of the system at a certain point and maybe that way you'll be capable of planning or see how things are working.

In my company i have to send an email every day telling what i've been working on and if there where any complications.

Best of luck!

guiman
  • 2,088
  • 13
  • 17
0
  • Framework: codeigniter, with no doubt. It has all the functionalities you might ever need, and does not force you to use any of them unless you do need them;
  • Version control, IDE: I'm pretty old-school, and I don't think my answer could really help you;
  • Wireframing, UML: old school in this too, but really: whiteboards win. They're flexible, extensible, and support any convention you might see fit;
  • Database administration: phpmyadmin;
  • Development server OS: I might be banal, but: Ubuntu. Install a LAMP server in seconds; don't panic about adding new libraries (the dreaded imagick: one command, done); if you like PHP you'll probably end up working on linux server in production so it's better to start practicing. (Disclaimer: Ubuntu is not my favorite distribution).
  • Misc: grep can be incredibly useful when debugging other poeople's code (wanna know how many controllers use a given model? Done!).

edit

I forgot the most important thing: specs. Write real specs for your project before touching any code. Have all the user interaction diagrams in mind. It will save you centuries.

cbrandolino
  • 1,999
  • 1
  • 18
  • 21
0

Version Control Since you're working in a team it's in your best interest that you go with something distributed. Your candidates are Git and Mercurial. This means your team can commit locally without breaking the project, but still track their work, then push these commits to the central server. It's also much faster and has fewer merge conflicts since the code is tracked as change sets rather than revisions. Read though the hginit guide (written by the co-founder of stack overflow no less) and you'll understand a bit more about what a DVCS is.http://hginit.com/

You should also use the repository for deployment instead of rsync or ftp.

Test Driven Development Depending on what you are doing testing can waste a lot of time. I'm not saying you should completely skip it, for smaller projects it's overhead. If you are writing a library or large long-term project, sure write tests for it. The tests will help in the maintenance phase. Be aware that TDD can't find all your bugs. There will be user experience problems, layout problems, performance problems and so on.

Debugging Xdebug is basically your only choice here. It integrates well with Netbeans. If you feel the need to ever print variables out you should use a log file. Use the frameworks log function, this is much safer in production.

Planning / Diagrams If you are using a good framework you shouldn't need to make detailed diagrams too much. Keep it simple and work in shorter release cycles, it's easy to over-plan. The requirements and specifications of a project are bound to change so I wouldn't spend all your time on them. Remember that code IS specification at the most detailed level.

Use your bug tracking tool (see below) to break the specification up into tasks which you can assign to team members. Use a central tool to document the projects, the bug tracker will probably have a wiki.

You can use a tool like Mysql Workbench to design database schemas in diagrams and export them as SQL.

Frameworks and OOP This is probably the most important part. Find yourself a popular framework which will support rapid development and code reuse. Some people won't like me saying this, but a framework should dictate the way you work. It should provide structure so one developer can switch project and know exactly where the controller for a certain page is, exactly what the template variables are and how to query the model. Some frameworks allow too much flexibility here and you'll find that developers don't always use the framework in the same way. I like the python philosophy; there should be one obvious way to do everything. This is why I like django and rails, they are quite opinionated and this means I can look at someone elses code and understand what it does. Symfony looks like the best option here, but I would checkout Rails (Ruby) and Django (python) anyway, it might be exactly what you need.

There are many 'what framework' questions on stack overflow like this one: https://stackoverflow.com/questions/2648/what-php-framework-would-you-choose-for-a-new-application-and-why

Bug Tracking Get your team a good bug tracker which is made for developers. Don't use something over simplified like basecamp. Redmine and Unfuddle are two examples of excellent bug trackers, they can also track time and integrate with your repositories. Your team should use this tool to communicate on issues rather than email or IM. It makes it easier for a new developer when there is an existing history of bugs and docs available. This article explains exactly what any good bug tracker needs to do and why. http://www.joelonsoftware.com/articles/fog0000000029.html

Benbob
  • 1,216
  • 9
  • 22
0

I'd recommend looking at Bazaar for version control. Compared to Git it has the major advantage that it is actually easy to use and install on Windows, Mac OS and Linux. Also the bzr commands are very similiar to it's svn counterparts, therefore somebody who has worked with Subversion before can easily use Bazaar without to much of a learning curve. I'm looking at you Git.

Apart from that I am a strong believer in don't force anything on your developers. That beeing said let them use the IDE, operating system and so on that they prefer.

Apart from that I strongly recommend you do wirte tests for all your code, no matter how tedious that is.

The decision for or against a framework imho isn't something you can do based on recommendations made here. I suggest you list the ones that look promising to you based on their features and then write a small test app in every one of them. (Write the same one each time.)

pst
  • 101
  • 1