Poll Summary

Number Of Votes Cast
81,474
Overall Acceptance Rates
Choice Number Percentage
Yes 51,998 64%
No 18,267 22%
Undecided 11,209 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 2002
Always maintain HttpSessions 73% 16% 11% 152
Beware multilingual submit buttons 65% 19% 16% 159
Beware of common hacks 84% 8% 8% 127
Beware of custom cookies 78% 7% 15% 107
Beware of doubly escaped ampersands 77% 13% 10% 78
Beware of URL rewriting 63% 22% 14% 174
Choose form validation style carefully 71% 18% 11% 121
Consider Controllers for redirects 48% 25% 28% 40
Do not synchronize doGet, doPost 69% 19% 11% 785
Emit flexible URLs 73% 8% 19% 63
Escape special characters 60% 29% 12% 866
Forward versus redirect 72% 14% 14% 676
JSPs should contain only presentation logic 88% 6% 6% 227
Loss of data during restart 65% 15% 19% 98
Manage sessions closely 80% 11% 9% 152
Measure web app performance 86% 8% 6% 187
Minimize site response time 74% 13% 13% 94
Parse parameters into domain objects 40% 32% 28% 25
Pre-populate forms 46% 35% 18% 99
Prefer JSTL tags 74% 15% 11% 201
Prefer UTF-8 in all layers 80% 9% 11% 148
Prevent self-linking 41% 52% 7% 27
Refactor large Controllers 79% 11% 11% 19
Repel invalid requests 76% 12% 12% 25
Reuse login page for errors 69% 18% 13% 190
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 22% 18% 76
Session-scope objects often Serializable 75% 12% 13% 124
Struts seems mediocre 43% 39% 18% 206
Thread-safety in web apps 75% 16% 10% 295
Understand details of FORM tags 79% 9% 12% 34
Use Cascading Style Sheets 74% 16% 10% 113
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 307
Use templates to standardize layout 53% 39% 8% 49
Validate email addresses 44% 41% 15% 379
Validate generated HTML 72% 15% 13% 313
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 47% 27% 27% 64
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 68% 16% 16% 391
Actions 71% 19% 10% 93
Align menu items 67% 20% 13% 93
Change theme 68% 18% 14% 144
Consider JGoodies Forms for layouts 72% 8% 20% 113
Don't bury dialogs 64% 16% 20% 25
Don't subclass JDialog or JFrame 31% 41% 28% 157
Filter table rows 50% 39% 11% 18
Input dialogs 54% 24% 22% 41
Launch other applications 73% 27% 0% 26
Layout Managers 63% 24% 14% 242
Look and Feel guidelines 85% 8% 6% 48
Minimal Swing application 60% 24% 17% 126
Observers and listeners 45% 30% 25% 195
Preferences dialogs 45% 16% 39% 31
Provide an uncaught exception handler 60% 22% 18% 127
Render table cells 67% 17% 16% 289
Sort table rows 45% 30% 26% 74
Splash screen 56% 31% 13% 308
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 56% 24% 21% 160
Swing utility tasks 78% 12% 10% 40
Timers 33% 49% 18% 132
Using JavaHelp 53% 30% 18% 91
Using preferences 46% 32% 22% 65
Verify input with Model Objects 64% 18% 18% 11
Verify input with regular expressions 44% 33% 23% 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 43% 33% 24% 372
Avoid empty catch blocks 83% 10% 6% 308
Be specific in throws clause 60% 33% 7% 258
Beware of unknown root causes 36% 29% 36% 28
Checked versus unchecked exceptions 52% 28% 20% 1542
Exception translation 91% 6% 3% 123
Exceptions and control flow 69% 16% 14% 166
Finally and catch 66% 20% 14% 542
Javadoc all exceptions 56% 24% 21% 140
Pass all pertinent data to exceptions 95% 1% 4% 120
Stack trace as String 77% 14% 9% 712
Use template for repeated try-catch 65% 11% 23% 81
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 9% 337
Buffering usually appropriate 87% 6% 7% 71
Console input 54% 29% 17% 272
Copy a file 66% 24% 10% 101
Reading and writing binary files 50% 27% 24% 271
Reading and writing Serializable objects 58% 26% 16% 361
Reading and writing text files 61% 23% 17% 3153
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 292
Connection pools 87% 6% 7% 285
Consider data layer tools 58% 18% 24% 38
Consider using standard SQL 68% 19% 14% 96
Consider wrapper classes for optional data 76% 13% 10% 68
Data access objects 63% 20% 16% 273
Data exception wrapping 74% 14% 12% 57
Data is king 88% 6% 6% 109
Don't perform basic SQL tasks in code 86% 8% 6% 71
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 54% 32% 14% 182
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 90% 3% 6% 31
Remember the basics of database design 89% 7% 5% 61
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 63% 26% 11% 27
Use template for transactions 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 722
Encapsulate collections 81% 7% 12% 188
Iterate without an index 77% 17% 6% 308
Prefer Collections over older classes 85% 6% 9% 118
Two ways of using Iterator 61% 24% 15% 1373
Use for-each liberally 76% 15% 9% 244
Use interface references to Collections 71% 19% 11% 113
Use standard Collections 83% 7% 11% 168
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 35% 23% 519
Implementing compareTo 51% 33% 16% 376
Implementing equals 60% 27% 13% 305
Implementing hashCode 56% 27% 17% 375
Implementing toString 50% 31% 19% 409
Never rely on finalize 72% 16% 12% 92
Common TasksYesNoUndecidedVotes
Arrays as String 46% 36% 17% 281
Clipboard copy and paste 78% 13% 9% 1745
Command line operations 45% 39% 16% 280
Compare and sort Strings 52% 33% 15% 273
Copy an array 60% 29% 12% 624
Determine if Strings are equal 67% 24% 9% 526
Examine bytecode 51% 37% 12% 43
Fetch web page and header 64% 21% 15% 314
Generate random numbers 62% 26% 12% 11416
Get database connection 55% 28% 16% 1182
Get size of object in memory 39% 44% 16% 352
Implement code tables 58% 21% 21% 52
Internationalization 51% 29% 21% 63
Logging messages 61% 22% 16% 1449
Measure application performance 77% 14% 9% 57
Modernize old code 89% 7% 4% 56
Open file in native directory 62% 25% 12% 8
Parse text 61% 22% 18% 643
Pattern-match lines of a file 58% 28% 14% 243
Read jar version information 58% 34% 8% 88
Recovering resources 85% 9% 6% 34
Recursive file listing 73% 16% 11% 1102
Replace a substring 58% 30% 12% 392
Representing money 75% 12% 14% 493
Send an email 55% 24% 21% 2047
Time execution speed 71% 21% 8% 131
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 16% 14% 162
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 753
Immutable objects 82% 9% 9% 1124
Lazy initialization 75% 14% 11% 181
Model Objects 64% 15% 21% 105
Plugin Factory 70% 11% 19% 27
Private constructor 74% 14% 12% 869
Singleton 73% 17% 10% 304
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 380
Wrapper (Decorator) 60% 24% 16% 68
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 7% 7% 109
Avoid raw types 80% 13% 8% 197
Beware of instanceof operator 61% 24% 15% 1795
Class for constants 67% 20% 13% 757
Construct classes from the outside in 91% 6% 3% 65
Do not break portability 76% 19% 5% 74
Don't declare local variables before use 57% 26% 17% 263
Fields should usually be private 66% 20% 14% 118
Interface for constants 32% 55% 13% 742
Know the core libraries 80% 8% 12% 112
Minimize ripple effects 86% 4% 11% 132
Naming conventions 32% 60% 8% 346
Nest classes with care 57% 29% 14% 14
Output parameters 40% 39% 21% 173
Separate public and private members 72% 19% 9% 85
String concatenation does not scale 85% 10% 6% 163
Tag or marker interfaces 66% 18% 16% 209
Uncommon classes need explicit imports 77% 14% 9% 104
Use @Override liberally 82% 9% 8% 422
Use final liberally 60% 23% 16% 614
Use javadoc liberally 76% 11% 13% 159
Use static imports rarely 58% 28% 14% 648
Use System.exit with care 67% 19% 14% 591
Use Version Control tools 69% 12% 19% 58
Validate method arguments 63% 22% 15% 229
Wisdom, not rules 95% 2% 2% 43
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 78% 8% 15% 165
Designing for subclassing 74% 15% 12% 68
Overridable methods need special care 83% 6% 10% 96
Remember styles of inheritance 94% 0% 6% 47
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 294
Beware of Byte Order Marks 70% 27% 3% 30
Beware of DecimalFormat 44% 31% 24% 176
Beware of floating point numbers 89% 9% 3% 114
Clarifying method 91% 5% 3% 91
Coding conventions 86% 5% 10% 84
Compile regular expressions once 76% 16% 8% 50
Conditional compile 51% 39% 10% 213
Consider code generators 76% 14% 11% 74
Consider immutable forms for dates 46% 37% 17% 54
Conventional name for return value 72% 19% 9% 139
Defensive copying 87% 6% 7% 427
Design by Contract 81% 9% 9% 159
Don't use tab characters 35% 60% 5% 298
Extra space in argument list 19% 75% 6% 537
Generating unique IDs 58% 26% 15% 2179
Include 'from', exclude 'to' 77% 13% 9% 53
Multiple return statements 55% 33% 13% 437
Overloading can be tricky 77% 15% 7% 97
Package by feature, not layer 71% 14% 16% 902
Passwords never in clear text 65% 17% 18% 136
Prefer empty items to null ones 68% 20% 11% 400
Quote dynamic text when logging 81% 13% 6% 93
Self-encapsulate fields 63% 17% 19% 183
Structs are occasionally useful 68% 16% 16% 193
Test using main method 39% 50% 11% 107
Try alternatives to ResourceBundle 32% 34% 34% 62
Use a fake system clock 56% 24% 20% 133
Use a testing framework (JUnit) 83% 10% 7% 112
Use Ant for build scripts 74% 14% 12% 257
Use boxing with care 67% 20% 12% 192
Use enums to restrict arguments 74% 14% 12% 122
Validate state with class invariants 59% 24% 17% 66
Validation belongs in a Model Object 60% 30% 10% 123
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 141
Assert use cases 37% 42% 21% 198
Assertions in general 88% 12% 0% 34
Force enabling of assertions 56% 30% 15% 54
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 63% 19% 19% 524
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 54% 30% 16% 208
Constructors in general 65% 27% 8% 48
Constructors shouldn't call overridables 60% 24% 16% 160
Constructors shouldn't start threads 74% 14% 12% 42
Copy constructors 65% 23% 13% 1176
Don't pass 'this' out of a constructor 61% 25% 14% 44
Initializing fields to 0-false-null is redundant 68% 23% 9% 335
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 19% 18% 993
Serialization and subclassing 49% 31% 19% 99
Some classes need readResolve 76% 12% 12% 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 12% 13% 461
Avoid ThreadGroup 55% 25% 20% 159
Data integrity first 73% 11% 16% 140
Document thread safety 73% 18% 9% 45
Dump thread information 77% 18% 5% 22
Handle InterruptedException 58% 24% 18% 33
Launch thread is just another user thread 86% 6% 9% 35
Objects communicating across threads 70% 17% 12% 132
Perform N tasks in parallel 63% 17% 21% 277
Prefer modern libraries for concurrency 94% 6% 0% 16
Query host for the number of processors 91% 6% 3% 33
Read-write locks 72% 14% 13% 97
Remember the types of intrinsic lock 81% 10% 9% 257
Schedule periodic tasks 67% 19% 14% 1915
Stop threads through cooperation 63% 29% 8% 149
Synchronize access to mutable fields 55% 29% 16% 186
Synchronized is implementation detail 61% 25% 14% 92
Thread priorities are not portable 65% 17% 17% 46
Use finally to unlock 81% 14% 6% 36
© 2016 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 -