Poll Summary

Number Of Votes Cast
74,831
Overall Acceptance Rates
Choice Number Percentage
Yes 48,071 64%
No 16,660 22%
Undecided 10,100 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 21% 1740
Always maintain HttpSessions 75% 16% 9% 147
Beware multilingual submit buttons 64% 20% 16% 146
Beware of common hacks 84% 8% 8% 118
Beware of custom cookies 78% 6% 16% 101
Beware of doubly escaped ampersands 77% 13% 9% 75
Beware of URL rewriting 62% 23% 15% 160
Choose form validation style carefully 72% 18% 11% 120
Consider Controllers for redirects 49% 22% 30% 37
Do not synchronize doGet, doPost 69% 20% 11% 747
Emit flexible URLs 73% 8% 19% 59
Escape special characters 60% 29% 11% 847
Forward versus redirect 72% 14% 14% 633
JSPs should contain only presentation logic 88% 6% 6% 224
Loss of data during restart 64% 15% 21% 91
Manage sessions closely 81% 11% 9% 149
Measure web app performance 86% 8% 6% 184
Minimize site response time 74% 13% 13% 91
Parse parameters into domain objects 38% 33% 29% 24
Pre-populate forms 46% 35% 19% 96
Prefer JSTL tags 73% 15% 11% 196
Prefer UTF-8 in all layers 81% 10% 10% 135
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% 19% 11% 176
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 23% 19% 70
Session-scope objects often Serializable 74% 12% 14% 113
Struts seems mediocre 44% 38% 18% 201
Thread-safety in web apps 75% 16% 9% 291
Understand details of FORM tags 80% 7% 13% 30
Use Cascading Style Sheets 76% 14% 10% 100
Use extensions for fine-grained security 57% 32% 11% 44
Use Model-View-Controller framework 90% 3% 7% 298
Use templates to standardize layout 52% 38% 10% 40
Validate email addresses 44% 41% 14% 369
Validate generated HTML 72% 15% 12% 297
Web usability guidelines 86% 3% 11% 35
Wrap file upload requests 47% 26% 27% 62
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 67% 17% 16% 354
Actions 70% 20% 10% 89
Align menu items 68% 20% 12% 91
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 72% 8% 19% 109
Don't bury dialogs 62% 17% 21% 24
Don't subclass JDialog or JFrame 31% 40% 29% 145
Filter table rows 50% 38% 12% 16
Input dialogs 52% 25% 22% 40
Launch other applications 72% 28% 0% 25
Layout Managers 63% 23% 13% 223
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 61% 20% 19% 108
Observers and listeners 46% 30% 23% 183
Preferences dialogs 43% 18% 39% 28
Provide an uncaught exception handler 59% 21% 20% 112
Render table cells 67% 16% 17% 275
Sort table rows 47% 29% 24% 68
Splash screen 56% 31% 13% 294
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 58% 24% 18% 147
Swing utility tasks 79% 13% 8% 39
Timers 33% 49% 18% 129
Using JavaHelp 55% 29% 16% 87
Using preferences 45% 33% 22% 64
Verify input with Model Objects 70% 20% 10% 10
Verify input with regular expressions 44% 33% 23% 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 46% 33% 21% 327
Avoid empty catch blocks 83% 10% 6% 299
Be specific in throws clause 58% 34% 7% 248
Beware of unknown root causes 33% 30% 37% 27
Checked versus unchecked exceptions 53% 28% 19% 1438
Exception translation 91% 6% 3% 108
Exceptions and control flow 70% 15% 15% 156
Finally and catch 67% 19% 14% 527
Javadoc all exceptions 56% 23% 21% 124
Pass all pertinent data to exceptions 95% 1% 5% 111
Stack trace as String 77% 14% 9% 694
Use template for repeated try-catch 62% 12% 26% 74
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 8% 309
Buffering usually appropriate 89% 6% 5% 62
Console input 53% 29% 18% 247
Copy a file 66% 23% 10% 86
Reading and writing binary files 51% 25% 24% 236
Reading and writing Serializable objects 59% 26% 15% 323
Reading and writing text files 61% 22% 17% 3101
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 270
Connection pools 87% 6% 7% 278
Consider data layer tools 57% 19% 24% 37
Consider using standard SQL 68% 17% 14% 92
Consider wrapper classes for optional data 76% 13% 11% 63
Data access objects 64% 19% 17% 256
Data exception wrapping 74% 15% 11% 53
Data is king 88% 6% 6% 100
Don't perform basic SQL tasks in code 85% 9% 6% 68
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 54% 32% 14% 170
Prefer PreparedStatement 89% 5% 6% 65
Reduce database code duplication 93% 0% 7% 28
Remember the basics of database design 88% 7% 5% 57
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 65% 23% 12% 26
Use template for transactions 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 81% 9% 10% 643
Encapsulate collections 82% 7% 11% 177
Iterate without an index 76% 18% 6% 293
Prefer Collections over older classes 85% 6% 9% 113
Two ways of using Iterator 62% 23% 15% 1212
Use for-each liberally 77% 16% 7% 216
Use interface references to Collections 69% 19% 12% 104
Use standard Collections 82% 7% 11% 148
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 486
Implementing compareTo 52% 32% 17% 352
Implementing equals 60% 27% 13% 289
Implementing hashCode 56% 26% 17% 369
Implementing toString 51% 30% 19% 388
Never rely on finalize 70% 17% 13% 86
Common TasksYesNoUndecidedVotes
Arrays as String 46% 37% 17% 270
Clipboard copy and paste 79% 12% 9% 1621
Command line operations 44% 39% 18% 234
Compare and sort Strings 53% 32% 15% 249
Copy an array 61% 28% 11% 595
Determine if Strings are equal 68% 24% 8% 513
Examine bytecode 51% 38% 10% 39
Fetch web page and header 65% 20% 15% 311
Generate random numbers 62% 26% 12% 9886
Get database connection 56% 28% 16% 1133
Get size of object in memory 40% 44% 16% 339
Implement code tables 54% 22% 24% 46
Internationalization 53% 25% 22% 59
Logging messages 61% 22% 17% 1349
Measure application performance 78% 15% 7% 55
Modernize old code 90% 6% 4% 51
Open file in native directory 71% 14% 14% 7
Parse text 61% 22% 17% 612
Pattern-match lines of a file 58% 28% 14% 220
Read jar version information 60% 32% 8% 80
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 15% 10% 1080
Replace a substring 60% 30% 11% 379
Representing money 75% 12% 13% 462
Send an email 56% 23% 21% 1986
Time execution speed 70% 22% 8% 128
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 17% 13% 153
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 684
Immutable objects 82% 9% 9% 1031
Lazy initialization 75% 15% 10% 158
Model Objects 65% 16% 20% 96
Plugin Factory 69% 12% 19% 26
Private constructor 75% 15% 11% 818
Singleton 74% 18% 9% 295
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 361
Wrapper (Decorator) 67% 18% 14% 49
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 8% 7% 101
Avoid raw types 79% 13% 8% 179
Beware of instanceof operator 60% 24% 16% 1674
Class for constants 67% 20% 12% 647
Construct classes from the outside in 93% 5% 2% 58
Do not break portability 77% 18% 5% 73
Don't declare local variables before use 59% 25% 16% 228
Fields should usually be private 67% 20% 14% 111
Interface for constants 31% 56% 13% 655
Know the core libraries 83% 6% 11% 100
Minimize ripple effects 86% 3% 10% 124
Naming conventions 32% 60% 8% 329
Nest classes with care 45% 36% 18% 11
Output parameters 40% 38% 22% 157
Separate public and private members 71% 20% 9% 80
String concatenation does not scale 85% 10% 6% 155
Tag or marker interfaces 68% 19% 13% 170
Uncommon classes need explicit imports 77% 13% 9% 97
Use @Override liberally 84% 9% 7% 336
Use final liberally 60% 23% 17% 532
Use javadoc liberally 77% 12% 12% 146
Use static imports rarely 61% 27% 13% 539
Use System.exit with care 67% 19% 14% 565
Use Version Control tools 74% 12% 14% 50
Validate method arguments 65% 23% 13% 203
Wisdom, not rules 97% 3% 0% 32
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 14% 154
Designing for subclassing 73% 16% 11% 64
Overridable methods need special care 85% 5% 10% 92
Remember styles of inheritance 93% 0% 7% 45
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 272
Beware of Byte Order Marks 69% 27% 4% 26
Beware of DecimalFormat 45% 32% 23% 169
Beware of floating point numbers 91% 8% 2% 106
Clarifying method 91% 6% 3% 88
Coding conventions 87% 5% 9% 82
Compile regular expressions once 76% 15% 9% 46
Conditional compile 51% 38% 11% 201
Consider code generators 74% 14% 11% 70
Consider immutable forms for dates 45% 37% 18% 49
Conventional name for return value 72% 21% 8% 130
Defensive copying 87% 5% 7% 390
Design by Contract 82% 9% 9% 143
Don't use tab characters 33% 62% 5% 248
Extra space in argument list 20% 74% 6% 517
Generating unique IDs 58% 27% 15% 1915
Include 'from', exclude 'to' 77% 13% 10% 52
Multiple return statements 55% 33% 12% 417
Overloading can be tricky 76% 16% 8% 92
Package by feature, not layer 70% 15% 16% 737
Passwords never in clear text 69% 17% 14% 116
Prefer empty items to null ones 70% 20% 10% 372
Quote dynamic text when logging 79% 14% 7% 86
Self-encapsulate fields 62% 18% 20% 174
Structs are occasionally useful 67% 18% 15% 140
Test using main method 39% 49% 12% 102
Try alternatives to ResourceBundle 32% 33% 35% 60
Use a fake system clock 58% 25% 18% 118
Use a testing framework (JUnit) 84% 8% 7% 107
Use Ant for build scripts 73% 14% 12% 245
Use boxing with care 67% 21% 12% 183
Use enums to restrict arguments 75% 13% 12% 108
Validate state with class invariants 57% 25% 17% 63
Validation belongs in a Model Object 60% 31% 9% 117
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 83% 13% 4% 135
Assert use cases 39% 41% 21% 175
Assertions in general 90% 10% 0% 31
Force enabling of assertions 55% 29% 16% 51
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 18% 467
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 29% 16% 199
Constructors in general 67% 26% 7% 46
Constructors shouldn't call overridables 60% 24% 16% 142
Constructors shouldn't start threads 68% 18% 15% 34
Copy constructors 65% 23% 12% 1040
Don't pass 'this' out of a constructor 62% 24% 15% 34
Initializing fields to 0-false-null is redundant 68% 24% 8% 295
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 939
Serialization and subclassing 52% 30% 18% 93
Some classes need readResolve 78% 11% 11% 65
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 10% 14% 383
Avoid ThreadGroup 55% 25% 20% 155
Data integrity first 73% 12% 15% 124
Document thread safety 74% 16% 9% 43
Dump thread information 80% 15% 5% 20
Handle InterruptedException 59% 24% 17% 29
Launch thread is just another user thread 85% 6% 9% 33
Objects communicating across threads 72% 16% 12% 128
Perform N tasks in parallel 65% 16% 19% 203
Prefer modern libraries for concurrency 93% 7% 0% 15
Query host for the number of processors 93% 3% 3% 30
Read-write locks 78% 14% 9% 80
Remember the types of intrinsic lock 80% 10% 10% 250
Schedule periodic tasks 68% 19% 13% 1844
Stop threads through cooperation 63% 29% 8% 148
Synchronize access to mutable fields 55% 29% 16% 179
Synchronized is implementation detail 60% 25% 15% 88
Thread priorities are not portable 66% 20% 15% 41
Use finally to unlock 87% 10% 3% 30
© 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 -