📜 ⬆️ ⬇️

A bit about teamwork

Once again, by agreeing to a freelance order (after all, I promised myself to finish freelancing once and for all), I sighed heavily, and at the first opportunity, sat down to pour my thoughts onto paper. When we start a new project, we often lack the experience to do it right, sometimes we are just too lazy to learn new technologies, but more often we are confident that we will program everything perfectly, without any VCS, frameworks and migrations. For those who can find the strength to do something more than a bunch of Denwer -> ftp client -> hosting, I have outlined a few recommendations on how to make the process of developing a web application a little more convenient.


Framework


“Let's start with the elementary,” I wanted to write, and I realized that while accepting projects already started by someone, I found frameworks there a few times. Toli I have no luck with my predecessors, toli most programmers try not to use frameworks. I even heard the statement that: “Frameworks are for lammers, I write everything with my hands”. I know at least two reasons why frameworks should be used:
  1. You have an application framework, and a bunch of libraries that make life easier for you and save your time.
  2. Sooner or later, a new programmer will appear in your team, who will join the project much faster if they already know how your application is organized. As a last resort, it will not torture you, but the documentation of the framework, which, again, saves you time.

Personally, I always use one of two frameworks: Zend Framework or CodeIgniter, but this is a matter of taste and personal preference. For these frameworks: CI is much easier in terms of resources, and easier in terms of learning than ZF, but ZF provides much more possibilities. If you have not used frameworks before, and have no idea what MVC is, start with CI.
Well, a small bonus . As you know, the main disadvantage of ZF is its not weak resource requirements. Heavy Zend, it's true. And here, our Chinese colleagues, it occurred to write the Zend Framework in ... C! And they did it, called Yaf, or Yet Another Framework. Written by Yaf in C, and connected to the Apache as a module. Of course, as long as it does not contain all the functionality of ZF, in fact, there is only half of it, moreover, there is documentation in Chinese, there is very little documentation in English, there is no documentation in Russian. Many classes, however, are familiar from ZF, but many are different, and then either study them at random or dig into the C source code. Admittedly, Yaf is really fast, although it makes you nervous in the development process. In general, I advise you only if you become unbearably boring, and you want ... drive chtoli.
Russian documentation for CodeIgniter is here:
http://code-igniter.ru/
Or here:
http://cidocs.ru/210/index.html
And of course, the original on the official website:
http://codeigniter.com/user_guide/

You can read about Zend Framework in English here:
http://framework.zend.com/docs/overview
In Russian here:
http://framework.zend.com/manual/ru /
And, for sure, you will find on it a couple of books in the nearest bookstore.
Yaf documentation can be read here:
http://www.php.net/manual/en/book.yaf.php
And here:
http://www.php.ru/manual/book.yaf.htm l
And for Chinese experts here:
http://yaf.laruence.com/manual/
')

Version control system


Also known as “VCS”, “Version Control System”, “Repository”, “SVN”, “Git” and even “This is the garbage where the main copy of the program is stored.” There are a lot of version control systems, but according to my feelings, I’ll say that the main players are Subversion (SVN) and Git. What to choose? I use Git, but to be honest, SVN also suits me in everything. A lot of blood was shed in the holy wars between supporters of both systems, so the choice is yours. Read the articles online, and try both systems, good, it is very easy to do. There are many on-line services that provide access to repositories. In many you can switch between different VCS. Personally, I use GitHub , which has recently gained unreal popularity. For fans of services from Google, there is the Google code , as well as the once very popular, but now completely cluttered, and a bit slowing sourceforge .
However, it is worth remembering that most services provide only public repositories for free. Which is not bad if you are developing an open source project. For commercial projects, when you do not want to shine the code, you need to pay denyushku.
And yet, a very important nuance. For God's sake, do not commit your config.php to the public repository with real access to the database! Think funny? I've met these ...
Console commands (my choice) are most often used to work with VCS, there are also GUI clients or plug-ins for popular IDEs.
To determine the choice of a particular hosting for your code, you can read a good article “Comparison: Hosting Projects” in the May issue of Linux Format.

A good, very clear Git guide
http://rogerdudler.github.com/git-guide/
Two great git articles
http://habrahabr.ru/post/60030/
http://habrahabr.ru/post/60347/
Well, at github.com itself, the documentation explains everything pretty well.
https://help.github.com/

Database migrations


Oh, who would only know how annoying the “dump.sql” file is! If, at the very least, version control systems for project files are beginning to take root among developers, then version control systems for the database are a rarity (apart from Ruby on Rails).
After all, when several people work on a project, it is quite difficult to make changes to the database structure, they are usually recorded in a special file, and sent to each team member by mail ... This of course works, but firstly: you cannot roll back to a specific version of the database, secondly, never you do not know which of the developers to tear off their hands for the "ingenious" organization of one or another part of the database. I'm not talking about the situation when one of the developers made changes to the database structure locally (for example, via phpmyadmin), and forgot to tell the rest of the team about it. In general, such an approach would have too many bottlenecks, sooner or later, you would have thought without me that there should be another solution. And it certainly is.
What we get using migrations:

Well, etc. These advantages are already worth what to think seriously about the migration system. In CodeIgniter, there is a special class for this, unfortunately, there is nothing like this in the Zend Framework, but I, for example, wrote my own small system (in principle, there is a maximum of one day work). Also, migrations are well represented in doctrine , which I often use together with ZF, and, of course, there are third-party modules .

In addition to the links already laid out above, you can also read the excellent article “ Database Version Control ”.

PS


And finally, rereading the article, I understand that it turned out somewhat crumpled, but I did not try to teach you to program with the help of frameworks, I did not try to teach commits in VCS, and even more so, I did not try to explain all the details of database migrations. I just wanted to tell you about these technologies, show them to you, advise you on what to read, and I hope that I helped someone discover something new for themselves.

Source: https://habr.com/ru/post/147573/


All Articles