Poll Summary

Number Of Votes Cast
73,993
Overall Acceptance Rates
Choice Number Percentage
Yes 47,539 64%
No 16,501 22%
Undecided 9,953 13%

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