Poll Summary

Number Of Votes Cast
86168
Overall Acceptance Rates
Choice Number Percentage
Yes 54718 0.635015318911893
No 19400 0.22514158388264785
Undecided 12050 0.1398430972054591

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 0.6185567010309279 0.17929179740026893 0.20215150156880324 2231
Always maintain HttpSessions 0.71875 0.16875 0.1125 160
Beware multilingual submit buttons 0.6395348837209303 0.20348837209302326 0.1569767441860465 172
Beware of common hacks 0.8449612403100775 0.07751937984496124 0.07751937984496124 129
Beware of custom cookies 0.7767857142857143 0.07142857142857142 0.15178571428571427 112
Beware of doubly escaped ampersands 0.7692307692307693 0.1282051282051282 0.10256410256410256 78
Beware of URL rewriting 0.6243093922651933 0.22099447513812154 0.15469613259668508 181
Choose form validation style carefully 0.7131147540983607 0.18032786885245902 0.10655737704918032 122
Consider Controllers for redirects 0.475 0.25 0.275 40
Do not synchronize doGet, doPost 0.6894409937888198 0.19751552795031055 0.11304347826086956 805
Emit flexible URLs 0.746268656716418 0.07462686567164178 0.1791044776119403 67
Escape special characters 0.5860517435320585 0.296962879640045 0.11698537682789652 889
Forward versus redirect 0.7203994293865906 0.1355206847360913 0.14407988587731813 701
JSPs should contain only presentation logic 0.8766519823788547 0.06167400881057269 0.06167400881057269 227
Loss of data during restart 0.6698113207547169 0.14150943396226415 0.18867924528301888 106
Manage sessions closely 0.8026315789473685 0.10526315789473684 0.09210526315789473 152
Measure web app performance 0.865979381443299 0.07731958762886598 0.05670103092783505 194
Minimize site response time 0.7368421052631579 0.1368421052631579 0.12631578947368421 95
Parse parameters into domain objects 0.4 0.32 0.28 25
Pre-populate forms 0.46078431372549017 0.3431372549019608 0.19607843137254902 102
Prefer JSTL tags 0.7450980392156863 0.14705882352941177 0.10784313725490197 204
Prefer UTF-8 in all layers 0.7935483870967742 0.0967741935483871 0.10967741935483871 155
Prevent self-linking 0.39285714285714285 0.5357142857142857 0.07142857142857142 28
Refactor large Controllers 0.8 0.1 0.1 20
Repel invalid requests 0.76 0.12 0.12 25
Reuse login page for errors 0.6903553299492385 0.17766497461928935 0.1319796954314721 197
Send trouble-ticket emails 0.5454545454545454 0.18181818181818182 0.2727272727272727 22
Serve binary content 0.5949367088607594 0.21518987341772153 0.189873417721519 79
Session-scope objects often Serializable 0.7364341085271318 0.13953488372093023 0.12403100775193798 129
Struts seems mediocre 0.4326923076923077 0.3894230769230769 0.1778846153846154 208
Thread-safety in web apps 0.7457627118644068 0.15593220338983052 0.09830508474576272 295
Understand details of FORM tags 0.7941176470588235 0.08823529411764706 0.11764705882352941 34
Use Cascading Style Sheets 0.7226890756302521 0.17647058823529413 0.10084033613445378 119
Use extensions for fine-grained security 0.5306122448979592 0.3469387755102041 0.12244897959183673 49
Use Model-View-Controller framework 0.8909657320872274 0.03426791277258567 0.07476635514018691 321
Use templates to standardize layout 0.4727272727272727 0.4 0.12727272727272726 55
Validate email addresses 0.4348958333333333 0.4166666666666667 0.1484375 384
Validate generated HTML 0.711764705882353 0.14705882352941177 0.1411764705882353 340
Web usability guidelines 0.8378378378378378 0.05405405405405406 0.10810810810810811 37
Wrap file upload requests 0.4696969696969697 0.25757575757575757 0.2727272727272727 66
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 0.684596577017115 0.16136919315403422 0.15403422982885084 409
Actions 0.6979166666666666 0.20833333333333334 0.09375 96
Align menu items 0.6597938144329897 0.20618556701030927 0.13402061855670103 97
Change theme 0.6666666666666666 0.1836734693877551 0.14965986394557823 147
Consider JGoodies Forms for layouts 0.6974789915966386 0.07563025210084033 0.226890756302521 119
Don't bury dialogs 0.6666666666666666 0.14814814814814814 0.18518518518518517 27
Don't subclass JDialog or JFrame 0.3067484662576687 0.4110429447852761 0.2822085889570552 163
Filter table rows 0.5 0.3888888888888889 0.1111111111111111 18
Input dialogs 0.5348837209302325 0.2558139534883721 0.20930232558139536 43
Launch other applications 0.7333333333333333 0.26666666666666666 0.0 30
Layout Managers 0.636 0.228 0.136 250
Look and Feel guidelines 0.8541666666666666 0.08333333333333333 0.0625 48
Minimal Swing application 0.5909090909090909 0.25 0.1590909090909091 132
Observers and listeners 0.4563106796116505 0.2961165048543689 0.24757281553398058 206
Preferences dialogs 0.46875 0.15625 0.375 32
Provide an uncaught exception handler 0.6060606060606061 0.21212121212121213 0.18181818181818182 132
Render table cells 0.6655629139072847 0.17218543046357615 0.16225165562913907 302
Sort table rows 0.4430379746835443 0.3037974683544304 0.25316455696202533 79
Splash screen 0.5664556962025317 0.3037974683544304 0.12974683544303797 316
Standardized dialogs 0.5555555555555556 0.3333333333333333 0.1111111111111111 27
Swing in general 0.75 0.08333333333333333 0.16666666666666666 36
Swing threads 0.5662650602409639 0.2289156626506024 0.20481927710843373 166
Swing utility tasks 0.775 0.125 0.1 40
Timers 0.3233082706766917 0.48872180451127817 0.18796992481203006 133
Using JavaHelp 0.5319148936170213 0.2872340425531915 0.18085106382978725 94
Using preferences 0.44776119402985076 0.31343283582089554 0.23880597014925373 67
Verify input with Model Objects 0.6363636363636364 0.18181818181818182 0.18181818181818182 11
Verify input with regular expressions 0.4358974358974359 0.3333333333333333 0.23076923076923078 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 0.4368932038834951 0.32038834951456313 0.24271844660194175 412
Avoid empty catch blocks 0.8213166144200627 0.11285266457680251 0.06583072100313479 319
Be specific in throws clause 0.6066176470588235 0.3235294117647059 0.06985294117647059 272
Beware of unknown root causes 0.36666666666666664 0.26666666666666666 0.36666666666666664 30
Checked versus unchecked exceptions 0.5158680771624145 0.2806471686372122 0.20348475420037337 1607
Exception translation 0.9147286821705426 0.05426356589147287 0.031007751937984496 129
Exceptions and control flow 0.6954022988505747 0.16091954022988506 0.14367816091954022 174
Finally and catch 0.6600361663652803 0.19710669077757687 0.14285714285714285 553
Javadoc all exceptions 0.5584415584415584 0.23376623376623376 0.2077922077922078 154
Pass all pertinent data to exceptions 0.9444444444444444 0.015873015873015872 0.03968253968253968 126
Stack trace as String 0.7630853994490359 0.1487603305785124 0.0881542699724518 726
Use template for repeated try-catch 0.6588235294117647 0.11764705882352941 0.2235294117647059 85
Input-OutputYesNoUndecidedVotes
Always close streams 0.7443820224719101 0.14606741573033707 0.10955056179775281 356
Buffering usually appropriate 0.8611111111111112 0.05555555555555555 0.08333333333333333 72
Console input 0.5296167247386759 0.2961672473867596 0.17421602787456447 287
Copy a file 0.6818181818181818 0.21818181818181817 0.1 110
Reading and writing binary files 0.49019607843137253 0.27450980392156865 0.23529411764705882 306
Reading and writing Serializable objects 0.5680628272251309 0.2591623036649215 0.17277486910994763 382
Reading and writing text files 0.6056426332288402 0.22570532915360503 0.16865203761755485 3190
DatabasesYesNoUndecidedVotes
Business identifiers as String 0.8295819935691319 0.10610932475884244 0.06430868167202572 311
Connection pools 0.8680555555555556 0.0625 0.06944444444444445 288
Consider data layer tools 0.5853658536585366 0.1951219512195122 0.21951219512195122 41
Consider using standard SQL 0.693069306930693 0.1782178217821782 0.12871287128712872 101
Consider wrapper classes for optional data 0.7681159420289855 0.13043478260869565 0.10144927536231885 69
Data access objects 0.6395759717314488 0.19434628975265017 0.16607773851590105 283
Data exception wrapping 0.7241379310344828 0.15517241379310345 0.1206896551724138 58
Data is king 0.875 0.0625 0.0625 112
Don't perform basic SQL tasks in code 0.8493150684931506 0.0821917808219178 0.0684931506849315 73
Encapsulate connections 0.8043478260869565 0.06521739130434782 0.13043478260869565 46
Keep SQL out of code 0.5392670157068062 0.3193717277486911 0.14136125654450263 191
Prefer PreparedStatement 0.8955223880597015 0.04477611940298507 0.05970149253731343 67
Reduce database code duplication 0.9032258064516129 0.03225806451612903 0.06451612903225806 31
Remember the basics of database design 0.873015873015873 0.06349206349206349 0.06349206349206349 63
Simplify database operations 0.5 0.3 0.2 20
Try pseudo-persistence for mock ups 0.6296296296296297 0.25925925925925924 0.1111111111111111 27
Use template for transactions 0.6842105263157895 0.05263157894736842 0.2631578947368421 19
CollectionsYesNoUndecidedVotes
Choosing the right Collection 0.8158890290037831 0.08827238335435057 0.09583858764186633 793
Encapsulate collections 0.8131313131313131 0.06565656565656566 0.12121212121212122 198
Iterate without an index 0.7728706624605678 0.17034700315457413 0.056782334384858045 317
Prefer Collections over older classes 0.8429752066115702 0.05785123966942149 0.09917355371900827 121
Two ways of using Iterator 0.6090479405806887 0.24037812288993923 0.15057393652937204 1481
Use for-each liberally 0.7619047619047619 0.15079365079365079 0.0873015873015873 252
Use interface references to Collections 0.6974789915966386 0.19327731092436976 0.1092436974789916 119
Use standard Collections 0.8253968253968254 0.0582010582010582 0.1164021164021164 189
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 0.41947565543071164 0.3464419475655431 0.2340823970037453 534
Implementing compareTo 0.5037974683544304 0.3341772151898734 0.1620253164556962 395
Implementing equals 0.5924764890282131 0.2727272727272727 0.13479623824451412 319
Implementing hashCode 0.5555555555555556 0.2671957671957672 0.17724867724867724 378
Implementing toString 0.4976303317535545 0.3056872037914692 0.1966824644549763 422
Never rely on finalize 0.7263157894736842 0.15789473684210525 0.11578947368421053 95
Common TasksYesNoUndecidedVotes
Arrays as String 0.47038327526132406 0.3554006968641115 0.17421602787456447 287
Clipboard copy and paste 0.7760217983651226 0.1335149863760218 0.09046321525885559 1835
Command line operations 0.45484949832775917 0.38461538461538464 0.1605351170568562 299
Compare and sort Strings 0.5104166666666666 0.3402777777777778 0.14930555555555555 288
Copy an array 0.5875 0.29375 0.11875 640
Determine if Strings are equal 0.6704545454545454 0.24242424242424243 0.08712121212121213 528
Examine bytecode 0.5111111111111111 0.37777777777777777 0.1111111111111111 45
Fetch web page and header 0.6435331230283912 0.2082018927444795 0.14826498422712933 317
Generate random numbers 0.6113847396043601 0.263786838918046 0.12482842147759386 12385
Get database connection 0.551440329218107 0.2831275720164609 0.1654320987654321 1215
Get size of object in memory 0.39502762430939226 0.43922651933701656 0.16574585635359115 362
Implement code tables 0.5714285714285714 0.23214285714285715 0.19642857142857142 56
Internationalization 0.5076923076923077 0.2923076923076923 0.2 65
Logging messages 0.6040709126723572 0.22521339461588968 0.17071569271175313 1523
Measure application performance 0.7719298245614035 0.14035087719298245 0.08771929824561403 57
Modernize old code 0.8813559322033898 0.06779661016949153 0.05084745762711865 59
Open file in native directory 0.5555555555555556 0.3333333333333333 0.1111111111111111 9
Parse text 0.6057401812688822 0.2175226586102719 0.17673716012084592 662
Pattern-match lines of a file 0.5642023346303502 0.2801556420233463 0.1556420233463035 257
Read jar version information 0.5625 0.34375 0.09375 96
Recovering resources 0.8529411764705882 0.08823529411764706 0.058823529411764705 34
Recursive file listing 0.7322551662174304 0.16172506738544473 0.10601976639712489 1113
Replace a substring 0.5822784810126582 0.29873417721518986 0.1189873417721519 395
Representing money 0.745697896749522 0.11663479923518165 0.13766730401529637 523
Send an email 0.551857211770381 0.23733719247467439 0.21080559575494454 2073
Time execution speed 0.706766917293233 0.21052631578947367 0.08270676691729323 133
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 0.6987951807228916 0.16265060240963855 0.13855421686746988 166
Command objects 0.55 0.2 0.25 20
Factory methods 0.6216897856242118 0.21437578814627994 0.16393442622950818 793
Immutable objects 0.8135593220338984 0.09491525423728814 0.09152542372881356 1180
Lazy initialization 0.7593582887700535 0.13368983957219252 0.10695187165775401 187
Model Objects 0.6166666666666667 0.15833333333333333 0.225 120
Plugin Factory 0.6896551724137931 0.10344827586206896 0.20689655172413793 29
Private constructor 0.7374301675977654 0.1430167597765363 0.11955307262569832 895
Singleton 0.729903536977492 0.17041800643086816 0.09967845659163987 311
Template method 0.711864406779661 0.22033898305084745 0.06779661016949153 59
Type-Safe Enumerations 0.8005181347150259 0.10880829015544041 0.09067357512953368 386
Wrapper (Decorator) 0.574468085106383 0.2872340425531915 0.13829787234042554 94
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 0.8547008547008547 0.06837606837606838 0.07692307692307693 117
Avoid raw types 0.7772727272727272 0.14545454545454545 0.07727272727272727 220
Beware of instanceof operator 0.6138933764135702 0.23263327948303716 0.15347334410339256 1857
Class for constants 0.6395881006864989 0.2334096109839817 0.12700228832951946 874
Construct classes from the outside in 0.9117647058823529 0.058823529411764705 0.029411764705882353 68
Do not break portability 0.7466666666666667 0.18666666666666668 0.06666666666666667 75
Don't declare local variables before use 0.554006968641115 0.2613240418118467 0.18466898954703834 287
Fields should usually be private 0.65 0.20833333333333334 0.14166666666666666 120
Interface for constants 0.32004981320049813 0.5442092154420921 0.1357409713574097 803
Know the core libraries 0.8017241379310345 0.08620689655172414 0.11206896551724138 116
Minimize ripple effects 0.8661971830985915 0.035211267605633804 0.09859154929577464 142
Naming conventions 0.33611111111111114 0.5833333333333334 0.08055555555555556 360
Nest classes with care 0.5 0.3333333333333333 0.16666666666666666 18
Output parameters 0.3870967741935484 0.3924731182795699 0.22043010752688172 186
Separate public and private members 0.7191011235955056 0.1797752808988764 0.10112359550561797 89
String concatenation does not scale 0.8484848484848485 0.09696969696969697 0.05454545454545454 165
Tag or marker interfaces 0.6452991452991453 0.19658119658119658 0.1581196581196581 234
Uncommon classes need explicit imports 0.7699115044247787 0.13274336283185842 0.09734513274336283 113
Use @Override liberally 0.8351648351648352 0.09010989010989011 0.07472527472527472 455
Use final liberally 0.6070901033973413 0.22895125553914328 0.16395864106351551 677
Use javadoc liberally 0.7616279069767442 0.11627906976744186 0.12209302325581395 172
Use static imports rarely 0.5786516853932584 0.28792134831460675 0.13342696629213482 712
Use System.exit with care 0.6683006535947712 0.18790849673202614 0.1437908496732026 612
Use Version Control tools 0.6923076923076923 0.13846153846153847 0.16923076923076924 65
Validate method arguments 0.6224066390041494 0.22406639004149378 0.15352697095435686 241
Wisdom, not rules 0.9607843137254902 0.0196078431372549 0.0196078431372549 51
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 0.7705882352941177 0.07647058823529412 0.15294117647058825 170
Designing for subclassing 0.75 0.1388888888888889 0.1111111111111111 72
Overridable methods need special care 0.826530612244898 0.061224489795918366 0.11224489795918367 98
Remember styles of inheritance 0.9387755102040817 0.0 0.061224489795918366 49
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 0.6286644951140065 0.23452768729641693 0.13680781758957655 307
Beware of Byte Order Marks 0.6764705882352942 0.2647058823529412 0.058823529411764705 34
Beware of DecimalFormat 0.43333333333333335 0.31666666666666665 0.25 180
Beware of floating point numbers 0.8770491803278688 0.08196721311475409 0.040983606557377046 122
Clarifying method 0.9052631578947369 0.05263157894736842 0.042105263157894736 95
Coding conventions 0.8666666666666667 0.044444444444444446 0.08888888888888889 90
Compile regular expressions once 0.7592592592592593 0.14814814814814814 0.09259259259259259 54
Conditional compile 0.5022026431718062 0.3876651982378855 0.11013215859030837 227
Consider code generators 0.75 0.14473684210526316 0.10526315789473684 76
Consider immutable forms for dates 0.4827586206896552 0.3620689655172414 0.15517241379310345 58
Conventional name for return value 0.7291666666666666 0.1875 0.08333333333333333 144
Defensive copying 0.8642241379310345 0.0625 0.07327586206896551 464
Design by Contract 0.8023255813953488 0.09302325581395349 0.10465116279069768 172
Don't use tab characters 0.35384615384615387 0.5938461538461538 0.052307692307692305 325
Extra space in argument list 0.1894353369763206 0.7522768670309654 0.058287795992714025 549
Generating unique IDs 0.5761616161616162 0.26585858585858585 0.15797979797979797 2475
Include 'from', exclude 'to' 0.7894736842105263 0.12280701754385964 0.08771929824561403 57
Multiple return statements 0.5485961123110151 0.3304535637149028 0.12095032397408208 463
Overloading can be tricky 0.7821782178217822 0.1485148514851485 0.06930693069306931 101
Package by feature, not layer 0.7185251798561151 0.12949640287769784 0.15197841726618705 1112
Passwords never in clear text 0.6453900709219859 0.1773049645390071 0.1773049645390071 141
Prefer empty items to null ones 0.6796116504854369 0.2087378640776699 0.11165048543689321 412
Quote dynamic text when logging 0.8125 0.125 0.0625 96
Self-encapsulate fields 0.6421052631578947 0.16842105263157894 0.18947368421052632 190
Structs are occasionally useful 0.6739130434782609 0.16521739130434782 0.1608695652173913 230
Test using main method 0.37168141592920356 0.5221238938053098 0.10619469026548672 113
Try alternatives to ResourceBundle 0.3225806451612903 0.3387096774193548 0.3387096774193548 62
Use a fake system clock 0.572463768115942 0.2318840579710145 0.1956521739130435 138
Use a testing framework (JUnit) 0.8347826086956521 0.09565217391304348 0.06956521739130435 115
Use Ant for build scripts 0.7340823970037453 0.149812734082397 0.11610486891385768 267
Use boxing with care 0.6733668341708543 0.20603015075376885 0.12060301507537688 199
Use enums to restrict arguments 0.7384615384615385 0.13076923076923078 0.13076923076923078 130
Validate state with class invariants 0.5909090909090909 0.24242424242424243 0.16666666666666666 66
Validation belongs in a Model Object 0.5909090909090909 0.29545454545454547 0.11363636363636363 132
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 0.815068493150685 0.136986301369863 0.04794520547945205 146
Assert use cases 0.36585365853658536 0.4292682926829268 0.2048780487804878 205
Assertions in general 0.8571428571428571 0.14285714285714285 0.0 35
Force enabling of assertions 0.5689655172413793 0.27586206896551724 0.15517241379310345 58
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 0.6222222222222222 0.18703703703703703 0.19074074074074074 540
Beware of mistaken field redeclares 0.8333333333333334 0.1 0.06666666666666667 30
Construct Object using class name 0.5348837209302325 0.3023255813953488 0.16279069767441862 215
Constructors in general 0.6326530612244898 0.2653061224489796 0.10204081632653061 49
Constructors shouldn't call overridables 0.6011560693641619 0.24855491329479767 0.15028901734104047 173
Constructors shouldn't start threads 0.6875 0.1875 0.125 48
Copy constructors 0.6412451361867705 0.22412451361867705 0.13463035019455252 1285
Don't pass 'this' out of a constructor 0.625 0.23214285714285715 0.14285714285714285 56
Initializing fields to 0-false-null is redundant 0.6765498652291105 0.22641509433962265 0.09703504043126684 371
SerializationYesNoUndecidedVotes
Implementing Serializable 0.6346718903036239 0.1821743388834476 0.1831537708129285 1021
Serialization and subclassing 0.49504950495049505 0.31683168316831684 0.18811881188118812 101
Some classes need readResolve 0.76 0.12 0.12 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 0.7419354838709677 0.11385199240986717 0.1442125237191651 527
Avoid ThreadGroup 0.5527950310559007 0.2484472049689441 0.19875776397515527 161
Data integrity first 0.7320261437908496 0.10457516339869281 0.16339869281045752 153
Document thread safety 0.7333333333333333 0.17777777777777778 0.08888888888888889 45
Dump thread information 0.7916666666666666 0.16666666666666666 0.041666666666666664 24
Handle InterruptedException 0.5714285714285714 0.21428571428571427 0.21428571428571427 42
Launch thread is just another user thread 0.8378378378378378 0.08108108108108109 0.08108108108108109 37
Objects communicating across threads 0.6992481203007519 0.17293233082706766 0.12781954887218044 133
Perform N tasks in parallel 0.6158940397350994 0.17218543046357615 0.2119205298013245 302
Prefer modern libraries for concurrency 0.9444444444444444 0.05555555555555555 0.0 18
Query host for the number of processors 0.8823529411764706 0.08823529411764706 0.029411764705882353 34
Read-write locks 0.7142857142857143 0.14285714285714285 0.14285714285714285 98
Remember the types of intrinsic lock 0.8060836501901141 0.10266159695817491 0.09125475285171103 263
Schedule periodic tasks 0.6619361378611252 0.1956411556006082 0.1424227065382666 1973
Stop threads through cooperation 0.6333333333333333 0.2866666666666667 0.08 150
Synchronize access to mutable fields 0.5520833333333334 0.2864583333333333 0.16145833333333334 192
Synchronized is implementation detail 0.6129032258064516 0.24731182795698925 0.13978494623655913 93
Thread priorities are not portable 0.6458333333333334 0.1875 0.16666666666666666 48
Use finally to unlock 0.8 0.125 0.075 40
© 2017 Hirondelle Systems | Source Code | Contact | License | RSS
Individual code snippets can be used under this BSD license - Last updated on September 21, 2013.
Over 2,000,000 unique IPs last year - Built with WEB4J.
- In Memoriam : Bill Dirani -