Poll Summary

Number Of Votes Cast
66,787
Overall Acceptance Rates
Choice Number Percentage
Yes 43,237 65%
No 14,799 22%
Undecided 8,751 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 1380
Always maintain HttpSessions 75% 15% 10% 136
Beware multilingual submit buttons 63% 20% 17% 124
Beware of common hacks 85% 8% 7% 101
Beware of custom cookies 82% 7% 11% 88
Beware of doubly escaped ampersands 77% 14% 9% 70
Beware of URL rewriting 62% 24% 13% 141
Choose form validation style carefully 73% 17% 11% 113
Consider Controllers for redirects 48% 24% 27% 33
Do not synchronize doGet, doPost 69% 20% 11% 720
Emit flexible URLs 74% 9% 17% 53
Escape special characters 61% 28% 11% 819
Forward versus redirect 72% 14% 14% 576
JSPs should contain only presentation logic 88% 6% 6% 217
Loss of data during restart 64% 16% 21% 77
Manage sessions closely 81% 11% 8% 146
Measure web app performance 87% 7% 7% 165
Minimize site response time 74% 14% 12% 88
Parse parameters into domain objects 32% 36% 32% 22
Pre-populate forms 48% 34% 18% 90
Prefer JSTL tags 74% 15% 11% 192
Prefer UTF-8 in all layers 80% 10% 11% 122
Prevent self-linking 42% 50% 8% 24
Refactor large Controllers 76% 12% 12% 17
Repel invalid requests 74% 13% 13% 23
Reuse login page for errors 70% 19% 11% 155
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 57% 22% 21% 58
Session-scope objects often Serializable 75% 12% 14% 103
Struts seems mediocre 44% 37% 19% 198
Thread-safety in web apps 75% 16% 9% 284
Understand details of FORM tags 81% 7% 11% 27
Use Cascading Style Sheets 81% 13% 6% 79
Use extensions for fine-grained security 57% 30% 14% 37
Use Model-View-Controller framework 90% 3% 7% 289
Use templates to standardize layout 55% 37% 8% 38
Validate email addresses 44% 41% 14% 360
Validate generated HTML 73% 15% 12% 274
Web usability guidelines 85% 3% 12% 33
Wrap file upload requests 47% 28% 26% 58
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 65% 17% 18% 303
Actions 68% 21% 11% 82
Align menu items 67% 20% 13% 86
Change theme 70% 16% 14% 137
Consider JGoodies Forms for layouts 76% 8% 17% 90
Don't bury dialogs 61% 17% 22% 23
Don't subclass JDialog or JFrame 30% 40% 30% 128
Filter table rows 53% 40% 7% 15
Input dialogs 54% 23% 23% 35
Launch other applications 77% 23% 0% 22
Layout Managers 65% 24% 11% 188
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 68% 17% 15% 78
Observers and listeners 45% 30% 24% 143
Preferences dialogs 38% 19% 42% 26
Provide an uncaught exception handler 60% 20% 19% 88
Render table cells 69% 14% 17% 253
Sort table rows 48% 29% 23% 56
Splash screen 58% 30% 12% 275
Standardized dialogs 54% 33% 12% 24
Swing in general 76% 9% 15% 33
Swing threads 58% 23% 18% 137
Swing utility tasks 80% 14% 6% 35
Timers 32% 52% 16% 114
Using JavaHelp 55% 28% 17% 83
Using preferences 44% 33% 23% 61
Verify input with Model Objects 70% 20% 10% 10
Verify input with regular expressions 45% 33% 21% 33
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 45% 33% 21% 288
Avoid empty catch blocks 84% 10% 7% 280
Be specific in throws clause 58% 35% 7% 232
Beware of unknown root causes 33% 29% 38% 21
Checked versus unchecked exceptions 53% 29% 19% 1332
Exception translation 91% 6% 3% 100
Exceptions and control flow 69% 16% 15% 139
Finally and catch 67% 19% 14% 494
Javadoc all exceptions 55% 25% 21% 97
Pass all pertinent data to exceptions 96% 1% 3% 102
Stack trace as String 77% 14% 9% 673
Use template for repeated try-catch 62% 11% 27% 64
Input-OutputYesNoUndecidedVotes
Always close streams 78% 14% 8% 275
Buffering usually appropriate 90% 7% 3% 58
Console input 52% 31% 17% 215
Copy a file 70% 22% 8% 60
Reading and writing binary files 51% 25% 24% 180
Reading and writing Serializable objects 63% 24% 13% 279
Reading and writing text files 62% 22% 16% 2991
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 10% 6% 243
Connection pools 87% 6% 6% 263
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% 235
Data exception wrapping 76% 16% 8% 49
Data is king 88% 7% 5% 91
Don't perform basic SQL tasks in code 84% 9% 6% 64
Encapsulate connections 81% 7% 12% 42
Keep SQL out of code 54% 32% 13% 157
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 50% 28% 22% 18
Try pseudo-persistence for mock ups 74% 13% 13% 23
Use template for transactions 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 552
Encapsulate collections 83% 6% 11% 162
Iterate without an index 76% 19% 6% 270
Prefer Collections over older classes 83% 7% 10% 103
Two ways of using Iterator 63% 23% 15% 1053
Use for-each liberally 81% 13% 7% 181
Use interface references to Collections 68% 20% 12% 94
Use standard Collections 81% 7% 12% 125
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 36% 22% 455
Implementing compareTo 53% 32% 16% 326
Implementing equals 60% 27% 14% 267
Implementing hashCode 57% 26% 17% 356
Implementing toString 49% 31% 20% 352
Never rely on finalize 69% 19% 12% 80
Common TasksYesNoUndecidedVotes
Arrays as String 44% 38% 18% 252
Clipboard copy and paste 80% 12% 8% 1498
Command line operations 44% 43% 14% 155
Compare and sort Strings 56% 29% 15% 221
Copy an array 62% 28% 11% 556
Determine if Strings are equal 70% 22% 8% 481
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 307
Generate random numbers 64% 26% 11% 8366
Get database connection 56% 28% 16% 1081
Get size of object in memory 39% 45% 16% 316
Implement code tables 51% 22% 27% 37
Internationalization 53% 24% 22% 49
Logging messages 62% 21% 16% 1232
Measure application performance 78% 15% 7% 54
Modernize old code 89% 6% 4% 47
Open file in native directory 100% 0% 0% 1
Parse text 61% 21% 18% 578
Pattern-match lines of a file 59% 27% 14% 194
Read jar version information 61% 33% 6% 51
Recovering resources 88% 6% 6% 33
Recursive file listing 74% 15% 11% 1038
Replace a substring 60% 29% 10% 360
Representing money 76% 11% 13% 427
Send an email 57% 23% 20% 1876
Time execution speed 72% 22% 6% 120
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 68% 18% 13% 136
Command objects 58% 16% 26% 19
Factory methods 63% 21% 16% 619
Immutable objects 83% 9% 9% 925
Lazy initialization 75% 15% 10% 136
Model Objects 67% 13% 19% 83
Plugin Factory 71% 12% 17% 24
Private constructor 75% 15% 11% 767
Singleton 73% 18% 9% 278
Template method 72% 21% 8% 53
Type-Safe Enumerations 80% 12% 9% 347
Wrapper (Decorator) 59% 21% 21% 29
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 86% 8% 6% 85
Avoid raw types 78% 15% 7% 161
Beware of instanceof operator 61% 23% 16% 1513
Class for constants 68% 20% 12% 526
Construct classes from the outside in 92% 6% 2% 50
Do not break portability 75% 19% 6% 67
Don't declare local variables before use 60% 26% 14% 191
Fields should usually be private 67% 20% 14% 102
Interface for constants 32% 57% 11% 567
Know the core libraries 88% 1% 11% 84
Minimize ripple effects 88% 4% 8% 102
Naming conventions 32% 61% 7% 296
Nest classes with care 33% 33% 33% 6
Output parameters 43% 36% 20% 137
Separate public and private members 70% 23% 6% 64
String concatenation does not scale 85% 9% 6% 151
Tag or marker interfaces 68% 22% 11% 120
Uncommon classes need explicit imports 77% 12% 11% 83
Use @Override liberally 85% 8% 7% 213
Use final liberally 61% 24% 15% 433
Use javadoc liberally 78% 11% 12% 129
Use static imports rarely 61% 26% 13% 410
Use System.exit with care 67% 19% 14% 534
Use Version Control tools 70% 16% 14% 37
Validate method arguments 66% 23% 11% 176
Wisdom, not rules 100% 0% 0% 25
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 15% 132
Designing for subclassing 73% 15% 12% 59
Overridable methods need special care 83% 6% 11% 84
Remember styles of inheritance 93% 0% 7% 41
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 24% 13% 250
Beware of Byte Order Marks 62% 31% 8% 13
Beware of DecimalFormat 44% 33% 23% 158
Beware of floating point numbers 91% 7% 2% 96
Clarifying method 91% 6% 2% 80
Coding conventions 86% 5% 9% 78
Compile regular expressions once 79% 12% 10% 42
Conditional compile 51% 38% 11% 179
Consider code generators 76% 13% 10% 67
Consider immutable forms for dates 46% 39% 15% 46
Conventional name for return value 73% 20% 7% 118
Defensive copying 87% 6% 8% 356
Design by Contract 83% 7% 10% 121
Don't use tab characters 30% 65% 4% 214
Extra space in argument list 20% 73% 6% 489
Generating unique IDs 59% 27% 14% 1604
Include 'from', exclude 'to' 75% 15% 10% 48
Multiple return statements 56% 32% 12% 370
Overloading can be tricky 75% 16% 9% 81
Package by feature, not layer 67% 16% 17% 565
Passwords never in clear text 68% 17% 15% 95
Prefer empty items to null ones 71% 20% 9% 341
Quote dynamic text when logging 81% 12% 7% 74
Self-encapsulate fields 62% 18% 21% 159
Structs are occasionally useful 71% 18% 11% 66
Test using main method 40% 50% 10% 98
Try alternatives to ResourceBundle 32% 36% 32% 53
Use a fake system clock 62% 24% 14% 100
Use a testing framework (JUnit) 83% 9% 8% 101
Use Ant for build scripts 75% 14% 11% 212
Use boxing with care 65% 22% 13% 169
Use enums to restrict arguments 75% 12% 13% 92
Validate state with class invariants 59% 25% 15% 59
Validation belongs in a Model Object 60% 32% 8% 107
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 86% 11% 3% 125
Assert use cases 41% 40% 18% 141
Assertions in general 90% 10% 0% 29
Force enabling of assertions 55% 30% 15% 47
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 16% 424
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 56% 30% 15% 178
Constructors in general 67% 26% 7% 43
Constructors shouldn't call overridables 60% 25% 15% 126
Constructors shouldn't start threads 77% 9% 14% 22
Copy constructors 66% 22% 12% 901
Don't pass 'this' out of a constructor 60% 30% 10% 20
Initializing fields to 0-false-null is redundant 68% 24% 8% 253
SerializationYesNoUndecidedVotes
Implementing Serializable 65% 17% 18% 865
Serialization and subclassing 52% 31% 16% 86
Some classes need readResolve 80% 10% 10% 60
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 12% 13% 277
Avoid ThreadGroup 55% 25% 20% 153
Data integrity first 70% 12% 17% 105
Document thread safety 75% 15% 10% 40
Dump thread information 79% 16% 5% 19
Handle InterruptedException 65% 20% 15% 20
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% 13% 19% 139
Prefer modern libraries for concurrency 100% 0% 0% 13
Query host for the number of processors 92% 4% 4% 25
Read-write locks 83% 10% 7% 69
Remember the types of intrinsic lock 80% 10% 9% 244
Schedule periodic tasks 68% 19% 13% 1726
Stop threads through cooperation 63% 29% 8% 147
Synchronize access to mutable fields 54% 31% 15% 170
Synchronized is implementation detail 60% 26% 14% 84
Thread priorities are not portable 67% 19% 14% 36
Use finally to unlock 89% 11% 0% 19
© 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 -