How much percentage of your day would you like to spend on writing Documentation as Software Develoeper? -


How much time do you spend on the documents as a software developer and how much time should you give the ideal document? S I spend a very short time documenting and most of the time "percent of time" is zero.

This is an "old school" question is time and experience proven it Have done that code documentation is not the best use of your resources. Instead, the code should be written to be readable from the beginning - it should be self-documentary. Documentation, which is used less, can be applied to those areas where the underlying logic can not be explained through code

If you know more about the roots of this idea Want - and how to create self-documentation code - reference work Robert C. Martin's. For deep analysis of art (but to pay less attention to coding standards and documents) I also strongly recommend that you get "the Bible":

Update: Here is an example that I What I'm talking about is to say that you want a customer to verify their demographic information (name, birthday, gender, email) in a web app.

Old-school developers can create a page "Verify.aspx" where the page_load pulls the database from the initial database to the demographic and UI controls in the submission submission, they submit some business logic ("Make sure that A new signed email does not dispute with another record email "," first name is not empty, check, "etc.) and then the database parameters Fill rana, a SqlCommand object with a SQL insert statement and execute it. Yuk ... but of course I've seen how many codes. You are likely to be tempted to understand each of these steps so that people will know when you have switched the business logic from UI Logic to DB logic, etc. (Such as "session ID must be set to customer ID").

Now, if your code is broken correctly - in the database, business logic and UI layers - and you have given the names in a clear and clear way, then it will be easier for you to read the code any of my projects How do I handle this task in one: {customer page = (Secure page page) (using {var customer logic = new customer logic} (Fill customer customer = customer logic ); If (customer.Status == fcError.mbInvalidCustomerID) throw a new exception ("invalid customer ID in validity request ..."); CopyCustomerDataToUIFields (customer); }} Safe void SubmitHandler () {var customer = new customer (); Return (CopyUIFieldsToCustomerDataObject (Customer)); (Var customer logic = new customer logic (session)) {customerLogic.Save (customer); If (Customer.Status == fcError.mdDuplicateEmail) {ErrorMessage.Text = "This email is already in the client" + Customer is in use by an ID customer. Sign-In ID; Return; }} Response.Redirect ("Home.aspx"); } Secure Child CopyUIFieldsToCustomerDataObject (customer client) {...} Secure void CopyCustomerDataToUIFields {Customer} {...}

In fact, what's in the document? Do you actually copy all the customer data of customer object in the fields of this :

  // UI, such as CopyCustomerDataToUIFields (customer);  

No! Because your naming conventions are well thought out and your code is at the same level, the documentation is totally unnecessary .

If the next developer wants to know more about this business logic, those customers will open local classes - which are completely separate and self-contained worlds. This kind of division works by the developer at an intangible level in which the logic of his work is clear. Finally, the need for documentation comes dramatically if you follow descriptive naming conventions and avoid the mixing code which implements many levels of nectar.

One last point: Segmentation also facilitates unit testing. This code is a nearly straight lecture of code in a project which I am working on now, so this is not just theory.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -