If two users modify at the same time a standar page, Saleforce respond with a message indicating that this register was modify by other user.
In a visualforce it does not happen. It could be possible to check this in a easy way??
Well, there can be many different options here. You can also use "FOR UPDATE" clause in SOQL statement to retrieve a record and lock it for updates.
We implemented similar requirement around 5-6 yrs back (there have been lots of new features since then). We used to query the record just before saving it and confirm if the last modifieddate of the record is same as it was loaded initially. i.e.
Additionally, you can also build a custom flagging mechanism, wherein you can lock a record and while loading page, you can check if someone has already locked the record (you will need to think through the scenarios wherein some records are displayed as locked falsely)
However, if you're working on projects that might involve more than 1 Developer. You'd probably want to consider Version Control. BitBucket offers free, private repos to do this or you could pay for a private one through GitHub.
It's a good idea to use one of these two methods so you're aware of another developer's changes. Using Salesforce's built in editor is okay up to a point like this, I'm guessing you'll be overwriting one another's changes. Chances are using an IDE like Sublime you'll find you'll code a hell of a lot quicker too.