Poll Summary

Number Of Votes Cast
82,428
Overall Acceptance Rates
Choice Number Percentage
Yes 52,534 64%
No 18,520 22%
Undecided 11,374 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 2052
Always maintain HttpSessions 73% 17% 10% 154
Beware multilingual submit buttons 64% 21% 15% 165
Beware of common hacks 84% 8% 8% 128
Beware of custom cookies 78% 7% 15% 107
Beware of doubly escaped ampersands 77% 13% 10% 78
Beware of URL rewriting 63% 22% 15% 177
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% 787
Emit flexible URLs 73% 8% 19% 64
Escape special characters 59% 29% 12% 872
Forward versus redirect 72% 14% 14% 682
JSPs should contain only presentation logic 88% 6% 6% 227
Loss of data during restart 66% 15% 19% 100
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 80% 9% 11% 149
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% 193
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 58% 22% 19% 77
Session-scope objects often Serializable 75% 12% 13% 125
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 75% 16% 10% 114
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 310
Use templates to standardize layout 50% 38% 12% 52
Validate email addresses 44% 41% 15% 381
Validate generated HTML 72% 15% 13% 317
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 46% 26% 28% 65
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 68% 16% 16% 393
Actions 70% 20% 10% 94
Align menu items 67% 20% 13% 93
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 31% 41% 28% 157
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% 24% 17% 127
Observers and listeners 45% 30% 25% 196
Preferences dialogs 45% 16% 39% 31
Provide an uncaught exception handler 60% 22% 18% 128
Render table cells 67% 17% 16% 294
Sort table rows 44% 31% 25% 75
Splash screen 57% 31% 13% 311
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 56% 24% 20% 161
Swing utility tasks 78% 12% 10% 40
Timers 33% 49% 18% 132
Using JavaHelp 53% 29% 17% 92
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 44% 33% 24% 377
Avoid empty catch blocks 83% 10% 6% 308
Be specific in throws clause 60% 33% 7% 260
Beware of unknown root causes 36% 29% 36% 28
Checked versus unchecked exceptions 52% 28% 20% 1555
Exception translation 91% 6% 3% 124
Exceptions and control flow 70% 16% 14% 168
Finally and catch 66% 20% 14% 543
Javadoc all exceptions 55% 23% 21% 141
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% 12% 23% 83
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 9% 339
Buffering usually appropriate 87% 6% 7% 71
Console input 54% 29% 17% 275
Copy a file 67% 24% 10% 102
Reading and writing binary files 50% 27% 24% 276
Reading and writing Serializable objects 58% 26% 16% 365
Reading and writing text files 61% 23% 17% 3166
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 6% 293
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 64% 20% 16% 274
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 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 730
Encapsulate collections 81% 7% 12% 189
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% 1400
Use for-each liberally 76% 15% 9% 246
Use interface references to Collections 71% 18% 11% 114
Use standard Collections 83% 6% 11% 172
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 34% 23% 523
Implementing compareTo 51% 33% 16% 380
Implementing equals 59% 27% 14% 308
Implementing hashCode 56% 27% 17% 376
Implementing toString 50% 31% 19% 412
Never rely on finalize 72% 16% 12% 92
Common TasksYesNoUndecidedVotes
Arrays as String 47% 36% 17% 283
Clipboard copy and paste 78% 13% 9% 1761
Command line operations 45% 39% 16% 284
Compare and sort Strings 51% 34% 15% 274
Copy an array 59% 29% 12% 627
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% 11575
Get database connection 55% 28% 17% 1189
Get size of object in memory 40% 44% 16% 354
Implement code tables 58% 21% 21% 52
Internationalization 51% 29% 21% 63
Logging messages 61% 22% 17% 1477
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% 644
Pattern-match lines of a file 57% 28% 15% 247
Read jar version information 57% 34% 9% 89
Recovering resources 85% 9% 6% 34
Recursive file listing 73% 16% 11% 1107
Replace a substring 58% 30% 12% 392
Representing money 74% 12% 14% 500
Send an email 55% 24% 21% 2051
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% 759
Immutable objects 82% 9% 9% 1141
Lazy initialization 75% 14% 11% 183
Model Objects 62% 16% 22% 108
Plugin Factory 70% 11% 19% 27
Private constructor 74% 14% 12% 874
Singleton 73% 17% 10% 305
Template method 71% 22% 7% 58
Type-Safe Enumerations 80% 11% 9% 381
Wrapper (Decorator) 58% 26% 17% 78
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 7% 7% 110
Avoid raw types 80% 13% 8% 200
Beware of instanceof operator 61% 23% 15% 1809
Class for constants 64% 23% 12% 802
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% 266
Fields should usually be private 66% 21% 13% 119
Interface for constants 31% 55% 14% 761
Know the core libraries 81% 8% 12% 113
Minimize ripple effects 86% 4% 10% 134
Naming conventions 33% 59% 8% 349
Nest classes with care 57% 29% 14% 14
Output parameters 40% 39% 21% 175
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% 215
Uncommon classes need explicit imports 77% 14% 9% 105
Use @Override liberally 83% 9% 8% 431
Use final liberally 60% 24% 17% 626
Use javadoc liberally 76% 11% 13% 161
Use static imports rarely 58% 29% 13% 663
Use System.exit with care 67% 19% 14% 594
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% 23% 14% 296
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% 218
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% 437
Design by Contract 80% 9% 11% 163
Don't use tab characters 35% 60% 5% 301
Extra space in argument list 19% 75% 6% 538
Generating unique IDs 58% 26% 15% 2236
Include 'from', exclude 'to' 77% 13% 9% 53
Multiple return statements 55% 33% 13% 442
Overloading can be tricky 78% 15% 7% 99
Package by feature, not layer 71% 14% 16% 938
Passwords never in clear text 65% 17% 18% 138
Prefer empty items to null ones 68% 21% 11% 404
Quote dynamic text when logging 81% 13% 6% 93
Self-encapsulate fields 64% 17% 19% 184
Structs are occasionally useful 68% 16% 16% 199
Test using main method 39% 50% 11% 108
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% 113
Use Ant for build scripts 74% 15% 11% 262
Use boxing with care 67% 20% 12% 193
Use enums to restrict arguments 73% 14% 13% 123
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 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% 161
Constructors shouldn't start threads 73% 16% 11% 44
Copy constructors 64% 23% 13% 1197
Don't pass 'this' out of a constructor 62% 24% 13% 45
Initializing fields to 0-false-null is redundant 68% 23% 9% 341
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 1002
Serialization and subclassing 49% 32% 19% 100
Some classes need readResolve 76% 12% 12% 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 13% 480
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% 280
Prefer modern libraries for concurrency 94% 6% 0% 18
Query host for the number of processors 88% 9% 3% 34
Read-write locks 72% 14% 13% 97
Remember the types of intrinsic lock 81% 10% 9% 257
Schedule periodic tasks 67% 19% 14% 1929
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 65% 17% 17% 46
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 -