How To Write Production Character Code?

Advertisement

Masukkan script iklan 970x90px

How To Write Production Character Code?

Sabtu, 18 Juli 2020

We often hither the term "production character code" , to a greater extent than or less times inwards interview where interviewee asked to write production character code for a particular function,sometimes intelligence betwixt developers in addition to programmers in addition to sometimes during code review. I know most of y'all familiar alongside the term but for those who wonder what is production character code inwards elementary damage its code which tin comport the essay of fourth dimension inwards a production environment.

We all educate code inwards development, in addition to hence essay inwards QA in addition to in conclusion it gets released inwards production. But at that topographic point are a lot of deviation betwixt essay in addition to prod in addition to if y'all induce got non coded taking prod environs inwards hear most probable code volition neglect inwards prod or outcome inwards exceptions.So what makes production environs dissimilar than evolution environment? Here are few things which I noted:

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

2) You volition teach a lot many scenarios inwards production that y'all powerfulness induce got idea inwards development. If intend through procedure is non applied than most probable those scenario has non handled inwards production.

3) Different data input or wrong data, 1 of the classic problems inwards production is the information which gets input to your program, last it from the upstream organisation or whatever other house y'all volition teach all form of information in addition to if your programme doesn't handgrip those rattling probable it volition suffer.

4) Boundary conditions, this is to a greater extent than or less what related to to a higher house signal information in addition to scenarios but most of the boundary status e.g. null, empty etc exposed inwards production.



So if a code is written all these things in addition to potentially domain specific things in addition to tin sustain essay of production than it called a production character code and believe me it takes a lot of experience, science in addition to intend through procedure to write production character code non only inwards get-go fourth dimension fifty-fifty afterwards ii or 3 iteration but equally a developer nosotros should ever strive for writing production character code inwards the get-go attempt.

Now let's run across how nosotros tin do that, what are the things nosotros should croak along inwards mind:

1) Get your requirements right, empathise the job , beak to user or trace of piece of work organisation someone equally much equally possible this volition deal y'all to detect dissimilar scenario equally early on equally possible. Many times trace of piece of work organisation or user does non tell y'all everything it's non their error but it doesn't come upwards inwards hear right through. So if y'all are oft speaking, discussing in addition to presenting solution to them most probable they volition enquire questions, give feedback which eventually reveal to a greater extent than scenario in addition to subtle details. Here sense plays an of import role. More sense or domain cognition you, much improve code y'all 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 y'all volition teach lucifer of this when y'all teach to a greater extent than experience. For example, if a user says that y'all demand replay capability inwards your program. You should last able to intend of all possible scenarios where y'all demand to replay in addition to what could last required for that, what would last a side outcome of that. Does replay would last requested, what if the requesting organisation went downwards again, volition y'all last able to re replay etc.

3) Boundary condition, ever intend that y'all volition teach bad input , y'all volition teach zero or empty, modest or rattling large numbers, the business office may teach called at the wrong fourth dimension etc. y'all tin teach rid of this past times writing the unit of measurement essay for each boundary condition.

4) Concurrency, this is is the major culprit in addition to large job which exposes itself inwards 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 induce got a concurrent application this tin alone last addressed past times proper blueprint , if y'all teach the blueprint right y'all volition prophylactic other wise y'all volition demand to comport the hurting of redesigning or rewriting code. You tin likewise reveal concurrency number past times doing charge testing inwards early on QA cycles.

5) Exception handling, this is the past times far most of import feature of production character code, it must last able to handgrip an especial scenario inwards clear cutting predefined way. The whole programme should never last crashed due to 1 unmarried bad input or scenario.

6) Recoverable, code should last able to recover itself inwards the instance of premature closing or crash.

Though these are only to a greater extent than or less points which I am able to think, at that topographic point 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 part how y'all guys write production character code, what are things y'all guys croak along inwards mind, what questions y'all guys enquire to yourself in addition to to a user ?

Thank you.

Further Learning
How to write improve comments spell coding