Poll Summary

Number Of Votes Cast
86590
Overall Acceptance Rates
Choice Number Percentage
Yes 54968 0.6348077145166878
No 19505 0.22525695807830004
Undecided 12117 0.13993532740501213

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 0.6189201249442213 0.17938420348058903 0.20169567157518964 2241
Always maintain HttpSessions 0.7142857142857143 0.16770186335403728 0.11801242236024845 161
Beware multilingual submit buttons 0.6416184971098265 0.2023121387283237 0.15606936416184972 173
Beware of common hacks 0.8461538461538461 0.07692307692307693 0.07692307692307693 130
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.6263736263736264 0.21978021978021978 0.15384615384615385 182
Choose form validation style carefully 0.7131147540983607 0.18032786885245902 0.10655737704918032 122
Consider Controllers for redirects 0.4878048780487805 0.24390243902439024 0.2682926829268293 41
Do not synchronize doGet, doPost 0.6893564356435643 0.1967821782178218 0.11386138613861387 808
Emit flexible URLs 0.746268656716418 0.07462686567164178 0.1791044776119403 67
Escape special characters 0.5853932584269663 0.29775280898876405 0.11685393258426967 890
Forward versus redirect 0.7201704545454546 0.13636363636363635 0.1434659090909091 704
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.803921568627451 0.10457516339869281 0.0915032679738562 153
Measure web app performance 0.8666666666666667 0.07692307692307693 0.05641025641025641 195
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.46601941747572817 0.33980582524271846 0.1941747572815534 103
Prefer JSTL tags 0.7450980392156863 0.14705882352941177 0.10784313725490197 204
Prefer UTF-8 in all layers 0.7948717948717948 0.09615384615384616 0.10897435897435898 156
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.695 0.175 0.13 200
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.725 0.175 0.1 120
Use extensions for fine-grained security 0.5306122448979592 0.3469387755102041 0.12244897959183673 49
Use Model-View-Controller framework 0.8913043478260869 0.034161490683229816 0.07453416149068323 322
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.7134502923976608 0.14619883040935672 0.14035087719298245 342
Web usability guidelines 0.8378378378378378 0.05405405405405406 0.10810810810810811 37
Wrap file upload requests 0.4626865671641791 0.26865671641791045 0.26865671641791045 67
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.7 0.075 0.225 120
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.6403162055335968 0.22529644268774704 0.13438735177865613 253
Look and Feel guidelines 0.8571428571428571 0.08163265306122448 0.061224489795918366 49
Minimal Swing application 0.582089552238806 0.2462686567164179 0.17164179104477612 134
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.6058394160583942 0.2116788321167883 0.18248175182481752 137
Render table cells 0.6677631578947368 0.17105263157894737 0.1611842105263158 304
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.43719806763285024 0.321256038647343 0.24154589371980675 414
Avoid empty catch blocks 0.821875 0.1125 0.065625 320
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.516728624535316 0.28004956629491945 0.20322180916976457 1614
Exception translation 0.9147286821705426 0.05426356589147287 0.031007751937984496 129
Exceptions and control flow 0.6914285714285714 0.1657142857142857 0.14285714285714285 175
Finally and catch 0.6606498194945848 0.1967509025270758 0.14259927797833935 554
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.7634112792297112 0.1485557083906465 0.08803301237964237 727
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.5292096219931272 0.29553264604810997 0.17525773195876287 291
Copy a file 0.6818181818181818 0.21818181818181817 0.1 110
Reading and writing binary files 0.48859934853420195 0.2736156351791531 0.23778501628664495 307
Reading and writing Serializable objects 0.5677083333333334 0.2604166666666667 0.171875 384
Reading and writing text files 0.6058897243107769 0.22556390977443608 0.16854636591478697 3192
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.6421052631578947 0.19298245614035087 0.1649122807017544 285
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.8144458281444583 0.08841843088418432 0.09713574097135741 803
Encapsulate collections 0.8131313131313131 0.06565656565656566 0.12121212121212122 198
Iterate without an index 0.7735849056603774 0.16981132075471697 0.05660377358490566 318
Prefer Collections over older classes 0.8429752066115702 0.05785123966942149 0.09917355371900827 121
Two ways of using Iterator 0.6088117489986649 0.2409879839786382 0.15020026702269693 1498
Use for-each liberally 0.7598425196850394 0.15354330708661418 0.08661417322834646 254
Use interface references to Collections 0.6974789915966386 0.19327731092436976 0.1092436974789916 119
Use standard Collections 0.8263157894736842 0.05789473684210526 0.11578947368421053 190
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 0.41947565543071164 0.3464419475655431 0.2340823970037453 534
Implementing compareTo 0.5012531328320802 0.3333333333333333 0.16541353383458646 399
Implementing equals 0.590625 0.275 0.134375 320
Implementing hashCode 0.554089709762533 0.2691292875989446 0.17678100263852242 379
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.7760869565217391 0.13369565217391305 0.09021739130434783 1840
Command line operations 0.4533333333333333 0.38666666666666666 0.16 300
Compare and sort Strings 0.5154639175257731 0.33676975945017185 0.14776632302405499 291
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.6426332288401254 0.20689655172413793 0.15047021943573669 319
Generate random numbers 0.6108437600256656 0.2641161373115175 0.12504010266281682 12468
Get database connection 0.5504511894995898 0.2830188679245283 0.16652994257588188 1219
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.5074626865671642 0.29850746268656714 0.19402985074626866 67
Logging messages 0.6040575916230366 0.225130890052356 0.17081151832460734 1528
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.6054216867469879 0.21686746987951808 0.17771084337349397 664
Pattern-match lines of a file 0.5642023346303502 0.2801556420233463 0.1556420233463035 257
Read jar version information 0.5567010309278351 0.35051546391752575 0.09278350515463918 97
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.7461832061068703 0.11641221374045801 0.13740458015267176 524
Send an email 0.5510597302504817 0.23795761078998073 0.21098265895953758 2076
Time execution speed 0.706766917293233 0.21052631578947367 0.08270676691729323 133
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 0.6946107784431138 0.16766467065868262 0.1377245508982036 167
Command objects 0.55 0.2 0.25 20
Factory methods 0.6207759699624531 0.21401752190237797 0.16520650813516896 799
Immutable objects 0.8136593591905565 0.09443507588532883 0.09190556492411467 1186
Lazy initialization 0.7566137566137566 0.13227513227513227 0.1111111111111111 189
Model Objects 0.6229508196721312 0.1557377049180328 0.22131147540983606 122
Plugin Factory 0.6896551724137931 0.10344827586206896 0.20689655172413793 29
Private constructor 0.7369589345172031 0.14317425083240842 0.11986681465038845 901
Singleton 0.7284345047923323 0.17252396166134185 0.09904153354632587 313
Template method 0.711864406779661 0.22033898305084745 0.06779661016949153 59
Type-Safe Enumerations 0.8010335917312662 0.10852713178294573 0.09043927648578812 387
Wrapper (Decorator) 0.5789473684210527 0.28421052631578947 0.1368421052631579 95
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 0.8547008547008547 0.06837606837606838 0.07692307692307693 117
Avoid raw types 0.7709251101321586 0.15418502202643172 0.07488986784140969 227
Beware of instanceof operator 0.614185921547555 0.23267060720042987 0.15314347125201505 1861
Class for constants 0.6355353075170843 0.2357630979498861 0.12870159453302962 878
Construct classes from the outside in 0.9130434782608695 0.057971014492753624 0.028985507246376812 69
Do not break portability 0.7466666666666667 0.18666666666666668 0.06666666666666667 75
Don't declare local variables before use 0.5570934256055363 0.25951557093425603 0.18339100346020762 289
Fields should usually be private 0.65 0.20833333333333334 0.14166666666666666 120
Interface for constants 0.31896551724137934 0.5443349753694581 0.13669950738916256 812
Know the core libraries 0.7948717948717948 0.08547008547008547 0.11965811965811966 117
Minimize ripple effects 0.8671328671328671 0.03496503496503497 0.0979020979020979 143
Naming conventions 0.33611111111111114 0.5833333333333334 0.08055555555555556 360
Nest classes with care 0.5263157894736842 0.3157894736842105 0.15789473684210525 19
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.6458333333333334 0.19583333333333333 0.15833333333333333 240
Uncommon classes need explicit imports 0.7719298245614035 0.13157894736842105 0.09649122807017543 114
Use @Override liberally 0.8351648351648352 0.09010989010989011 0.07472527472527472 455
Use final liberally 0.6099706744868035 0.22727272727272727 0.1627565982404692 682
Use javadoc liberally 0.7616279069767442 0.11627906976744186 0.12209302325581395 172
Use static imports rarely 0.5793871866295265 0.28690807799442897 0.13370473537604458 718
Use System.exit with care 0.6666666666666666 0.1886178861788618 0.14471544715447154 615
Use Version Control tools 0.6923076923076923 0.13846153846153847 0.16923076923076924 65
Validate method arguments 0.6229508196721312 0.22131147540983606 0.1557377049180328 244
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.82 0.07 0.11 100
Remember styles of inheritance 0.9387755102040817 0.0 0.061224489795918366 49
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 0.6298701298701299 0.23376623376623376 0.13636363636363635 308
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.8958333333333334 0.0625 0.041666666666666664 96
Coding conventions 0.8666666666666667 0.044444444444444446 0.08888888888888889 90
Compile regular expressions once 0.7454545454545455 0.16363636363636364 0.09090909090909091 55
Conditional compile 0.5043859649122807 0.38596491228070173 0.10964912280701754 228
Consider code generators 0.75 0.14473684210526316 0.10526315789473684 76
Consider immutable forms for dates 0.4666666666666667 0.38333333333333336 0.15 60
Conventional name for return value 0.7291666666666666 0.1875 0.08333333333333333 144
Defensive copying 0.8635394456289979 0.06183368869936034 0.07462686567164178 469
Design by Contract 0.8023255813953488 0.09302325581395349 0.10465116279069768 172
Don't use tab characters 0.35276073619631904 0.5950920245398773 0.05214723926380368 326
Extra space in argument list 0.1894353369763206 0.7522768670309654 0.058287795992714025 549
Generating unique IDs 0.5754301720688275 0.2657062825130052 0.15886354541816727 2499
Include 'from', exclude 'to' 0.7894736842105263 0.12280701754385964 0.08771929824561403 57
Multiple return statements 0.5495689655172413 0.3297413793103448 0.1206896551724138 464
Overloading can be tricky 0.7821782178217822 0.1485148514851485 0.06930693069306931 101
Package by feature, not layer 0.7180616740088106 0.12951541850220263 0.1524229074889868 1135
Passwords never in clear text 0.6453900709219859 0.1773049645390071 0.1773049645390071 141
Prefer empty items to null ones 0.6819277108433734 0.20722891566265061 0.1108433734939759 415
Quote dynamic text when logging 0.8144329896907216 0.12371134020618557 0.061855670103092786 97
Self-encapsulate fields 0.6387434554973822 0.16753926701570682 0.193717277486911 191
Structs are occasionally useful 0.6767241379310345 0.16379310344827586 0.15948275862068967 232
Test using main method 0.37719298245614036 0.5175438596491229 0.10526315789473684 114
Try alternatives to ResourceBundle 0.3225806451612903 0.3387096774193548 0.3387096774193548 62
Use a fake system clock 0.5683453237410072 0.23741007194244604 0.19424460431654678 139
Use a testing framework (JUnit) 0.8362068965517241 0.09482758620689655 0.06896551724137931 116
Use Ant for build scripts 0.7313432835820896 0.14925373134328357 0.11940298507462686 268
Use boxing with care 0.6666666666666666 0.21393034825870647 0.11940298507462686 201
Use enums to restrict arguments 0.7404580152671756 0.1297709923664122 0.1297709923664122 131
Validate state with class invariants 0.5882352941176471 0.25 0.16176470588235295 68
Validation belongs in a Model Object 0.5864661654135338 0.2932330827067669 0.12030075187969924 133
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 0.815068493150685 0.136986301369863 0.04794520547945205 146
Assert use cases 0.36231884057971014 0.43478260869565216 0.2028985507246377 207
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.6217712177121771 0.1881918819188192 0.1900369003690037 542
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.5977011494252874 0.25287356321839083 0.14942528735632185 174
Constructors shouldn't start threads 0.7 0.18 0.12 50
Copy constructors 0.6404320987654321 0.22453703703703703 0.13503086419753085 1296
Don't pass 'this' out of a constructor 0.625 0.23214285714285715 0.14285714285714285 56
Initializing fields to 0-false-null is redundant 0.679144385026738 0.22459893048128343 0.0962566844919786 374
SerializationYesNoUndecidedVotes
Implementing Serializable 0.6334310850439883 0.18377321603128055 0.1827956989247312 1023
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.7419962335216572 0.11487758945386065 0.1431261770244821 531
Avoid ThreadGroup 0.5527950310559007 0.2484472049689441 0.19875776397515527 161
Data integrity first 0.7337662337662337 0.1038961038961039 0.16233766233766234 154
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.6116504854368932 0.17475728155339806 0.21359223300970873 309
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.8075471698113208 0.1018867924528302 0.09056603773584905 265
Schedule periodic tasks 0.6621143146181082 0.19524532119372787 0.1426403641881639 1977
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 -