How To Write Production Character Code?
We often hither the term "production character code" , unopen to 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 you lot familiar alongside the term but for those who wonder what is production character code inwards uncomplicated damage its code which tin behaviour the seek of fourth dimension inwards a production environment.
We all prepare code inwards development, hence seek inwards QA in addition to hold upwards it gets released inwards production. But at that spot are a lot of divergence betwixt seek in addition to prod in addition to if you lot conduct keep non coded taking prod environs inwards take away heed most probable code volition neglect inwards prod or final result inwards exceptions.So what makes production environs dissimilar than evolution environment? Here are few things which I noted:
1) Production is all close load which volition reveal concurrency issues, charge issues, retentiveness in addition to CPU issues.
2) You volition larn a lot many scenarios inwards production that you lot mightiness conduct keep idea inwards development. If mean value through procedure is non applied than most probable those scenario has non handled inwards production.
3) Different data input or wrong data, i of the classic problems inwards production is the information which gets input to your program, live it from the upstream organisation or whatever other house you lot volition larn all variety of information in addition to if your plan doesn't handgrip those rattling probable it volition suffer.
4) Boundary conditions, this is unopen to what related to higher upwards betoken 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 seek of production than it called a production character code and believe me it takes a lot of experience, science in addition to mean value through procedure to write production character code non simply inwards outset fourth dimension fifty-fifty subsequently 2 or 3 iteration but equally a developer nosotros should ever strive for writing production character code inwards the outset attempt.
Now let's come across how nosotros tin do that, what are the things nosotros should proceed inwards mind:
1) Get your requirements right, sympathize the job , beak to user or delineate of piece of work organisation somebody equally much equally possible this volition assistance you lot to honor dissimilar scenario equally early on equally possible. Many times delineate of piece of work organisation or user does non tell you lot everything it's non their error but it doesn't come upwards inwards take away heed right through. So if you lot are often 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 noesis you, much ameliorate 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 jibe of this when you lot larn to a greater extent than experience. For example, if a user says that you lot demand replay capability inwards your program. You should live able to mean value of all possible scenarios where you lot demand to replay in addition to what could live required for that, what would live a side number of that. Does replay would live requested, what if the requesting organisation went downwards again, volition you lot live able to re replay etc.
3) Boundary condition, ever mean value that you lot volition larn bad input , you lot volition larn zero or empty, small-scale or rattling large numbers, the business office may larn called at the wrong fourth dimension etc. you lot tin larn rid of this past times writing the unit of measurement seek 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 plan concurrently. With the high-speed depression latency electronic trading organisation in addition to alongside many other coffee systems where its requirement to conduct keep a concurrent application this tin alone live addressed past times proper pattern , if you lot larn the pattern right you lot volition rubber other wise you lot volition demand to behaviour the hurting of redesigning or rewriting code. You tin too 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 live able to handgrip an particular scenario inwards clear cutting predefined way. The whole plan should never live crashed due to i unmarried bad input or scenario.
6) Recoverable, code should live able to recover itself inwards the instance of premature closing or crash.
Though these are simply unopen to points which I am able to think, at that spot 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 you lot guys write production character code, what are things you lot guys proceed inwards mind, what questions you lot guys enquire to yourself in addition to to a user ?
Thank you.
Further Learning
How to write ameliorate comments piece coding
Belum ada Komentar untuk "How To Write Production Character Code?"
Posting Komentar