Poll Summary

Number Of Votes Cast
83,313
Overall Acceptance Rates
Choice Number Percentage
Yes 53,065 64%
No 18,712 22%
Undecided 11,536 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 2089
Always maintain HttpSessions 73% 17% 10% 155
Beware multilingual submit buttons 64% 21% 15% 166
Beware of common hacks 84% 8% 8% 128
Beware of custom cookies 78% 7% 15% 108
Beware of doubly escaped ampersands 77% 13% 10% 78
Beware of URL rewriting 62% 22% 16% 180
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% 794
Emit flexible URLs 73% 8% 19% 64
Escape special characters 59% 30% 12% 877
Forward versus redirect 72% 14% 14% 691
JSPs should contain only presentation logic 88% 6% 6% 227
Loss of data during restart 67% 15% 19% 102
Manage sessions closely 80% 11% 9% 152
Measure web app performance 86% 8% 6% 188
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% 202
Prefer UTF-8 in all layers 79% 9% 11% 150
Prevent self-linking 39% 54% 7% 28
Refactor large Controllers 79% 11% 11% 19
Repel invalid requests 76% 12% 12% 25
Reuse login page for errors 69% 18% 13% 194
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 22% 19% 78
Session-scope objects often Serializable 75% 13% 13% 126
Struts seems mediocre 43% 39% 18% 206
Thread-safety in web apps 75% 16% 10% 295
Understand details of FORM tags 79% 9% 12% 34
Use Cascading Style Sheets 73% 17% 9% 116
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 312
Use templates to standardize layout 48% 39% 13% 54
Validate email addresses 44% 41% 15% 381
Validate generated HTML 72% 15% 13% 320
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 47% 26% 27% 66
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 68% 16% 15% 398
Actions 69% 21% 9% 95
Align menu items 67% 20% 13% 94
Change theme 68% 18% 14% 144
Consider JGoodies Forms for layouts 72% 8% 21% 116
Don't bury dialogs 65% 15% 19% 26
Don't subclass JDialog or JFrame 30% 41% 28% 158
Filter table rows 50% 39% 11% 18
Input dialogs 52% 26% 21% 42
Launch other applications 75% 25% 0% 28
Layout Managers 63% 23% 13% 246
Look and Feel guidelines 85% 8% 6% 48
Minimal Swing application 60% 23% 16% 128
Observers and listeners 45% 30% 25% 201
Preferences dialogs 45% 16% 39% 31
Provide an uncaught exception handler 60% 22% 19% 129
Render table cells 67% 17% 16% 296
Sort table rows 45% 30% 25% 76
Splash screen 57% 31% 12% 312
Standardized dialogs 56% 33% 11% 27
Swing in general 76% 9% 15% 34
Swing threads 56% 23% 20% 163
Swing utility tasks 78% 12% 10% 40
Timers 33% 49% 18% 132
Using JavaHelp 53% 29% 17% 92
Using preferences 45% 32% 23% 66
Verify input with Model Objects 64% 18% 18% 11
Verify input with regular expressions 44% 33% 23% 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 44% 33% 24% 387
Avoid empty catch blocks 83% 11% 6% 311
Be specific in throws clause 61% 33% 7% 267
Beware of unknown root causes 38% 28% 34% 29
Checked versus unchecked exceptions 52% 28% 20% 1571
Exception translation 91% 6% 3% 125
Exceptions and control flow 70% 16% 14% 169
Finally and catch 66% 20% 14% 548
Javadoc all exceptions 56% 24% 21% 144
Pass all pertinent data to exceptions 95% 1% 4% 121
Stack trace as String 77% 14% 9% 715
Use template for repeated try-catch 65% 12% 23% 83
Input-OutputYesNoUndecidedVotes
Always close streams 75% 15% 10% 344
Buffering usually appropriate 86% 6% 8% 72
Console input 54% 29% 17% 280
Copy a file 67% 23% 10% 104
Reading and writing binary files 51% 26% 23% 283
Reading and writing Serializable objects 58% 26% 16% 371
Reading and writing text files 61% 23% 17% 3168
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 298
Connection pools 87% 6% 7% 286
Consider data layer tools 58% 18% 24% 38
Consider using standard SQL 68% 19% 13% 97
Consider wrapper classes for optional data 76% 13% 10% 68
Data access objects 64% 20% 16% 276
Data exception wrapping 74% 14% 12% 57
Data is king 88% 5% 6% 110
Don't perform basic SQL tasks in code 86% 8% 6% 71
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 54% 32% 14% 185
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 90% 3% 6% 31
Remember the basics of database design 87% 6% 6% 63
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 63% 26% 11% 27
Use template for transactions 68% 5% 26% 19
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 749
Encapsulate collections 82% 7% 11% 192
Iterate without an index 77% 17% 5% 310
Prefer Collections over older classes 85% 6% 9% 119
Two ways of using Iterator 61% 24% 15% 1411
Use for-each liberally 76% 15% 9% 246
Use interface references to Collections 70% 19% 10% 115
Use standard Collections 83% 6% 11% 174
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 34% 23% 527
Implementing compareTo 51% 33% 16% 382
Implementing equals 59% 27% 14% 311
Implementing hashCode 56% 27% 18% 377
Implementing toString 50% 31% 19% 413
Never rely on finalize 72% 16% 12% 93
Common TasksYesNoUndecidedVotes
Arrays as String 47% 36% 17% 283
Clipboard copy and paste 78% 13% 9% 1783
Command line operations 45% 39% 16% 292
Compare and sort Strings 51% 34% 15% 276
Copy an array 59% 29% 12% 630
Determine if Strings are equal 67% 24% 9% 526
Examine bytecode 50% 39% 11% 44
Fetch web page and header 64% 21% 15% 314
Generate random numbers 62% 26% 12% 11754
Get database connection 55% 28% 16% 1195
Get size of object in memory 40% 44% 17% 357
Implement code tables 58% 21% 21% 52
Internationalization 52% 28% 20% 64
Logging messages 61% 22% 17% 1484
Measure application performance 77% 14% 9% 57
Modernize old code 89% 7% 4% 57
Open file in native directory 62% 25% 12% 8
Parse text 61% 22% 18% 646
Pattern-match lines of a file 57% 28% 15% 251
Read jar version information 58% 33% 9% 90
Recovering resources 85% 9% 6% 34
Recursive file listing 73% 16% 11% 1107
Replace a substring 58% 30% 12% 395
Representing money 75% 12% 14% 509
Send an email 55% 24% 21% 2055
Time execution speed 70% 21% 8% 132
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 16% 14% 164
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 764
Immutable objects 81% 9% 9% 1148
Lazy initialization 75% 14% 11% 183
Model Objects 61% 15% 23% 111
Plugin Factory 71% 11% 18% 28
Private constructor 74% 14% 12% 879
Singleton 73% 17% 9% 307
Template method 71% 22% 7% 58
Type-Safe Enumerations 80% 11% 9% 383
Wrapper (Decorator) 59% 25% 16% 81
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 86% 7% 7% 111
Avoid raw types 79% 13% 7% 208
Beware of instanceof operator 61% 23% 15% 1820
Class for constants 64% 24% 12% 822
Construct classes from the outside in 91% 6% 3% 68
Do not break portability 75% 19% 7% 75
Don't declare local variables before use 56% 27% 18% 270
Fields should usually be private 66% 21% 13% 119
Interface for constants 32% 55% 14% 776
Know the core libraries 80% 9% 11% 115
Minimize ripple effects 86% 4% 10% 136
Naming conventions 33% 59% 8% 349
Nest classes with care 53% 27% 20% 15
Output parameters 40% 39% 21% 177
Separate public and private members 71% 18% 10% 87
String concatenation does not scale 85% 10% 6% 163
Tag or marker interfaces 66% 19% 16% 219
Uncommon classes need explicit imports 77% 14% 9% 108
Use @Override liberally 83% 9% 8% 439
Use final liberally 60% 24% 17% 636
Use javadoc liberally 75% 12% 13% 162
Use static imports rarely 58% 29% 13% 675
Use System.exit with care 67% 19% 14% 597
Use Version Control tools 70% 11% 18% 61
Validate method arguments 63% 22% 15% 232
Wisdom, not rules 96% 2% 2% 45
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 15% 168
Designing for subclassing 74% 14% 12% 69
Overridable methods need special care 83% 6% 10% 96
Remember styles of inheritance 94% 0% 6% 48
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 13% 298
Beware of Byte Order Marks 66% 28% 6% 32
Beware of DecimalFormat 44% 31% 25% 178
Beware of floating point numbers 88% 8% 3% 119
Clarifying method 91% 5% 3% 92
Coding conventions 86% 5% 10% 84
Compile regular expressions once 75% 15% 9% 53
Conditional compile 50% 39% 11% 219
Consider code generators 75% 15% 11% 75
Consider immutable forms for dates 46% 37% 17% 54
Conventional name for return value 72% 19% 9% 141
Defensive copying 87% 6% 7% 440
Design by Contract 80% 9% 11% 163
Don't use tab characters 35% 60% 5% 307
Extra space in argument list 19% 75% 6% 541
Generating unique IDs 58% 26% 16% 2289
Include 'from', exclude 'to' 77% 13% 9% 53
Multiple return statements 55% 32% 13% 447
Overloading can be tricky 78% 15% 7% 99
Package by feature, not layer 71% 14% 15% 977
Passwords never in clear text 65% 17% 18% 139
Prefer empty items to null ones 68% 21% 11% 407
Quote dynamic text when logging 81% 13% 6% 95
Self-encapsulate fields 64% 17% 19% 184
Structs are occasionally useful 67% 17% 16% 212
Test using main method 39% 50% 11% 109
Try alternatives to ResourceBundle 32% 34% 34% 62
Use a fake system clock 57% 24% 19% 134
Use a testing framework (JUnit) 83% 10% 7% 114
Use Ant for build scripts 73% 15% 12% 264
Use boxing with care 68% 20% 12% 196
Use enums to restrict arguments 74% 13% 13% 126
Validate state with class invariants 59% 24% 17% 66
Validation belongs in a Model Object 60% 30% 10% 124
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 142
Assert use cases 36% 43% 21% 201
Assertions in general 88% 12% 0% 34
Force enabling of assertions 56% 29% 15% 55
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 62% 19% 19% 529
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 30% 16% 210
Constructors in general 65% 27% 8% 48
Constructors shouldn't call overridables 60% 24% 16% 166
Constructors shouldn't start threads 73% 16% 11% 44
Copy constructors 64% 22% 13% 1217
Don't pass 'this' out of a constructor 63% 25% 12% 51
Initializing fields to 0-false-null is redundant 68% 23% 10% 346
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 1008
Serialization and subclassing 49% 32% 19% 100
Some classes need readResolve 76% 12% 12% 75
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 491
Avoid ThreadGroup 55% 25% 20% 161
Data integrity first 73% 11% 16% 145
Document thread safety 73% 18% 9% 45
Dump thread information 78% 17% 4% 23
Handle InterruptedException 54% 23% 23% 39
Launch thread is just another user thread 83% 8% 8% 36
Objects communicating across threads 70% 17% 12% 132
Perform N tasks in parallel 62% 16% 21% 288
Prefer modern libraries for concurrency 94% 6% 0% 18
Query host for the number of processors 88% 9% 3% 34
Read-write locks 71% 14% 14% 98
Remember the types of intrinsic lock 80% 10% 9% 259
Schedule periodic tasks 67% 19% 14% 1944
Stop threads through cooperation 63% 29% 8% 150
Synchronize access to mutable fields 55% 29% 16% 191
Synchronized is implementation detail 61% 25% 14% 92
Thread priorities are not portable 66% 17% 17% 47
Use finally to unlock 81% 14% 5% 37
© 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 -