Poll Summary

Number Of Votes Cast
73,351
Overall Acceptance Rates
Choice Number Percentage
Yes 47,150 64%
No 16,361 22%
Undecided 9,840 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 20% 1685
Always maintain HttpSessions 74% 17% 9% 145
Beware multilingual submit buttons 64% 19% 17% 140
Beware of common hacks 86% 8% 6% 114
Beware of custom cookies 77% 6% 16% 97
Beware of doubly escaped ampersands 77% 14% 9% 74
Beware of URL rewriting 61% 24% 15% 157
Choose form validation style carefully 71% 18% 11% 119
Consider Controllers for redirects 51% 23% 26% 35
Do not synchronize doGet, doPost 69% 20% 11% 742
Emit flexible URLs 74% 9% 18% 57
Escape special characters 60% 29% 11% 842
Forward versus redirect 73% 14% 14% 620
JSPs should contain only presentation logic 88% 6% 6% 222
Loss of data during restart 64% 15% 21% 89
Manage sessions closely 81% 11% 9% 149
Measure web app performance 87% 7% 6% 180
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% 133
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% 171
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 79% 12% 8% 96
Use extensions for fine-grained security 57% 32% 11% 44
Use Model-View-Controller framework 90% 3% 7% 298
Use templates to standardize layout 54% 36% 10% 39
Validate email addresses 44% 41% 14% 369
Validate generated HTML 72% 15% 12% 296
Web usability guidelines 85% 3% 12% 34
Wrap file upload requests 48% 27% 25% 60
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 66% 17% 17% 343
Actions 70% 20% 10% 89
Align menu items 68% 20% 12% 91
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 73% 8% 19% 105
Don't bury dialogs 62% 17% 21% 24
Don't subclass JDialog or JFrame 30% 40% 29% 141
Filter table rows 53% 40% 7% 15
Input dialogs 52% 25% 22% 40
Launch other applications 72% 28% 0% 25
Layout Managers 64% 23% 14% 222
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 62% 20% 18% 105
Observers and listeners 46% 31% 23% 179
Preferences dialogs 41% 19% 41% 27
Provide an uncaught exception handler 60% 21% 19% 105
Render table cells 68% 16% 16% 272
Sort table rows 48% 28% 23% 64
Splash screen 57% 31% 13% 290
Standardized dialogs 52% 36% 12% 25
Swing in general 76% 9% 15% 34
Swing threads 58% 23% 18% 146
Swing utility tasks 79% 13% 8% 39
Timers 34% 49% 17% 124
Using JavaHelp 56% 28% 16% 86
Using preferences 45% 33% 22% 64
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% 20% 322
Avoid empty catch blocks 83% 10% 6% 296
Be specific in throws clause 59% 34% 7% 245
Beware of unknown root causes 33% 30% 37% 27
Checked versus unchecked exceptions 53% 28% 19% 1414
Exception translation 90% 7% 3% 105
Exceptions and control flow 70% 16% 14% 154
Finally and catch 67% 19% 14% 524
Javadoc all exceptions 56% 24% 21% 117
Pass all pertinent data to exceptions 95% 1% 5% 110
Stack trace as String 77% 14% 9% 691
Use template for repeated try-catch 61% 12% 26% 72
Input-OutputYesNoUndecidedVotes
Always close streams 77% 15% 8% 299
Buffering usually appropriate 89% 7% 5% 61
Console input 52% 30% 18% 241
Copy a file 66% 23% 11% 79
Reading and writing binary files 51% 24% 24% 226
Reading and writing Serializable objects 60% 25% 15% 318
Reading and writing text files 61% 22% 17% 3086
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 10% 6% 263
Connection pools 87% 6% 7% 278
Consider data layer tools 58% 19% 22% 36
Consider using standard SQL 69% 17% 14% 90
Consider wrapper classes for optional data 76% 13% 11% 63
Data access objects 64% 19% 17% 251
Data exception wrapping 73% 15% 12% 52
Data is king 88% 6% 6% 99
Don't perform basic SQL tasks in code 85% 9% 6% 65
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 53% 33% 14% 167
Prefer PreparedStatement 91% 5% 5% 64
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% 623
Encapsulate collections 83% 6% 11% 174
Iterate without an index 76% 18% 6% 290
Prefer Collections over older classes 85% 6% 9% 112
Two ways of using Iterator 62% 23% 15% 1181
Use for-each liberally 77% 17% 7% 212
Use interface references to Collections 69% 20% 12% 102
Use standard Collections 81% 7% 12% 144
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 482
Implementing compareTo 52% 32% 17% 351
Implementing equals 60% 27% 14% 288
Implementing hashCode 57% 26% 17% 366
Implementing toString 50% 30% 20% 382
Never rely on finalize 71% 18% 12% 85
Common TasksYesNoUndecidedVotes
Arrays as String 45% 37% 17% 269
Clipboard copy and paste 79% 12% 9% 1601
Command line operations 42% 40% 18% 218
Compare and sort Strings 53% 32% 15% 248
Copy an array 61% 28% 11% 590
Determine if Strings are equal 68% 24% 8% 511
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 311
Generate random numbers 62% 26% 12% 9633
Get database connection 56% 28% 16% 1125
Get size of object in memory 40% 45% 16% 333
Implement code tables 53% 21% 26% 43
Internationalization 54% 23% 23% 57
Logging messages 61% 22% 17% 1319
Measure application performance 78% 15% 7% 55
Modernize old code 90% 6% 4% 50
Open file in native directory 71% 14% 14% 7
Parse text 60% 22% 18% 600
Pattern-match lines of a file 57% 28% 14% 215
Read jar version information 60% 33% 7% 73
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 16% 10% 1075
Replace a substring 60% 30% 10% 376
Representing money 75% 12% 13% 456
Send an email 56% 23% 21% 1965
Time execution speed 71% 22% 7% 127
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 69% 17% 13% 150
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 671
Immutable objects 82% 9% 9% 1009
Lazy initialization 75% 15% 10% 156
Model Objects 66% 15% 19% 94
Plugin Factory 69% 12% 19% 26
Private constructor 75% 15% 10% 810
Singleton 73% 18% 9% 292
Template method 71% 22% 7% 55
Type-Safe Enumerations 80% 11% 9% 358
Wrapper (Decorator) 65% 19% 16% 43
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 8% 7% 100
Avoid raw types 79% 14% 7% 175
Beware of instanceof operator 60% 24% 16% 1641
Class for constants 68% 20% 12% 626
Construct classes from the outside in 93% 5% 2% 57
Do not break portability 76% 18% 6% 72
Don't declare local variables before use 59% 25% 16% 223
Fields should usually be private 66% 20% 14% 107
Interface for constants 31% 57% 12% 633
Know the core libraries 83% 6% 11% 100
Minimize ripple effects 86% 3% 11% 119
Naming conventions 32% 60% 8% 326
Nest classes with care 50% 30% 20% 10
Output parameters 40% 38% 22% 152
Separate public and private members 73% 19% 8% 78
String concatenation does not scale 84% 10% 6% 154
Tag or marker interfaces 68% 19% 13% 159
Uncommon classes need explicit imports 78% 13% 10% 94
Use @Override liberally 84% 9% 7% 304
Use final liberally 60% 23% 17% 513
Use javadoc liberally 77% 12% 11% 144
Use static imports rarely 61% 26% 13% 513
Use System.exit with care 67% 19% 14% 562
Use Version Control tools 74% 13% 13% 47
Validate method arguments 65% 23% 12% 201
Wisdom, not rules 97% 3% 0% 32
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 9% 15% 149
Designing for subclassing 74% 15% 11% 61
Overridable methods need special care 84% 6% 10% 89
Remember styles of inheritance 93% 0% 7% 44
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 269
Beware of Byte Order Marks 70% 26% 4% 23
Beware of DecimalFormat 45% 32% 23% 165
Beware of floating point numbers 90% 8% 2% 104
Clarifying method 91% 6% 3% 87
Coding conventions 86% 5% 9% 81
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 45% 37% 18% 49
Conventional name for return value 72% 21% 8% 130
Defensive copying 87% 5% 7% 382
Design by Contract 81% 9% 9% 140
Don't use tab characters 32% 63% 5% 237
Extra space in argument list 20% 74% 6% 507
Generating unique IDs 58% 28% 14% 1848
Include 'from', exclude 'to' 76% 14% 10% 51
Multiple return statements 55% 32% 13% 411
Overloading can be tricky 76% 16% 8% 88
Package by feature, not layer 70% 15% 15% 707
Passwords never in clear text 70% 17% 13% 113
Prefer empty items to null ones 70% 20% 10% 365
Quote dynamic text when logging 80% 13% 7% 85
Self-encapsulate fields 61% 18% 21% 170
Structs are occasionally useful 67% 18% 15% 123
Test using main method 39% 49% 12% 102
Try alternatives to ResourceBundle 32% 33% 35% 60
Use a fake system clock 58% 24% 18% 117
Use a testing framework (JUnit) 84% 9% 8% 105
Use Ant for build scripts 73% 14% 12% 235
Use boxing with care 66% 22% 12% 179
Use enums to restrict arguments 75% 12% 13% 102
Validate state with class invariants 57% 25% 17% 63
Validation belongs in a Model Object 60% 30% 10% 115
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 85% 11% 4% 131
Assert use cases 39% 40% 20% 171
Assertions in general 90% 10% 0% 31
Force enabling of assertions 56% 30% 14% 50
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 17% 455
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 29% 16% 197
Constructors in general 67% 27% 7% 45
Constructors shouldn't call overridables 59% 25% 16% 138
Constructors shouldn't start threads 67% 18% 15% 33
Copy constructors 65% 23% 12% 1017
Don't pass 'this' out of a constructor 61% 26% 13% 31
Initializing fields to 0-false-null is redundant 68% 23% 8% 290
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 17% 18% 925
Serialization and subclassing 51% 31% 18% 90
Some classes need readResolve 78% 11% 11% 65
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 76% 11% 14% 358
Avoid ThreadGroup 55% 25% 20% 154
Data integrity first 74% 11% 15% 120
Document thread safety 74% 17% 10% 42
Dump thread information 80% 15% 5% 20
Handle InterruptedException 56% 26% 19% 27
Launch thread is just another user thread 85% 6% 9% 33
Objects communicating across threads 72% 16% 13% 127
Perform N tasks in parallel 65% 16% 19% 191
Prefer modern libraries for concurrency 93% 7% 0% 15
Query host for the number of processors 93% 3% 3% 29
Read-write locks 78% 13% 9% 79
Remember the types of intrinsic lock 81% 10% 9% 249
Schedule periodic tasks 68% 19% 13% 1827
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 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 -