Poll Summary

Number Of Votes Cast
71,827
Overall Acceptance Rates
Choice Number Percentage
Yes 46,225 64%
No 15,999 22%
Undecided 9,603 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 20% 1613
Always maintain HttpSessions 75% 16% 9% 142
Beware multilingual submit buttons 64% 19% 17% 138
Beware of common hacks 85% 8% 6% 109
Beware of custom cookies 77% 6% 17% 95
Beware of doubly escaped ampersands 77% 14% 10% 73
Beware of URL rewriting 61% 24% 15% 155
Choose form validation style carefully 72% 17% 11% 118
Consider Controllers for redirects 50% 24% 26% 34
Do not synchronize doGet, doPost 69% 20% 11% 734
Emit flexible URLs 74% 9% 18% 57
Escape special characters 60% 29% 11% 839
Forward versus redirect 73% 14% 14% 611
JSPs should contain only presentation logic 88% 6% 6% 222
Loss of data during restart 66% 14% 21% 87
Manage sessions closely 80% 11% 9% 147
Measure web app performance 87% 7% 6% 177
Minimize site response time 74% 13% 12% 90
Parse parameters into domain objects 38% 33% 29% 24
Pre-populate forms 46% 35% 18% 93
Prefer JSTL tags 73% 15% 11% 196
Prefer UTF-8 in all layers 80% 10% 10% 130
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% 166
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 60% 22% 18% 68
Session-scope objects often Serializable 74% 12% 14% 107
Struts seems mediocre 44% 38% 18% 200
Thread-safety in web apps 75% 16% 9% 289
Understand details of FORM tags 83% 7% 10% 29
Use Cascading Style Sheets 79% 12% 9% 90
Use extensions for fine-grained security 56% 33% 12% 43
Use Model-View-Controller framework 90% 3% 7% 295
Use templates to standardize layout 54% 36% 10% 39
Validate email addresses 44% 41% 14% 367
Validate generated HTML 73% 15% 12% 291
Web usability guidelines 85% 3% 12% 34
Wrap file upload requests 48% 27% 25% 60
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 66% 17% 17% 331
Actions 69% 20% 10% 88
Align menu items 69% 19% 12% 90
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 74% 8% 18% 100
Don't bury dialogs 61% 17% 22% 23
Don't subclass JDialog or JFrame 31% 40% 29% 139
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% 216
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 65% 18% 18% 97
Observers and listeners 45% 31% 24% 172
Preferences dialogs 41% 19% 41% 27
Provide an uncaught exception handler 60% 20% 20% 100
Render table cells 68% 16% 16% 267
Sort table rows 48% 29% 24% 63
Splash screen 57% 31% 12% 287
Standardized dialogs 52% 36% 12% 25
Swing in general 76% 9% 15% 34
Swing threads 58% 24% 18% 144
Swing utility tasks 82% 13% 5% 38
Timers 34% 50% 16% 120
Using JavaHelp 56% 27% 17% 84
Using preferences 45% 32% 23% 62
Verify input with Model Objects 70% 20% 10% 10
Verify input with regular expressions 42% 34% 24% 38
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 46% 33% 21% 319
Avoid empty catch blocks 84% 10% 7% 292
Be specific in throws clause 59% 35% 7% 243
Beware of unknown root causes 38% 29% 33% 24
Checked versus unchecked exceptions 53% 28% 19% 1399
Exception translation 90% 7% 3% 105
Exceptions and control flow 70% 16% 14% 152
Finally and catch 66% 19% 14% 516
Javadoc all exceptions 55% 24% 21% 112
Pass all pertinent data to exceptions 96% 1% 3% 107
Stack trace as String 78% 14% 9% 686
Use template for repeated try-catch 62% 13% 25% 71
Input-OutputYesNoUndecidedVotes
Always close streams 77% 14% 9% 293
Buffering usually appropriate 89% 7% 5% 61
Console input 52% 30% 18% 239
Copy a file 66% 22% 12% 77
Reading and writing binary files 52% 24% 24% 211
Reading and writing Serializable objects 61% 25% 14% 310
Reading and writing text files 61% 22% 17% 3063
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 9% 7% 256
Connection pools 87% 6% 7% 272
Consider data layer tools 57% 20% 23% 35
Consider using standard SQL 69% 16% 15% 87
Consider wrapper classes for optional data 76% 13% 11% 62
Data access objects 64% 19% 17% 249
Data exception wrapping 75% 16% 10% 51
Data is king 88% 6% 6% 98
Don't perform basic SQL tasks in code 85% 9% 6% 65
Encapsulate connections 79% 7% 14% 43
Keep SQL out of code 54% 33% 14% 166
Prefer PreparedStatement 90% 5% 5% 63
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% 614
Encapsulate collections 83% 6% 11% 170
Iterate without an index 76% 18% 6% 283
Prefer Collections over older classes 85% 6% 9% 111
Two ways of using Iterator 62% 23% 15% 1159
Use for-each liberally 78% 15% 7% 203
Use interface references to Collections 69% 19% 12% 100
Use standard Collections 81% 7% 12% 141
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 478
Implementing compareTo 52% 31% 16% 347
Implementing equals 60% 26% 14% 277
Implementing hashCode 57% 26% 17% 362
Implementing toString 50% 30% 20% 377
Never rely on finalize 70% 18% 12% 83
Common TasksYesNoUndecidedVotes
Arrays as String 45% 37% 18% 260
Clipboard copy and paste 79% 12% 9% 1579
Command line operations 41% 41% 17% 198
Compare and sort Strings 53% 32% 15% 242
Copy an array 61% 28% 11% 585
Determine if Strings are equal 68% 24% 8% 505
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 309
Generate random numbers 62% 26% 12% 9334
Get database connection 56% 28% 16% 1119
Get size of object in memory 40% 45% 16% 328
Implement code tables 51% 22% 27% 41
Internationalization 54% 24% 22% 54
Logging messages 62% 22% 17% 1293
Measure application performance 78% 15% 7% 55
Modernize old code 90% 6% 4% 50
Open file in native directory 67% 17% 17% 6
Parse text 60% 22% 18% 596
Pattern-match lines of a file 57% 28% 14% 208
Read jar version information 63% 31% 6% 67
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 15% 10% 1069
Replace a substring 61% 29% 10% 370
Representing money 75% 11% 13% 448
Send an email 56% 23% 21% 1944
Time execution speed 71% 22% 7% 125
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 69% 17% 13% 150
Command objects 58% 16% 26% 19
Factory methods 63% 21% 16% 655
Immutable objects 82% 9% 9% 995
Lazy initialization 75% 15% 10% 151
Model Objects 67% 15% 18% 91
Plugin Factory 71% 12% 17% 24
Private constructor 75% 15% 11% 803
Singleton 73% 18% 9% 290
Template method 71% 22% 7% 55
Type-Safe Enumerations 80% 11% 8% 355
Wrapper (Decorator) 63% 20% 17% 41
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 84% 8% 7% 95
Avoid raw types 79% 14% 7% 174
Beware of instanceof operator 61% 24% 16% 1606
Class for constants 68% 20% 12% 603
Construct classes from the outside in 93% 5% 2% 55
Do not break portability 76% 18% 6% 71
Don't declare local variables before use 59% 25% 16% 218
Fields should usually be private 66% 20% 14% 106
Interface for constants 31% 57% 12% 614
Know the core libraries 87% 3% 10% 93
Minimize ripple effects 86% 3% 10% 115
Naming conventions 33% 60% 8% 318
Nest classes with care 44% 33% 22% 9
Output parameters 41% 38% 21% 150
Separate public and private members 72% 21% 7% 71
String concatenation does not scale 84% 10% 6% 154
Tag or marker interfaces 66% 21% 13% 148
Uncommon classes need explicit imports 77% 13% 10% 91
Use @Override liberally 84% 9% 7% 285
Use final liberally 60% 23% 17% 496
Use javadoc liberally 77% 12% 11% 140
Use static imports rarely 60% 27% 13% 489
Use System.exit with care 67% 19% 14% 559
Use Version Control tools 74% 13% 13% 46
Validate method arguments 65% 23% 12% 194
Wisdom, not rules 97% 3% 0% 29
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 9% 14% 145
Designing for subclassing 73% 15% 12% 60
Overridable methods need special care 84% 6% 10% 88
Remember styles of inheritance 93% 0% 7% 43
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 267
Beware of Byte Order Marks 70% 25% 5% 20
Beware of DecimalFormat 45% 32% 23% 164
Beware of floating point numbers 90% 8% 2% 103
Clarifying method 91% 6% 4% 85
Coding conventions 86% 5% 9% 80
Compile regular expressions once 78% 13% 9% 45
Conditional compile 51% 39% 11% 194
Consider code generators 74% 14% 12% 69
Consider immutable forms for dates 44% 38% 19% 48
Conventional name for return value 72% 21% 7% 126
Defensive copying 87% 6% 7% 375
Design by Contract 82% 9% 10% 136
Don't use tab characters 32% 63% 5% 230
Extra space in argument list 20% 74% 6% 505
Generating unique IDs 58% 27% 14% 1791
Include 'from', exclude 'to' 76% 14% 10% 51
Multiple return statements 55% 33% 12% 402
Overloading can be tricky 76% 15% 8% 85
Package by feature, not layer 70% 15% 15% 671
Passwords never in clear text 69% 17% 14% 111
Prefer empty items to null ones 71% 20% 9% 357
Quote dynamic text when logging 80% 12% 7% 81
Self-encapsulate fields 62% 17% 21% 165
Structs are occasionally useful 67% 19% 13% 104
Test using main method 39% 51% 10% 99
Try alternatives to ResourceBundle 31% 34% 34% 58
Use a fake system clock 58% 23% 18% 115
Use a testing framework (JUnit) 83% 9% 8% 103
Use Ant for build scripts 73% 14% 13% 230
Use boxing with care 66% 22% 12% 177
Use enums to restrict arguments 76% 12% 12% 100
Validate state with class invariants 57% 25% 17% 63
Validation belongs in a Model Object 59% 31% 10% 113
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 85% 12% 4% 130
Assert use cases 40% 40% 20% 165
Assertions in general 90% 10% 0% 30
Force enabling of assertions 55% 31% 14% 49
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 17% 449
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 29% 16% 191
Constructors in general 67% 27% 7% 45
Constructors shouldn't call overridables 61% 24% 15% 133
Constructors shouldn't start threads 69% 16% 16% 32
Copy constructors 65% 23% 12% 993
Don't pass 'this' out of a constructor 64% 24% 12% 25
Initializing fields to 0-false-null is redundant 68% 24% 8% 281
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 17% 18% 909
Serialization and subclassing 51% 31% 18% 90
Some classes need readResolve 80% 9% 11% 64
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 345
Avoid ThreadGroup 55% 25% 20% 154
Data integrity first 74% 11% 15% 118
Document thread safety 74% 17% 10% 42
Dump thread information 80% 15% 5% 20
Handle InterruptedException 60% 24% 16% 25
Launch thread is just another user thread 84% 6% 9% 32
Objects communicating across threads 72% 16% 12% 124
Perform N tasks in parallel 66% 16% 18% 179
Prefer modern libraries for concurrency 93% 7% 0% 14
Query host for the number of processors 93% 4% 4% 27
Read-write locks 78% 13% 9% 78
Remember the types of intrinsic lock 81% 10% 9% 249
Schedule periodic tasks 67% 20% 13% 1807
Stop threads through cooperation 63% 29% 8% 148
Synchronize access to mutable fields 56% 30% 15% 176
Synchronized is implementation detail 60% 26% 14% 85
Thread priorities are not portable 67% 18% 15% 39
Use finally to unlock 85% 12% 4% 26
© 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 -