Poll Summary

Number Of Votes Cast
80,963
Overall Acceptance Rates
Choice Number Percentage
Yes 51,676 64%
No 18,154 22%
Undecided 11,133 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 1976
Always maintain HttpSessions 74% 17% 10% 151
Beware multilingual submit buttons 65% 19% 16% 159
Beware of common hacks 84% 8% 8% 126
Beware of custom cookies 78% 7% 15% 107
Beware of doubly escaped ampersands 78% 13% 9% 77
Beware of URL rewriting 63% 23% 15% 172
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% 782
Emit flexible URLs 73% 8% 19% 63
Escape special characters 60% 29% 12% 866
Forward versus redirect 72% 14% 14% 671
JSPs should contain only presentation logic 88% 6% 6% 226
Loss of data during restart 65% 15% 19% 98
Manage sessions closely 81% 11% 9% 151
Measure web app performance 86% 8% 6% 186
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% 200
Prefer UTF-8 in all layers 80% 9% 12% 147
Prevent self-linking 41% 52% 7% 27
Refactor large Controllers 79% 11% 11% 19
Repel invalid requests 76% 12% 12% 25
Reuse login page for errors 70% 18% 12% 189
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 22% 18% 76
Session-scope objects often Serializable 75% 12% 13% 123
Struts seems mediocre 43% 39% 18% 205
Thread-safety in web apps 75% 16% 10% 294
Understand details of FORM tags 79% 9% 12% 34
Use Cascading Style Sheets 74% 16% 10% 113
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 305
Use templates to standardize layout 51% 40% 9% 47
Validate email addresses 44% 41% 15% 379
Validate generated HTML 72% 15% 13% 312
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 47% 27% 27% 64
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 68% 16% 16% 389
Actions 71% 20% 10% 92
Align menu items 67% 20% 13% 93
Change theme 68% 18% 14% 144
Consider JGoodies Forms for layouts 72% 8% 20% 113
Don't bury dialogs 64% 16% 20% 25
Don't subclass JDialog or JFrame 31% 41% 28% 156
Filter table rows 50% 39% 11% 18
Input dialogs 54% 24% 22% 41
Launch other applications 73% 27% 0% 26
Layout Managers 63% 23% 14% 240
Look and Feel guidelines 85% 8% 6% 48
Minimal Swing application 60% 23% 17% 122
Observers and listeners 45% 30% 25% 195
Preferences dialogs 45% 16% 39% 31
Provide an uncaught exception handler 60% 22% 18% 127
Render table cells 67% 16% 16% 286
Sort table rows 45% 30% 26% 74
Splash screen 56% 31% 13% 308
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 56% 24% 20% 159
Swing utility tasks 78% 12% 10% 40
Timers 33% 49% 18% 132
Using JavaHelp 53% 30% 18% 91
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 43% 33% 24% 369
Avoid empty catch blocks 83% 10% 6% 307
Be specific in throws clause 60% 33% 7% 257
Beware of unknown root causes 33% 30% 37% 27
Checked versus unchecked exceptions 52% 28% 20% 1534
Exception translation 91% 6% 3% 123
Exceptions and control flow 69% 16% 15% 165
Finally and catch 66% 20% 14% 541
Javadoc all exceptions 55% 24% 21% 139
Pass all pertinent data to exceptions 95% 1% 4% 118
Stack trace as String 77% 14% 9% 712
Use template for repeated try-catch 65% 11% 23% 81
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 9% 337
Buffering usually appropriate 87% 6% 7% 69
Console input 54% 29% 17% 271
Copy a file 66% 24% 10% 101
Reading and writing binary files 50% 26% 24% 268
Reading and writing Serializable objects 58% 26% 16% 361
Reading and writing text files 61% 23% 17% 3149
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 291
Connection pools 87% 6% 7% 283
Consider data layer tools 58% 18% 24% 38
Consider using standard SQL 68% 18% 14% 94
Consider wrapper classes for optional data 76% 13% 10% 68
Data access objects 64% 20% 17% 271
Data exception wrapping 74% 14% 12% 57
Data is king 88% 6% 7% 107
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% 13% 181
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 90% 3% 6% 31
Remember the basics of database design 89% 7% 5% 61
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% 10% 709
Encapsulate collections 81% 7% 12% 188
Iterate without an index 77% 17% 6% 308
Prefer Collections over older classes 85% 6% 9% 118
Two ways of using Iterator 61% 24% 15% 1358
Use for-each liberally 76% 15% 9% 243
Use interface references to Collections 71% 19% 11% 112
Use standard Collections 83% 7% 11% 166
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 35% 22% 514
Implementing compareTo 51% 33% 16% 374
Implementing equals 60% 27% 13% 304
Implementing hashCode 56% 27% 17% 374
Implementing toString 50% 31% 19% 409
Never rely on finalize 72% 16% 12% 92
Common TasksYesNoUndecidedVotes
Arrays as String 46% 36% 17% 281
Clipboard copy and paste 78% 13% 9% 1732
Command line operations 45% 39% 17% 277
Compare and sort Strings 51% 33% 15% 272
Copy an array 60% 29% 12% 622
Determine if Strings are equal 67% 24% 9% 526
Examine bytecode 51% 37% 12% 43
Fetch web page and header 64% 21% 15% 314
Generate random numbers 62% 26% 12% 11296
Get database connection 55% 28% 16% 1176
Get size of object in memory 39% 44% 16% 352
Implement code tables 58% 21% 21% 52
Internationalization 51% 29% 21% 63
Logging messages 62% 22% 16% 1440
Measure application performance 77% 14% 9% 57
Modernize old code 89% 7% 4% 55
Open file in native directory 62% 25% 12% 8
Parse text 61% 22% 18% 642
Pattern-match lines of a file 58% 27% 15% 241
Read jar version information 58% 34% 8% 88
Recovering resources 85% 9% 6% 34
Recursive file listing 73% 16% 11% 1099
Replace a substring 58% 30% 12% 391
Representing money 75% 12% 13% 490
Send an email 55% 24% 21% 2039
Time execution speed 71% 22% 8% 129
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 16% 14% 161
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 750
Immutable objects 82% 9% 9% 1114
Lazy initialization 75% 14% 11% 178
Model Objects 64% 14% 21% 104
Plugin Factory 70% 11% 19% 27
Private constructor 74% 15% 12% 866
Singleton 73% 17% 10% 304
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 379
Wrapper (Decorator) 60% 24% 16% 67
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 7% 7% 109
Avoid raw types 79% 13% 8% 195
Beware of instanceof operator 61% 24% 16% 1784
Class for constants 67% 20% 13% 748
Construct classes from the outside in 91% 6% 3% 65
Do not break portability 76% 19% 5% 74
Don't declare local variables before use 56% 26% 17% 262
Fields should usually be private 66% 20% 14% 118
Interface for constants 32% 55% 13% 738
Know the core libraries 81% 8% 11% 111
Minimize ripple effects 85% 4% 11% 131
Naming conventions 32% 60% 8% 346
Nest classes with care 54% 31% 15% 13
Output parameters 41% 38% 21% 171
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% 206
Uncommon classes need explicit imports 77% 14% 9% 104
Use @Override liberally 82% 10% 8% 417
Use final liberally 60% 23% 16% 608
Use javadoc liberally 76% 11% 12% 157
Use static imports rarely 58% 28% 13% 640
Use System.exit with care 67% 19% 14% 588
Use Version Control tools 69% 12% 19% 58
Validate method arguments 63% 22% 15% 228
Wisdom, not rules 95% 2% 2% 43
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 15% 164
Designing for subclassing 74% 15% 12% 68
Overridable methods need special care 83% 6% 10% 96
Remember styles of inheritance 94% 0% 6% 47
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 24% 14% 292
Beware of Byte Order Marks 70% 27% 3% 30
Beware of DecimalFormat 44% 31% 24% 176
Beware of floating point numbers 89% 9% 3% 114
Clarifying method 91% 5% 3% 91
Coding conventions 86% 5% 10% 84
Compile regular expressions once 76% 16% 8% 50
Conditional compile 51% 39% 10% 213
Consider code generators 76% 14% 11% 74
Consider immutable forms for dates 46% 37% 17% 54
Conventional name for return value 72% 19% 9% 139
Defensive copying 87% 6% 7% 424
Design by Contract 81% 9% 9% 159
Don't use tab characters 35% 60% 5% 295
Extra space in argument list 19% 75% 6% 537
Generating unique IDs 58% 26% 15% 2153
Include 'from', exclude 'to' 77% 13% 9% 53
Multiple return statements 55% 33% 13% 437
Overloading can be tricky 77% 16% 7% 96
Package by feature, not layer 71% 14% 15% 891
Passwords never in clear text 66% 17% 16% 134
Prefer empty items to null ones 69% 20% 11% 396
Quote dynamic text when logging 80% 13% 7% 92
Self-encapsulate fields 63% 17% 19% 183
Structs are occasionally useful 68% 15% 16% 188
Test using main method 40% 49% 11% 106
Try alternatives to ResourceBundle 32% 34% 34% 62
Use a fake system clock 58% 23% 19% 130
Use a testing framework (JUnit) 83% 10% 7% 112
Use Ant for build scripts 74% 14% 12% 257
Use boxing with care 67% 20% 12% 192
Use enums to restrict arguments 74% 14% 12% 121
Validate state with class invariants 59% 24% 17% 66
Validation belongs in a Model Object 60% 30% 10% 122
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 141
Assert use cases 37% 42% 21% 196
Assertions in general 88% 12% 0% 34
Force enabling of assertions 56% 30% 15% 54
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 63% 19% 19% 523
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 54% 30% 16% 207
Constructors in general 65% 27% 8% 48
Constructors shouldn't call overridables 60% 24% 16% 158
Constructors shouldn't start threads 72% 15% 12% 40
Copy constructors 65% 23% 13% 1169
Don't pass 'this' out of a constructor 60% 26% 14% 43
Initializing fields to 0-false-null is redundant 68% 23% 9% 333
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 990
Serialization and subclassing 49% 31% 19% 99
Some classes need readResolve 76% 12% 12% 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 12% 13% 454
Avoid ThreadGroup 55% 25% 20% 158
Data integrity first 73% 11% 16% 139
Document thread safety 73% 18% 9% 45
Dump thread information 77% 18% 5% 22
Handle InterruptedException 59% 25% 16% 32
Launch thread is just another user thread 85% 6% 9% 34
Objects communicating across threads 71% 17% 12% 131
Perform N tasks in parallel 63% 17% 20% 274
Prefer modern libraries for concurrency 94% 6% 0% 16
Query host for the number of processors 91% 6% 3% 33
Read-write locks 72% 14% 13% 97
Remember the types of intrinsic lock 81% 10% 9% 257
Schedule periodic tasks 67% 19% 14% 1911
Stop threads through cooperation 63% 29% 8% 149
Synchronize access to mutable fields 55% 29% 16% 186
Synchronized is implementation detail 61% 25% 14% 92
Thread priorities are not portable 65% 17% 17% 46
Use finally to unlock 83% 11% 6% 35
© 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 -