Poll Summary

Number Of Votes Cast
57,125
Overall Acceptance Rates
Choice Number Percentage
Yes 37,266 65%
No 12,615 22%
Undecided 7,244 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 60% 20% 20% 947
Always maintain HttpSessions 74% 16% 10% 120
Beware multilingual submit buttons 63% 19% 19% 97
Beware of common hacks 85% 7% 8% 86
Beware of custom cookies 85% 6% 9% 78
Beware of doubly escaped ampersands 76% 15% 9% 67
Beware of URL rewriting 65% 24% 11% 111
Choose form validation style carefully 73% 16% 11% 108
Consider Controllers for redirects 55% 21% 24% 29
Do not synchronize doGet, doPost 69% 20% 11% 656
Emit flexible URLs 75% 8% 17% 48
Escape special characters 62% 27% 11% 776
Forward versus redirect 73% 14% 12% 497
JSPs should contain only presentation logic 88% 7% 6% 208
Loss of data during restart 61% 14% 25% 57
Manage sessions closely 81% 10% 8% 143
Measure web app performance 86% 7% 7% 152
Minimize site response time 76% 13% 12% 86
Parse parameters into domain objects 37% 32% 32% 19
Pre-populate forms 47% 35% 18% 79
Prefer JSTL tags 73% 16% 11% 186
Prefer UTF-8 in all layers 83% 9% 8% 109
Prevent self-linking 42% 50% 8% 24
Refactor large Controllers 80% 7% 13% 15
Repel invalid requests 73% 14% 14% 22
Reuse login page for errors 69% 19% 11% 124
Send trouble-ticket emails 63% 16% 21% 19
Serve binary content 57% 20% 22% 40
Session-scope objects often Serializable 78% 9% 13% 89
Struts seems mediocre 45% 37% 19% 193
Thread-safety in web apps 76% 16% 9% 275
Understand details of FORM tags 79% 8% 12% 24
Use Cascading Style Sheets 81% 14% 5% 57
Use extensions for fine-grained security 58% 32% 10% 31
Use Model-View-Controller framework 89% 3% 7% 259
Use templates to standardize layout 59% 34% 7% 29
Validate email addresses 44% 41% 14% 333
Validate generated HTML 73% 15% 11% 235
Web usability guidelines 87% 3% 10% 30
Wrap file upload requests 49% 24% 27% 51
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 64% 18% 18% 249
Actions 70% 17% 13% 70
Align menu items 70% 19% 10% 77
Change theme 70% 17% 13% 132
Consider JGoodies Forms for layouts 80% 7% 13% 70
Don't bury dialogs 58% 21% 21% 19
Don't subclass JDialog or JFrame 33% 38% 28% 99
Filter table rows 62% 31% 8% 13
Indicate table sort 61% 27% 12% 33
Input dialogs 50% 25% 25% 32
Launch other applications 78% 22% 0% 18
Layout Managers 67% 20% 13% 141
Look and Feel guidelines 84% 9% 7% 44
Minimal Swing application 65% 21% 14% 43
Observers and listeners 42% 30% 29% 101
Preferences dialogs 38% 17% 46% 24
Provide an uncaught exception handler 58% 24% 18% 66
Render table cells 70% 13% 17% 209
Sort table rows 47% 30% 23% 47
Splash screen 58% 30% 11% 248
Standardized dialogs 57% 30% 13% 23
Swing in general 78% 7% 15% 27
Swing threads 61% 24% 16% 122
Swing utility tasks 77% 17% 7% 30
Timers 30% 56% 14% 98
Using JavaHelp 55% 29% 16% 73
Using preferences 44% 36% 20% 55
Verify input with Model Objects 62% 25% 12% 8
Verify input with regular expressions 44% 34% 22% 32
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 45% 33% 22% 223
Avoid empty catch blocks 85% 9% 7% 253
Be specific in throws clause 57% 36% 7% 215
Beware of unknown root causes 47% 20% 33% 15
Checked versus unchecked exceptions 53% 28% 19% 1150
Exception translation 90% 7% 3% 88
Exceptions and control flow 70% 15% 15% 128
Finally and catch 67% 20% 13% 429
Javadoc all exceptions 59% 25% 16% 76
Pass all pertinent data to exceptions 96% 1% 3% 93
Stack trace as String 77% 14% 9% 633
Use template for repeated try-catch 60% 12% 28% 60
Input-OutputYesNoUndecidedVotes
Always close streams 80% 13% 8% 221
Buffering usually appropriate 92% 6% 2% 52
Console input 51% 32% 17% 178
Copy a file 68% 26% 6% 34
Reading and writing binary files 54% 30% 16% 98
Reading and writing Serializable objects 64% 24% 12% 220
Reading and writing text files 62% 22% 16% 2825
DatabasesYesNoUndecidedVotes
Business identifiers as String 84% 10% 6% 209
Connection pools 86% 7% 7% 249
Consider data layer tools 59% 19% 22% 27
Consider using standard SQL 71% 14% 14% 77
Consider wrapper classes for optional data 76% 14% 10% 58
Data access objects 62% 19% 19% 208
Data exception wrapping 78% 13% 9% 45
Data is king 88% 6% 6% 80
Don't perform basic SQL tasks in code 84% 11% 5% 57
Encapsulate connections 82% 8% 11% 38
Keep SQL out of code 56% 32% 12% 140
Prefer PreparedStatement 90% 4% 6% 52
Reduce database code duplication 95% 0% 5% 21
Remember the basics of database design 88% 6% 6% 50
Simplify database operations 60% 13% 27% 15
Try pseudo-persistence for mock ups 73% 14% 14% 22
Use template for transactions 69% 6% 25% 16
CollectionsYesNoUndecidedVotes
Choosing the right Collection 83% 9% 8% 418
Encapsulate collections 86% 4% 10% 142
Iterate without an index 76% 19% 5% 242
Prefer Collections over older classes 82% 8% 10% 89
Two ways of using Iterator 63% 22% 14% 850
Use for-each liberally 83% 11% 6% 151
Use interface references to Collections 70% 18% 12% 82
Use standard Collections 83% 6% 11% 100
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 36% 21% 404
Implementing compareTo 54% 30% 16% 291
Implementing equals 58% 28% 14% 245
Implementing hashCode 57% 26% 16% 328
Implementing toString 49% 31% 20% 312
Never rely on finalize 70% 18% 11% 71
Common TasksYesNoUndecidedVotes
Arrays as String 45% 40% 15% 215
Clipboard copy and paste 81% 11% 8% 1311
Command line operations 45% 41% 14% 87
Compare and sort Strings 59% 26% 15% 184
Copy an array 63% 27% 10% 498
Determine if Strings are equal 73% 20% 7% 437
Examine bytecode 50% 39% 11% 36
Fetch web page and header 66% 19% 14% 288
Generate random numbers 64% 26% 10% 6724
Get database connection 56% 28% 16% 987
Get size of object in memory 39% 46% 15% 292
Implement code tables 56% 19% 26% 27
Internationalization 57% 19% 24% 37
Logging messages 64% 19% 17% 1057
Measure application performance 76% 16% 8% 51
Modernize old code 88% 7% 5% 41
Parse text 62% 21% 17% 520
Pattern-match lines of a file 59% 29% 12% 164
Read jar version information 63% 27% 10% 30
Recovering resources 88% 6% 6% 32
Recursive file listing 75% 15% 10% 981
Replace a substring 61% 29% 10% 350
Representing money 76% 11% 13% 383
Send an email 58% 22% 20% 1724
Time execution speed 74% 20% 6% 114
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 69% 19% 13% 118
Command objects 59% 18% 24% 17
Factory methods 64% 21% 15% 539
Immutable objects 84% 8% 8% 780
Lazy initialization 74% 17% 9% 120
Model Objects 68% 12% 19% 73
Plugin Factory 68% 16% 16% 19
Private constructor 74% 15% 11% 670
Singleton 74% 18% 9% 251
Template method 72% 21% 8% 53
Type-Safe Enumerations 81% 11% 9% 328
Wrapper (Decorator) 83% 17% 0% 6
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 9% 6% 66
Avoid raw types 83% 12% 5% 130
Beware of instanceof operator 60% 24% 16% 1272
Class for constants 69% 20% 11% 416
Construct classes from the outside in 91% 7% 2% 46
Do not break portability 76% 17% 7% 59
Don't declare local variables before use 60% 27% 12% 169
Fields should usually be private 69% 18% 13% 85
Interface for constants 33% 57% 11% 479
Know the core libraries 89% 1% 10% 73
Minimize ripple effects 89% 4% 6% 94
Naming conventions 31% 62% 7% 258
Output parameters 44% 37% 19% 116
Separate public and private members 73% 21% 5% 56
String concatenation does not scale 86% 10% 4% 141
Tag or marker interfaces 62% 26% 12% 73
Uncommon classes need explicit imports 77% 14% 9% 74
Use @Override liberally 89% 5% 6% 132
Use final liberally 60% 26% 14% 330
Use javadoc liberally 78% 10% 12% 108
Use static imports rarely 58% 27% 15% 310
Use System.exit with care 67% 20% 13% 479
Use Version Control tools 75% 10% 15% 20
Validate method arguments 66% 23% 11% 149
Wisdom, not rules 100% 0% 0% 16
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 9% 15% 116
Designing for subclassing 71% 18% 12% 51
Overridable methods need special care 85% 5% 9% 75
Remember styles of inheritance 92% 0% 8% 38
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 62% 24% 14% 217
Beware of Byte Order Marks 75% 25% 0% 4
Beware of DecimalFormat 42% 33% 25% 141
Beware of floating point numbers 90% 8% 2% 86
Clarifying method 90% 7% 3% 72
Coding conventions 86% 5% 8% 74
Compile regular expressions once 82% 8% 10% 39
Conditional compile 52% 38% 11% 160
Consider code generators 77% 12% 11% 65
Consider immutable forms for dates 46% 39% 15% 46
Conventional name for return value 76% 17% 7% 105
Defensive copying 87% 6% 7% 281
Design by Contract 85% 7% 8% 106
Don't use tab characters 26% 70% 4% 168
Extra space in argument list 20% 74% 6% 440
Generating unique IDs 59% 27% 13% 1293
Include 'from', exclude 'to' 77% 14% 9% 43
Multiple return statements 57% 32% 11% 331
Overloading can be tricky 79% 14% 7% 70
Package by feature, not layer 67% 16% 17% 432
Passwords never in clear text 74% 14% 12% 73
Prefer empty items to null ones 74% 18% 8% 287
Quote dynamic text when logging 85% 10% 5% 60
Self-encapsulate fields 61% 19% 20% 137
Structs are occasionally useful 75% 25% 0% 8
Test using main method 40% 50% 10% 90
Try alternatives to ResourceBundle 30% 37% 33% 46
Use a fake system clock 60% 24% 16% 80
Use a testing framework (JUnit) 82% 10% 9% 93
Use Ant for build scripts 75% 15% 10% 172
Use boxing with care 68% 21% 11% 145
Use enums to restrict arguments 74% 12% 14% 78
Validate state with class invariants 59% 24% 17% 54
Validation belongs in a Model Object 59% 35% 7% 92
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 86% 11% 3% 111
Assert use cases 46% 40% 14% 95
Assertions in general 92% 8% 0% 26
Force enabling of assertions 56% 33% 12% 43
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 16% 369
Beware of mistaken field redeclares 83% 10% 7% 29
Construct Object using class name 59% 27% 14% 143
Constructors in general 70% 25% 5% 40
Constructors shouldn't call overridables 56% 27% 17% 105
Constructors shouldn't start threads 70% 10% 20% 10
Copy constructors 65% 23% 11% 750
Don't let this reference escape 69% 19% 12% 16
Initializing fields to 0-false-null is redundant 66% 26% 8% 196
SerializationYesNoUndecidedVotes
Implementing Serializable 65% 17% 18% 761
Serialization and subclassing 54% 31% 15% 74
Some classes need readResolve 79% 9% 11% 53
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 76% 11% 13% 141
Avoid ThreadGroup 55% 24% 20% 148
Data integrity first 74% 10% 16% 82
Document thread safety 74% 16% 11% 38
Dump thread information 75% 25% 0% 12
Handle InterruptedException 44% 44% 11% 9
Launch thread is just another user thread 82% 7% 11% 28
Objects communicating across threads 72% 15% 13% 111
Perform N tasks in parallel 70% 14% 16% 76
Prefer modern libraries for concurrency 100% 0% 0% 10
Query host for the number of processors 90% 5% 5% 20
Read-write locks 86% 7% 7% 43
Remember the types of intrinsic lock 81% 11% 9% 232
Schedule periodic tasks 69% 19% 12% 1576
Stop threads through cooperation 63% 29% 8% 145
Synchronize access to mutable fields 54% 31% 15% 162
Synchronized is implementation detail 59% 25% 16% 75
Thread priorities are not portable 70% 17% 13% 30
Use finally to unlock 91% 9% 0% 11
© 2013 Hirondelle Systems | Source Code | Contact | License | RSS
Individual code snippets can be used under this BSD license - Last updated on August 30, 2012.
Over 2,400,000 unique IPs last year - Built with WEB4J.
- In Memoriam : Bill Dirani -