Poll Summary

Number Of Votes Cast
82,897
Overall Acceptance Rates
Choice Number Percentage
Yes 52,813 64%
No 18,620 22%
Undecided 11,464 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 2069
Always maintain HttpSessions 73% 17% 10% 154
Beware multilingual submit buttons 64% 21% 15% 166
Beware of common hacks 84% 8% 8% 128
Beware of custom cookies 78% 7% 15% 108
Beware of doubly escaped ampersands 77% 13% 10% 78
Beware of URL rewriting 63% 22% 16% 179
Choose form validation style carefully 71% 18% 11% 121
Consider Controllers for redirects 48% 25% 28% 40
Do not synchronize doGet, doPost 69% 20% 11% 790
Emit flexible URLs 73% 8% 19% 64
Escape special characters 59% 29% 12% 875
Forward versus redirect 72% 14% 14% 687
JSPs should contain only presentation logic 88% 6% 6% 227
Loss of data during restart 66% 15% 19% 101
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% 202
Prefer UTF-8 in all layers 79% 9% 11% 150
Prevent self-linking 39% 54% 7% 28
Refactor large Controllers 79% 11% 11% 19
Repel invalid requests 76% 12% 12% 25
Reuse login page for errors 69% 18% 13% 194
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 58% 22% 19% 77
Session-scope objects often Serializable 75% 13% 13% 126
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 73% 17% 9% 116
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 311
Use templates to standardize layout 48% 39% 13% 54
Validate email addresses 44% 41% 15% 381
Validate generated HTML 72% 14% 13% 319
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 46% 26% 28% 65
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 68% 16% 15% 396
Actions 70% 20% 10% 94
Align menu items 67% 20% 13% 94
Change theme 68% 18% 14% 144
Consider JGoodies Forms for layouts 72% 8% 20% 115
Don't bury dialogs 65% 15% 19% 26
Don't subclass JDialog or JFrame 30% 41% 28% 158
Filter table rows 50% 39% 11% 18
Input dialogs 54% 24% 22% 41
Launch other applications 74% 26% 0% 27
Layout Managers 63% 23% 13% 246
Look and Feel guidelines 85% 8% 6% 48
Minimal Swing application 60% 23% 16% 128
Observers and listeners 45% 30% 25% 199
Preferences dialogs 45% 16% 39% 31
Provide an uncaught exception handler 60% 22% 18% 128
Render table cells 67% 17% 16% 296
Sort table rows 44% 31% 25% 75
Splash screen 57% 31% 12% 312
Standardized dialogs 56% 33% 11% 27
Swing in general 76% 9% 15% 34
Swing threads 56% 23% 20% 162
Swing utility tasks 78% 12% 10% 40
Timers 33% 49% 18% 132
Using JavaHelp 53% 29% 17% 92
Using preferences 45% 32% 23% 66
Verify input with Model Objects 64% 18% 18% 11
Verify input with regular expressions 44% 33% 23% 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 44% 33% 23% 384
Avoid empty catch blocks 83% 11% 6% 310
Be specific in throws clause 60% 33% 7% 262
Beware of unknown root causes 38% 28% 34% 29
Checked versus unchecked exceptions 52% 28% 20% 1565
Exception translation 91% 6% 3% 125
Exceptions and control flow 70% 16% 14% 168
Finally and catch 66% 20% 14% 545
Javadoc all exceptions 56% 23% 21% 142
Pass all pertinent data to exceptions 95% 1% 4% 121
Stack trace as String 77% 14% 9% 714
Use template for repeated try-catch 65% 12% 23% 83
Input-OutputYesNoUndecidedVotes
Always close streams 75% 15% 10% 342
Buffering usually appropriate 87% 6% 7% 71
Console input 54% 29% 17% 280
Copy a file 67% 23% 10% 104
Reading and writing binary files 50% 27% 23% 279
Reading and writing Serializable objects 58% 26% 16% 370
Reading and writing text files 61% 23% 17% 3167
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 297
Connection pools 87% 6% 7% 286
Consider data layer tools 58% 18% 24% 38
Consider using standard SQL 68% 19% 13% 97
Consider wrapper classes for optional data 76% 13% 10% 68
Data access objects 64% 20% 16% 276
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% 33% 14% 184
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 90% 3% 6% 31
Remember the basics of database design 87% 6% 6% 62
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 63% 26% 11% 27
Use template for transactions 68% 5% 26% 19
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 739
Encapsulate collections 82% 7% 12% 190
Iterate without an index 77% 17% 5% 310
Prefer Collections over older classes 85% 6% 9% 119
Two ways of using Iterator 61% 24% 15% 1405
Use for-each liberally 76% 15% 9% 246
Use interface references to Collections 70% 19% 10% 115
Use standard Collections 83% 6% 11% 173
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 34% 23% 527
Implementing compareTo 51% 33% 16% 381
Implementing equals 60% 27% 14% 309
Implementing hashCode 56% 27% 17% 376
Implementing toString 50% 31% 19% 413
Never rely on finalize 72% 16% 12% 92
Common TasksYesNoUndecidedVotes
Arrays as String 47% 36% 17% 283
Clipboard copy and paste 78% 13% 9% 1771
Command line operations 45% 39% 16% 289
Compare and sort Strings 51% 34% 15% 276
Copy an array 59% 29% 12% 630
Determine if Strings are equal 67% 24% 9% 526
Examine bytecode 50% 39% 11% 44
Fetch web page and header 64% 21% 15% 314
Generate random numbers 62% 26% 12% 11650
Get database connection 55% 28% 17% 1191
Get size of object in memory 40% 44% 16% 355
Implement code tables 58% 21% 21% 52
Internationalization 52% 28% 20% 64
Logging messages 61% 22% 17% 1483
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% 645
Pattern-match lines of a file 57% 28% 15% 250
Read jar version information 58% 33% 9% 90
Recovering resources 85% 9% 6% 34
Recursive file listing 73% 16% 11% 1107
Replace a substring 58% 30% 12% 394
Representing money 74% 12% 14% 505
Send an email 55% 24% 21% 2054
Time execution speed 70% 21% 8% 132
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 16% 14% 163
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 762
Immutable objects 82% 9% 9% 1146
Lazy initialization 75% 14% 11% 183
Model Objects 61% 15% 24% 110
Plugin Factory 70% 11% 19% 27
Private constructor 74% 14% 12% 878
Singleton 73% 17% 9% 307
Template method 71% 22% 7% 58
Type-Safe Enumerations 80% 11% 9% 382
Wrapper (Decorator) 58% 25% 16% 79
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 86% 7% 7% 111
Avoid raw types 80% 13% 7% 205
Beware of instanceof operator 61% 24% 15% 1817
Class for constants 64% 23% 12% 813
Construct classes from the outside in 91% 6% 3% 66
Do not break portability 75% 19% 7% 75
Don't declare local variables before use 56% 27% 17% 267
Fields should usually be private 66% 21% 13% 119
Interface for constants 31% 55% 14% 770
Know the core libraries 80% 9% 11% 115
Minimize ripple effects 86% 4% 10% 136
Naming conventions 33% 59% 8% 349
Nest classes with care 53% 27% 20% 15
Output parameters 40% 39% 21% 176
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% 218
Uncommon classes need explicit imports 77% 14% 9% 108
Use @Override liberally 83% 9% 8% 433
Use final liberally 60% 24% 17% 633
Use javadoc liberally 76% 11% 13% 161
Use static imports rarely 58% 29% 13% 669
Use System.exit with care 67% 19% 14% 597
Use Version Control tools 69% 12% 19% 59
Validate method arguments 63% 22% 15% 231
Wisdom, not rules 96% 2% 2% 45
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 15% 167
Designing for subclassing 74% 15% 12% 68
Overridable methods need special care 83% 6% 10% 96
Remember styles of inheritance 94% 0% 6% 48
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 24% 13% 297
Beware of Byte Order Marks 68% 26% 6% 31
Beware of DecimalFormat 44% 31% 25% 178
Beware of floating point numbers 88% 8% 3% 119
Clarifying method 91% 5% 3% 91
Coding conventions 86% 5% 10% 84
Compile regular expressions once 75% 15% 10% 52
Conditional compile 50% 39% 11% 219
Consider code generators 76% 14% 11% 74
Consider immutable forms for dates 46% 37% 17% 54
Conventional name for return value 72% 19% 9% 140
Defensive copying 87% 6% 7% 438
Design by Contract 80% 9% 11% 163
Don't use tab characters 35% 60% 5% 305
Extra space in argument list 19% 75% 6% 539
Generating unique IDs 58% 26% 16% 2264
Include 'from', exclude 'to' 77% 13% 9% 53
Multiple return statements 55% 33% 13% 443
Overloading can be tricky 78% 15% 7% 99
Package by feature, not layer 71% 14% 16% 961
Passwords never in clear text 65% 17% 18% 138
Prefer empty items to null ones 68% 20% 11% 405
Quote dynamic text when logging 81% 13% 6% 94
Self-encapsulate fields 64% 17% 19% 184
Structs are occasionally useful 68% 16% 16% 207
Test using main method 39% 50% 11% 109
Try alternatives to ResourceBundle 32% 34% 34% 62
Use a fake system clock 57% 24% 19% 134
Use a testing framework (JUnit) 83% 10% 7% 113
Use Ant for build scripts 73% 15% 12% 263
Use boxing with care 68% 20% 12% 195
Use enums to restrict arguments 74% 14% 13% 125
Validate state with class invariants 59% 24% 17% 66
Validation belongs in a Model Object 60% 30% 10% 124
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 142
Assert use cases 36% 43% 21% 201
Assertions in general 88% 12% 0% 34
Force enabling of assertions 56% 29% 15% 55
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 62% 19% 19% 528
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 30% 16% 209
Constructors in general 65% 27% 8% 48
Constructors shouldn't call overridables 61% 24% 15% 163
Constructors shouldn't start threads 73% 16% 11% 44
Copy constructors 64% 23% 13% 1210
Don't pass 'this' out of a constructor 62% 26% 13% 47
Initializing fields to 0-false-null is redundant 68% 23% 10% 346
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 19% 18% 1004
Serialization and subclassing 49% 32% 19% 100
Some classes need readResolve 76% 12% 12% 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 488
Avoid ThreadGroup 55% 25% 20% 159
Data integrity first 73% 11% 16% 144
Document thread safety 73% 18% 9% 45
Dump thread information 78% 17% 4% 23
Handle InterruptedException 54% 23% 23% 39
Launch thread is just another user thread 86% 6% 9% 35
Objects communicating across threads 70% 17% 12% 132
Perform N tasks in parallel 62% 16% 21% 284
Prefer modern libraries for concurrency 94% 6% 0% 18
Query host for the number of processors 88% 9% 3% 34
Read-write locks 71% 14% 14% 98
Remember the types of intrinsic lock 80% 10% 9% 258
Schedule periodic tasks 67% 19% 14% 1935
Stop threads through cooperation 63% 29% 8% 150
Synchronize access to mutable fields 55% 29% 16% 191
Synchronized is implementation detail 61% 25% 14% 92
Thread priorities are not portable 66% 17% 17% 47
Use finally to unlock 81% 14% 5% 37
© 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 -