Poll Summary

Number Of Votes Cast
69,136
Overall Acceptance Rates
Choice Number Percentage
Yes 44,619 65%
No 15,383 22%
Undecided 9,134 13%

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