Poll Summary

Number Of Votes Cast
64,842
Overall Acceptance Rates
Choice Number Percentage
Yes 42,032 65%
No 14,376 22%
Undecided 8,434 13%

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