Poll Summary

Number Of Votes Cast
70,793
Overall Acceptance Rates
Choice Number Percentage
Yes 45,602 64%
No 15,769 22%
Undecided 9,422 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 20% 1573
Always maintain HttpSessions 75% 16% 9% 141
Beware multilingual submit buttons 65% 19% 16% 132
Beware of common hacks 85% 8% 7% 107
Beware of custom cookies 78% 6% 16% 94
Beware of doubly escaped ampersands 77% 14% 10% 73
Beware of URL rewriting 61% 24% 15% 153
Choose form validation style carefully 73% 16% 11% 117
Consider Controllers for redirects 50% 24% 26% 34
Do not synchronize doGet, doPost 69% 20% 11% 733
Emit flexible URLs 73% 9% 18% 56
Escape special characters 60% 29% 11% 834
Forward versus redirect 72% 14% 14% 603
JSPs should contain only presentation logic 88% 6% 6% 220
Loss of data during restart 65% 14% 21% 86
Manage sessions closely 80% 11% 9% 147
Measure web app performance 87% 7% 6% 174
Minimize site response time 74% 13% 12% 89
Parse parameters into domain objects 38% 33% 29% 24
Pre-populate forms 46% 35% 18% 93
Prefer JSTL tags 74% 15% 11% 195
Prefer UTF-8 in all layers 80% 10% 10% 126
Prevent self-linking 38% 54% 8% 26
Refactor large Controllers 76% 12% 12% 17
Repel invalid requests 74% 13% 13% 23
Reuse login page for errors 71% 19% 10% 164
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 22% 19% 64
Session-scope objects often Serializable 74% 12% 14% 106
Struts seems mediocre 44% 38% 18% 200
Thread-safety in web apps 75% 16% 9% 288
Understand details of FORM tags 83% 7% 10% 29
Use Cascading Style Sheets 80% 13% 7% 87
Use extensions for fine-grained security 57% 31% 12% 42
Use Model-View-Controller framework 90% 3% 7% 294
Use templates to standardize layout 55% 37% 8% 38
Validate email addresses 44% 41% 14% 366
Validate generated HTML 73% 15% 12% 288
Web usability guidelines 85% 3% 12% 34
Wrap file upload requests 48% 27% 25% 60
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 66% 17% 18% 324
Actions 69% 20% 10% 88
Align menu items 68% 19% 12% 88
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 74% 8% 18% 96
Don't bury dialogs 61% 17% 22% 23
Don't subclass JDialog or JFrame 30% 40% 30% 137
Filter table rows 53% 40% 7% 15
Input dialogs 54% 23% 23% 39
Launch other applications 75% 25% 0% 24
Layout Managers 64% 24% 13% 206
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 66% 18% 16% 93
Observers and listeners 44% 32% 24% 165
Preferences dialogs 41% 19% 41% 27
Provide an uncaught exception handler 60% 21% 20% 97
Render table cells 68% 16% 17% 262
Sort table rows 48% 29% 24% 63
Splash screen 57% 31% 12% 285
Standardized dialogs 54% 33% 12% 24
Swing in general 76% 9% 15% 34
Swing threads 58% 24% 19% 140
Swing utility tasks 81% 14% 5% 37
Timers 32% 51% 16% 117
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 43% 34% 23% 35
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 46% 33% 21% 315
Avoid empty catch blocks 84% 10% 7% 288
Be specific in throws clause 59% 34% 7% 240
Beware of unknown root causes 32% 32% 36% 22
Checked versus unchecked exceptions 53% 28% 19% 1387
Exception translation 90% 7% 3% 104
Exceptions and control flow 70% 16% 14% 148
Finally and catch 66% 19% 14% 512
Javadoc all exceptions 55% 25% 21% 110
Pass all pertinent data to exceptions 96% 1% 3% 106
Stack trace as String 78% 14% 9% 685
Use template for repeated try-catch 61% 13% 26% 70
Input-OutputYesNoUndecidedVotes
Always close streams 78% 14% 9% 289
Buffering usually appropriate 90% 7% 3% 60
Console input 52% 30% 18% 236
Copy a file 70% 22% 9% 69
Reading and writing binary files 52% 24% 24% 206
Reading and writing Serializable objects 61% 25% 14% 308
Reading and writing text files 61% 22% 17% 3055
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 10% 6% 252
Connection pools 87% 6% 7% 272
Consider data layer tools 59% 21% 21% 34
Consider using standard SQL 70% 16% 14% 86
Consider wrapper classes for optional data 76% 13% 11% 62
Data access objects 64% 19% 17% 247
Data exception wrapping 75% 16% 10% 51
Data is king 88% 6% 6% 97
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% 13% 164
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% 606
Encapsulate collections 83% 6% 11% 169
Iterate without an index 76% 18% 6% 282
Prefer Collections over older classes 85% 6% 9% 110
Two ways of using Iterator 62% 24% 15% 1136
Use for-each liberally 79% 15% 7% 196
Use interface references to Collections 69% 19% 12% 100
Use standard Collections 81% 7% 12% 137
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 471
Implementing compareTo 52% 32% 16% 346
Implementing equals 60% 26% 14% 274
Implementing hashCode 57% 26% 17% 359
Implementing toString 50% 30% 20% 373
Never rely on finalize 70% 18% 12% 83
Common TasksYesNoUndecidedVotes
Arrays as String 45% 37% 18% 258
Clipboard copy and paste 79% 12% 9% 1563
Command line operations 41% 42% 16% 189
Compare and sort Strings 54% 31% 15% 237
Copy an array 61% 28% 11% 580
Determine if Strings are equal 68% 24% 8% 501
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 309
Generate random numbers 63% 26% 11% 9142
Get database connection 56% 28% 16% 1114
Get size of object in memory 40% 45% 16% 326
Implement code tables 51% 22% 27% 41
Internationalization 52% 25% 23% 52
Logging messages 62% 21% 17% 1282
Measure application performance 78% 15% 7% 54
Modernize old code 90% 6% 4% 49
Open file in native directory 67% 33% 0% 3
Parse text 60% 22% 18% 592
Pattern-match lines of a file 58% 28% 14% 203
Read jar version information 62% 33% 5% 63
Recovering resources 88% 6% 6% 33
Recursive file listing 74% 15% 10% 1064
Replace a substring 61% 29% 10% 369
Representing money 76% 11% 13% 444
Send an email 56% 23% 21% 1926
Time execution speed 71% 22% 7% 124
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 17% 13% 146
Command objects 58% 16% 26% 19
Factory methods 63% 21% 16% 646
Immutable objects 82% 9% 9% 983
Lazy initialization 75% 15% 10% 150
Model Objects 67% 15% 18% 88
Plugin Factory 71% 12% 17% 24
Private constructor 74% 15% 11% 796
Singleton 74% 18% 9% 287
Template method 70% 22% 7% 54
Type-Safe Enumerations 80% 11% 9% 352
Wrapper (Decorator) 61% 21% 18% 38
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 84% 9% 8% 93
Avoid raw types 78% 14% 8% 170
Beware of instanceof operator 61% 24% 16% 1585
Class for constants 68% 20% 12% 578
Construct classes from the outside in 93% 6% 2% 54
Do not break portability 76% 19% 6% 70
Don't declare local variables before use 60% 25% 15% 210
Fields should usually be private 66% 19% 14% 104
Interface for constants 31% 57% 12% 606
Know the core libraries 87% 3% 10% 91
Minimize ripple effects 87% 4% 10% 113
Naming conventions 32% 61% 7% 314
Nest classes with care 38% 38% 25% 8
Output parameters 41% 37% 22% 145
Separate public and private members 71% 21% 7% 70
String concatenation does not scale 84% 10% 6% 152
Tag or marker interfaces 67% 20% 13% 142
Uncommon classes need explicit imports 77% 13% 10% 90
Use @Override liberally 85% 8% 7% 261
Use final liberally 60% 23% 16% 487
Use javadoc liberally 77% 12% 11% 136
Use static imports rarely 60% 26% 14% 472
Use System.exit with care 67% 19% 14% 554
Use Version Control tools 73% 13% 13% 45
Validate method arguments 65% 23% 12% 189
Wisdom, not rules 96% 4% 0% 28
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 76% 9% 15% 143
Designing for subclassing 73% 15% 12% 59
Overridable methods need special care 84% 6% 10% 86
Remember styles of inheritance 93% 0% 7% 43
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 264
Beware of Byte Order Marks 70% 25% 5% 20
Beware of DecimalFormat 44% 32% 23% 162
Beware of floating point numbers 90% 8% 2% 103
Clarifying method 90% 6% 4% 84
Coding conventions 86% 5% 9% 80
Compile regular expressions once 77% 14% 9% 44
Conditional compile 50% 39% 11% 193
Consider code generators 74% 14% 12% 69
Consider immutable forms for dates 44% 38% 19% 48
Conventional name for return value 73% 20% 7% 124
Defensive copying 87% 5% 8% 370
Design by Contract 82% 8% 10% 133
Don't use tab characters 32% 64% 4% 224
Extra space in argument list 20% 74% 6% 504
Generating unique IDs 58% 27% 14% 1762
Include 'from', exclude 'to' 76% 14% 10% 50
Multiple return statements 56% 33% 12% 396
Overloading can be tricky 76% 15% 8% 84
Package by feature, not layer 69% 15% 16% 644
Passwords never in clear text 70% 16% 14% 107
Prefer empty items to null ones 71% 20% 9% 355
Quote dynamic text when logging 80% 12% 7% 81
Self-encapsulate fields 61% 17% 21% 163
Structs are occasionally useful 68% 20% 12% 100
Test using main method 40% 50% 10% 98
Try alternatives to ResourceBundle 32% 35% 33% 57
Use a fake system clock 59% 23% 18% 111
Use a testing framework (JUnit) 83% 9% 8% 103
Use Ant for build scripts 73% 14% 13% 226
Use boxing with care 66% 22% 12% 177
Use enums to restrict arguments 76% 12% 12% 98
Validate state with class invariants 58% 24% 18% 62
Validation belongs in a Model Object 60% 31% 9% 112
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 85% 11% 4% 128
Assert use cases 40% 41% 19% 157
Assertions in general 90% 10% 0% 30
Force enabling of assertions 54% 31% 15% 48
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 17% 445
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 30% 15% 188
Constructors in general 68% 25% 7% 44
Constructors shouldn't call overridables 61% 24% 15% 133
Constructors shouldn't start threads 72% 10% 17% 29
Copy constructors 65% 23% 12% 979
Don't pass 'this' out of a constructor 62% 25% 12% 24
Initializing fields to 0-false-null is redundant 68% 24% 8% 272
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 902
Serialization and subclassing 52% 30% 18% 89
Some classes need readResolve 80% 9% 11% 64
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 337
Avoid ThreadGroup 55% 25% 20% 154
Data integrity first 73% 11% 16% 116
Document thread safety 74% 17% 10% 42
Dump thread information 79% 16% 5% 19
Handle InterruptedException 58% 25% 17% 24
Launch thread is just another user thread 84% 6% 9% 32
Objects communicating across threads 72% 16% 12% 123
Perform N tasks in parallel 67% 15% 19% 172
Prefer modern libraries for concurrency 93% 7% 0% 14
Query host for the number of processors 93% 4% 4% 27
Read-write locks 79% 12% 9% 76
Remember the types of intrinsic lock 81% 10% 9% 248
Schedule periodic tasks 68% 20% 13% 1789
Stop threads through cooperation 63% 29% 8% 148
Synchronize access to mutable fields 55% 30% 15% 173
Synchronized is implementation detail 60% 26% 14% 84
Thread priorities are not portable 68% 18% 13% 38
Use finally to unlock 88% 12% 0% 24
© 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 -