GUI Programming COMP 445
Popular in Course
Popular in ComputerScienence
This 2 page Class Notes was uploaded by Ashlynn Bergstrom on Monday October 12, 2015. The Class Notes belongs to COMP 445 at Harding University taught by Frank McCown in Fall. Since its upload, it has received 27 views. For similar materials see /class/222130/comp-445-harding-university in ComputerScienence at Harding University.
Reviews for GUI Programming
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/12/15
Tips to Writing Clean Code Funcfions Capnahzethehm e evo eaohwovdmthemnohon ampe PrlntH vs Prmtstudentmstu q q A u q A w m onemnonon vs amnonons whph penovm each loose aouons pavametev hs pweoes uno on s veaHy domg Coda Use p enty 0Q whne space to o amy code Pm s1atemems endmg WM sembo ons and n on sepavate hnes excep coy oops for mandam vs for u o 1 lt 5 w aoutltlt39r 3373 lt com ltlt 1 v 3 J 1 s 339 Variablas Consfanfs Cave tuohosenvaHab enamesandoons amswwHo enbesehdooumemmg Examea a e b vs score ssseussmss e psmssgmssed Dec ave aHvaHab es at thetop 0Q themnouon ahhoughmmahngtoaoonstamwsaooep ab e ampe 1m 1 sqrtlb vs 1m 1 o Commem me puvpose 0Q each vanab e deo avauon Exampeeonsc nt mags 4 and In hemogsmdems 20 Use u u H u m 9 Hump Documentation Write comments that express more of the whythan the how Document the codes intent Example Divide total grades by total students VS Compute student grade average Always place your name date and program description at the top of the program Make your comments say something about the code that the code can t say about itself Example level Add 1 to level VS level Advance to next level before processing remaining lives Typically a comment should refer to a logical grouping of lines rather than a single line of code Avoid all but the most common abbreviations in comments so they re easy to read Clearly separate comments from code Use a commenting style that is not overly tedious timeconsuming or a maintenance monster Outline your code with comments before you write it rather than doing all of the documentation at the end You ll save yourself time from having to figure out tricky places or forgetting details assumptions and subtleties of design Error Checking Give user useful feedback in error messages and don t scare user away with harsh or ambiguous messages Example Illegal value VS Please enter a number between 1 and 10 Ensure code is free of potential runtime errors like division by 0 strcpystrcat with a NULL string accessing arrays out of bounds etc Dummyproof your programs by making them as robust as possible All input which is received from an external source should be validated Example Making sure a number entered was between 110 or ensuring an inputfile exists before trying to read from it
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'