How To Write Production Character Code?

We often hither the term "production lineament code" , closed to times inward interview where interviewee asked to write production lineament code for a particular function,sometimes tidings betwixt developers in addition to programmers in addition to sometimes during code review. I know most of you lot familiar alongside the term but for those who wonder what is production lineament code inward uncomplicated damage its code which tin behaviour the attempt out of fourth dimension inward a production environment.

We all railroad train code inward development, thence attempt out inward QA in addition to in conclusion it gets released inward production. But in that place are a lot of deviation betwixt attempt out in addition to prod in addition to if you lot conduct maintain non coded taking prod surroundings inward heed most probable code volition neglect inward prod or termination inward exceptions.So what makes production surroundings dissimilar than evolution environment? Here are few things which I noted:

1) Production is all nearly load which volition divulge concurrency issues, charge issues, retentiveness in addition to CPU issues.

2) You volition larn a lot many scenarios inward production that you lot mightiness conduct maintain idea inward development. If intend through procedure is non applied than most probable those scenario has non handled inward production.

3) Different data input or wrong data, 1 of the classic problems inward production is the information which gets input to your program, live on it from the upstream organisation or whatever other house you lot volition larn all form of information in addition to if your programme doesn't grip those real probable it volition suffer.

4) Boundary conditions, this is closed to what related to higher upward bespeak information in addition to scenarios but most of the boundary status e.g. null, empty etc exposed inward production.



So if a code is written all these things in addition to potentially domain specific things in addition to tin sustain attempt out of production than it called a production lineament code and believe me it takes a lot of experience, science in addition to intend through procedure to write production lineament code non merely inward commencement fourth dimension fifty-fifty later 2 or 3 iteration but every bit a developer nosotros should ever strive for writing production lineament code inward the commencement attempt.

Now let's come across how nosotros tin do that, what are the things nosotros should croak on inward mind:

1) Get your requirements right, empathise the occupation , verbalize to user or occupation organisation mortal every bit much every bit possible this volition assistance you lot to detect dissimilar scenario every bit early on every bit possible. Many times occupation organisation or user does non tell you lot everything it's non their mistake but it doesn't come upward inward heed right through. So if you lot are ofttimes speaking, discussing in addition to presenting solution to them most probable they volition inquire questions, give feedback which eventually divulge to a greater extent than scenario in addition to subtle details. Here sense plays an of import role. More sense or domain noesis you, much improve code you lot volition write.

2) Think through, Think through in addition to Think through. There is no substitute of this, it is to a greater extent than of a science in addition to fine art than scientific discipline but you lot volition larn concur of this when you lot larn to a greater extent than experience. For example, if a user says that you lot demand replay capability inward your program. You should live on able to intend of all possible scenarios where you lot demand to replay in addition to what could live on required for that, what would live on a side consequence of that. Does replay would live on requested, what if the requesting organisation went downwardly again, volition you lot live on able to re replay etc.

3) Boundary condition, ever intend that you lot volition larn bad input , you lot volition larn zero or empty, pocket-size or real large numbers, the business office may larn called at the wrong fourth dimension etc. you lot tin larn rid of this yesteryear writing the unit of measurement attempt out for each boundary condition.

4) Concurrency, this is is the major culprit in addition to large occupation which exposes itself inward production when due to charge multiple threads gets triggered in addition to access your programme concurrently. With the high-speed depression latency electronic trading organisation in addition to alongside many other coffee systems where its requirement to conduct maintain a concurrent application this tin alone live on addressed yesteryear proper blueprint , if you lot larn the blueprint right you lot volition condom other wise you lot volition demand to behaviour the hurting of redesigning or rewriting code. You tin besides divulge concurrency number yesteryear doing charge testing inward early on QA cycles.

5) Exception handling, this is the yesteryear far most of import feature of production lineament code, it must live on able to grip an especial scenario inward clear cutting predefined way. The whole programme should never live on crashed due to 1 unmarried bad input or scenario.

6) Recoverable, code should live on able to recover itself inward the instance of premature closing or crash.

Though these are merely closed to points which I am able to think, in that place are lots to a greater extent than in addition to it’s a constant procedure of improving yourself in addition to I ever strive for this. Please percentage how you lot guys write production lineament code, what are things you lot guys croak on inward mind, what questions you lot guys inquire to yourself in addition to to a user ?

Thank you.

Further Learning
How to write improve comments acre coding

0 Response to "How To Write Production Character Code?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel