Poll Summary

Number Of Votes Cast
72,528
Overall Acceptance Rates
Choice Number Percentage
Yes 46,671 64%
No 16,153 22%
Undecided 9,704 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 20% 1646
Always maintain HttpSessions 74% 17% 9% 144
Beware multilingual submit buttons 64% 19% 17% 138
Beware of common hacks 86% 8% 6% 113
Beware of custom cookies 77% 6% 17% 95
Beware of doubly escaped ampersands 77% 14% 10% 73
Beware of URL rewriting 62% 24% 15% 156
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% 739
Emit flexible URLs 74% 9% 18% 57
Escape special characters 60% 29% 11% 839
Forward versus redirect 72% 14% 14% 613
JSPs should contain only presentation logic 88% 6% 6% 222
Loss of data during restart 65% 14% 22% 88
Manage sessions closely 80% 11% 9% 147
Measure web app performance 87% 7% 6% 178
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 80% 10% 10% 131
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% 18% 11% 169
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% 200
Thread-safety in web apps 75% 16% 9% 290
Understand details of FORM tags 83% 7% 10% 29
Use Cascading Style Sheets 80% 12% 9% 93
Use extensions for fine-grained security 57% 32% 11% 44
Use Model-View-Controller framework 90% 3% 7% 297
Use templates to standardize layout 54% 36% 10% 39
Validate email addresses 44% 41% 14% 367
Validate generated HTML 73% 15% 12% 293
Web usability guidelines 85% 3% 12% 34
Wrap file upload requests 48% 27% 25% 60
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 66% 17% 17% 337
Actions 70% 20% 10% 89
Align menu items 68% 20% 12% 91
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 74% 8% 18% 103
Don't bury dialogs 62% 17% 21% 24
Don't subclass JDialog or JFrame 31% 40% 29% 140
Filter table rows 53% 40% 7% 15
Input dialogs 52% 25% 22% 40
Launch other applications 72% 28% 0% 25
Layout Managers 63% 23% 14% 218
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 62% 19% 18% 103
Observers and listeners 46% 30% 23% 175
Preferences dialogs 41% 19% 41% 27
Provide an uncaught exception handler 60% 20% 19% 103
Render table cells 68% 16% 16% 269
Sort table rows 48% 28% 23% 64
Splash screen 57% 31% 12% 287
Standardized dialogs 52% 36% 12% 25
Swing in general 76% 9% 15% 34
Swing threads 58% 23% 19% 145
Swing utility tasks 79% 13% 8% 39
Timers 34% 50% 16% 121
Using JavaHelp 56% 28% 16% 86
Using preferences 44% 33% 22% 63
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% 6% 293
Be specific in throws clause 59% 35% 7% 245
Beware of unknown root causes 35% 31% 35% 26
Checked versus unchecked exceptions 53% 28% 19% 1406
Exception translation 90% 7% 3% 105
Exceptions and control flow 70% 16% 14% 152
Finally and catch 66% 19% 14% 519
Javadoc all exceptions 56% 24% 21% 117
Pass all pertinent data to exceptions 96% 1% 3% 107
Stack trace as String 77% 14% 9% 688
Use template for repeated try-catch 61% 12% 26% 72
Input-OutputYesNoUndecidedVotes
Always close streams 77% 14% 8% 296
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% 220
Reading and writing Serializable objects 61% 25% 14% 312
Reading and writing text files 61% 22% 17% 3075
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 10% 7% 259
Connection pools 87% 6% 7% 275
Consider data layer tools 58% 19% 22% 36
Consider using standard SQL 69% 16% 15% 88
Consider wrapper classes for optional data 76% 13% 11% 62
Data access objects 64% 19% 17% 250
Data exception wrapping 73% 15% 12% 52
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 53% 33% 14% 167
Prefer PreparedStatement 90% 5% 5% 63
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% 9% 617
Encapsulate collections 83% 6% 11% 173
Iterate without an index 76% 18% 6% 284
Prefer Collections over older classes 85% 6% 9% 112
Two ways of using Iterator 62% 23% 15% 1169
Use for-each liberally 77% 16% 7% 206
Use interface references to Collections 69% 19% 12% 100
Use standard Collections 81% 7% 12% 143
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 479
Implementing compareTo 52% 32% 17% 349
Implementing equals 60% 26% 14% 279
Implementing hashCode 57% 26% 17% 363
Implementing toString 50% 30% 19% 380
Never rely on finalize 70% 18% 12% 84
Common TasksYesNoUndecidedVotes
Arrays as String 46% 36% 18% 264
Clipboard copy and paste 79% 12% 9% 1591
Command line operations 42% 41% 17% 210
Compare and sort Strings 53% 32% 15% 244
Copy an array 61% 28% 11% 586
Determine if Strings are equal 68% 24% 8% 506
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 309
Generate random numbers 63% 26% 12% 9485
Get database connection 56% 28% 16% 1122
Get size of object in memory 40% 45% 15% 330
Implement code tables 52% 21% 26% 42
Internationalization 54% 23% 23% 57
Logging messages 62% 22% 17% 1298
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% 598
Pattern-match lines of a file 58% 28% 14% 213
Read jar version information 61% 32% 7% 72
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 15% 10% 1071
Replace a substring 60% 30% 10% 373
Representing money 75% 12% 13% 455
Send an email 57% 23% 20% 1953
Time execution speed 71% 21% 7% 126
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 69% 17% 13% 150
Command objects 58% 16% 26% 19
Factory methods 63% 22% 16% 663
Immutable objects 82% 9% 9% 1004
Lazy initialization 75% 15% 10% 152
Model Objects 67% 15% 18% 93
Plugin Factory 69% 12% 19% 26
Private constructor 75% 15% 11% 807
Singleton 74% 18% 9% 291
Template method 71% 22% 7% 55
Type-Safe Enumerations 80% 11% 8% 357
Wrapper (Decorator) 64% 19% 17% 42
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 8% 7% 97
Avoid raw types 79% 14% 7% 175
Beware of instanceof operator 61% 24% 16% 1619
Class for constants 68% 20% 12% 613
Construct classes from the outside in 93% 5% 2% 55
Do not break portability 76% 18% 6% 72
Don't declare local variables before use 59% 25% 16% 220
Fields should usually be private 66% 20% 14% 107
Interface for constants 31% 57% 12% 623
Know the core libraries 85% 4% 11% 95
Minimize ripple effects 86% 3% 10% 116
Naming conventions 32% 60% 7% 322
Nest classes with care 50% 30% 20% 10
Output parameters 41% 38% 21% 151
Separate public and private members 73% 20% 7% 75
String concatenation does not scale 84% 10% 6% 154
Tag or marker interfaces 67% 20% 12% 153
Uncommon classes need explicit imports 77% 13% 10% 92
Use @Override liberally 84% 9% 7% 296
Use final liberally 60% 24% 16% 498
Use javadoc liberally 77% 12% 11% 142
Use static imports rarely 60% 26% 13% 499
Use System.exit with care 67% 19% 14% 562
Use Version Control tools 74% 13% 13% 47
Validate method arguments 64% 23% 13% 198
Wisdom, not rules 97% 3% 0% 31
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 9% 14% 148
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% 268
Beware of Byte Order Marks 68% 27% 5% 22
Beware of DecimalFormat 45% 32% 23% 164
Beware of floating point numbers 90% 8% 2% 103
Clarifying method 91% 6% 3% 86
Coding conventions 86% 5% 9% 80
Compile regular expressions once 78% 13% 9% 45
Conditional compile 50% 39% 11% 195
Consider code generators 74% 14% 12% 69
Consider immutable forms for dates 44% 38% 19% 48
Conventional name for return value 72% 20% 7% 127
Defensive copying 87% 6% 7% 380
Design by Contract 82% 9% 9% 137
Don't use tab characters 33% 63% 5% 233
Extra space in argument list 20% 74% 6% 506
Generating unique IDs 58% 27% 15% 1812
Include 'from', exclude 'to' 76% 14% 10% 51
Multiple return statements 55% 32% 12% 407
Overloading can be tricky 77% 15% 8% 86
Package by feature, not layer 70% 15% 15% 688
Passwords never in clear text 69% 17% 14% 111
Prefer empty items to null ones 70% 20% 9% 362
Quote dynamic text when logging 80% 13% 7% 84
Self-encapsulate fields 62% 17% 21% 167
Structs are occasionally useful 67% 19% 14% 113
Test using main method 39% 50% 11% 100
Try alternatives to ResourceBundle 32% 34% 34% 59
Use a fake system clock 58% 23% 18% 115
Use a testing framework (JUnit) 84% 9% 8% 104
Use Ant for build scripts 73% 15% 12% 232
Use boxing with care 66% 22% 12% 178
Use enums to restrict arguments 76% 12% 12% 101
Validate state with class invariants 57% 25% 17% 63
Validation belongs in a Model Object 60% 31% 10% 114
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 85% 11% 4% 131
Assert use cases 40% 41% 20% 167
Assertions in general 90% 10% 0% 30
Force enabling of assertions 55% 31% 14% 49
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 17% 451
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 29% 16% 194
Constructors in general 67% 27% 7% 45
Constructors shouldn't call overridables 60% 24% 16% 134
Constructors shouldn't start threads 69% 16% 16% 32
Copy constructors 65% 23% 12% 1002
Don't pass 'this' out of a constructor 64% 21% 14% 28
Initializing fields to 0-false-null is redundant 68% 24% 8% 285
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 17% 18% 915
Serialization and subclassing 51% 31% 18% 90
Some classes need readResolve 80% 9% 11% 64
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 349
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 58% 23% 19% 26
Launch thread is just another user thread 84% 6% 9% 32
Objects communicating across threads 72% 16% 12% 125
Perform N tasks in parallel 66% 16% 18% 187
Prefer modern libraries for concurrency 93% 7% 0% 15
Query host for the number of processors 93% 4% 4% 28
Read-write locks 78% 13% 9% 79
Remember the types of intrinsic lock 81% 10% 9% 249
Schedule periodic tasks 68% 19% 13% 1817
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 68% 18% 15% 40
Use finally to unlock 86% 10% 3% 29
© 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 -