Poll Summary

Number Of Votes Cast
30,069
Overall Acceptance Rates
Choice Number Percentage
Yes 20,386 68%
No 6,177 21%
Undecided 3,506 12%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 50% 33% 18% 212
Always maintain HttpSessions 74% 15% 11% 74
Application scope is multi-threaded 74% 17% 9% 223
Beware multilingual submit buttons 66% 13% 21% 38
Beware of common hacks 82% 5% 12% 40
Beware of custom cookies 80% 10% 10% 41
Beware of doubly escaped ampersands 68% 24% 7% 41
Beware of URL rewriting 54% 27% 19% 26
Choose form validation style carefully 65% 20% 15% 71
Consider Controllers for redirects 57% 43% 0% 7
Do not synchronize doGet, doPost 70% 19% 11% 470
Emit flexible URLs 76% 8% 16% 37
Escape special characters 67% 24% 10% 529
Forward versus redirect 76% 13% 11% 259
JSPs should contain only presentation logic 88% 6% 6% 172
Loss of data during restart 38% 19% 43% 21
Manage sessions closely 89% 7% 4% 108
Measure web app performance 87% 9% 4% 101
Minimize site response time 74% 13% 13% 68
Parse parameters into domain objects 33% 33% 33% 12
Pre-populate forms 51% 33% 16% 55
Prefer JSTL tags 75% 14% 11% 142
Prefer UTF-8 in all layers 90% 5% 5% 63
Prevent self-linking 42% 47% 11% 19
Refactor large Controllers 73% 9% 18% 11
Repel invalid requests 75% 6% 19% 16
Reuse login page for errors 76% 14% 10% 42
Send trouble-ticket emails 57% 14% 29% 14
Serve binary content 67% 17% 17% 12
Session-scope objects often Serializable 73% 11% 16% 56
Struts seems mediocre 47% 35% 18% 165
Understand details of FORM tags 82% 9% 9% 11
Use Cascading Style Sheets 81% 10% 10% 21
Use extensions for fine-grained security 64% 27% 9% 11
Use Model-View-Controller framework 90% 3% 7% 196
Use templates to standardize layout 53% 33% 13% 15
Validate email addresses 47% 42% 12% 191
Validate generated HTML 79% 12% 9% 113
Web usability guidelines 91% 0% 9% 22
Wrap file upload requests 50% 25% 25% 16
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 64% 17% 19% 120
Actions 78% 9% 13% 45
Align menu items 73% 16% 10% 49
Change theme 72% 17% 11% 81
Consider JGoodies Forms for layouts 78% 12% 9% 32
Don't bury dialogs 67% 11% 22% 9
Don't subclass JDialog or JFrame 30% 30% 39% 33
Filter table rows 44% 44% 11% 9
Indicate table sort 62% 27% 12% 26
Input dialogs 54% 27% 19% 26
Launch other applications 100% 0% 0% 2
Layout Managers 70% 18% 12% 77
Look and Feel guidelines 83% 9% 9% 35
Minimal Swing application 63% 26% 11% 19
Observers and listeners 47% 20% 33% 30
Preferences dialogs 30% 20% 50% 20
Provide an uncaught exception handler 75% 25% 0% 12
Render table cells 78% 10% 12% 112
Sort table rows 52% 26% 22% 27
Splash screen 64% 25% 11% 159
Standardized dialogs 53% 35% 12% 17
Swing in general 75% 10% 15% 20
Swing threads 65% 22% 14% 65
Swing utility tasks 77% 14% 9% 22
Timers 31% 52% 17% 42
Using JavaHelp 60% 29% 12% 42
Using preferences 29% 35% 35% 31
Verify input with Model Objects 50% 25% 25% 4
Verify input with regular expressions 44% 39% 17% 18
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 41% 33% 26% 107
Avoid empty catch blocks 84% 8% 8% 200
Be specific in throws clause 61% 34% 4% 140
Beware of unknown root causes 33% 33% 33% 3
Checked versus unchecked exceptions 59% 23% 18% 609
Exception translation 91% 5% 4% 56
Exceptions and control flow 76% 13% 11% 76
Finally and catch 65% 22% 13% 239
Javadoc all exceptions 59% 25% 16% 44
Pass all pertinent data to exceptions 94% 2% 5% 66
Stack trace as String 84% 9% 7% 359
Use template for repeated try-catch 63% 13% 24% 38
Input-OutputYesNoUndecidedVotes
Always close streams 84% 12% 4% 99
Buffering usually appropriate 92% 5% 3% 39
Console input 45% 37% 18% 62
Reading and writing Serializable objects 76% 14% 10% 92
Reading and writing text files 66% 20% 14% 1690
DatabasesYesNoUndecidedVotes
Business identifiers as String 85% 12% 2% 128
Connection pools 87% 5% 8% 185
Consider data layer tools 52% 22% 26% 23
Consider using standard SQL 70% 13% 17% 46
Consider wrapper classes for optional data 84% 3% 12% 32
Data access objects 68% 13% 19% 105
Data exception wrapping 82% 7% 11% 28
Data is king 92% 5% 2% 40
Do not perform database tasks in code 83% 11% 6% 47
Encapsulate connections 80% 7% 13% 30
Keep SQL out of code 55% 32% 13% 99
Prefer PreparedStatement 89% 3% 9% 35
Read-write locks 86% 9% 5% 22
Reduce database code duplication 94% 0% 6% 16
Remember the basics of database design 93% 0% 7% 30
Simplify database operations 40% 20% 40% 10
Try pseudo-persistence for mock ups 73% 9% 18% 11
Use template for transactions 64% 0% 36% 11
CollectionsYesNoUndecidedVotes
Choosing the right Collection 87% 5% 8% 191
Encapsulate collections 88% 3% 10% 73
Iterate without an index 73% 21% 6% 151
Prefer Collections over older classes 82% 8% 10% 62
Two ways of using Iterator 69% 19% 12% 373
Use for-each liberally 87% 10% 3% 68
Use interface references to Collections 66% 23% 11% 47
Use standard Collections 84% 6% 10% 51
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 263
Implementing compareTo 55% 27% 18% 142
Implementing equals 65% 23% 12% 148
Implementing hashCode 62% 24% 14% 201
Implementing toString 50% 32% 18% 154
Never rely on finalize 67% 19% 13% 52
Common TasksYesNoUndecidedVotes
Arrays as String 49% 35% 15% 99
Clipboard copy and paste 85% 8% 7% 723
Compare and sort Strings 57% 29% 14% 77
Copy an array 72% 21% 7% 263
Determine if Strings are equal 76% 19% 6% 337
Examine bytecode 38% 52% 10% 21
Fetch web page and header 74% 13% 12% 186
Generate random numbers 61% 30% 9% 2550
Get database connection 59% 25% 17% 418
Get size of object in memory 47% 39% 14% 157
Implement code tables 100% 0% 0% 3
Internationalization 59% 18% 23% 22
Logging messages 72% 14% 14% 541
Measure application performance 80% 14% 6% 35
Modernize old code 94% 6% 0% 18
Parse text 66% 18% 16% 255
Pattern-match lines of a file 68% 24% 8% 79
Read jar version information 100% 0% 0% 2
Recovering resources 90% 0% 10% 21
Recursive file listing 79% 13% 9% 602
Replace a substring 66% 28% 7% 258
Representing money 76% 12% 11% 208
Send an email 62% 19% 20% 1035
Time execution speed 76% 20% 5% 82
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 74% 14% 12% 72
Command objects 58% 25% 17% 12
Factory methods 68% 17% 15% 275
Immutable objects 85% 6% 10% 380
Lazy initialization 75% 17% 8% 63
Model Objects 62% 17% 21% 48
Plugin Factory 100% 0% 0% 3
Private constructor 76% 15% 9% 355
Singleton 75% 17% 8% 158
Template method 81% 13% 6% 31
Type-Safe Enumerations 82% 11% 7% 185
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 92% 8% 0% 24
Avoid raw types 81% 8% 11% 36
Beware of instanceof operator 62% 25% 13% 584
Class for constants 70% 20% 10% 220
Construct classes from the outside in 91% 6% 3% 33
Do not break portability 72% 18% 10% 40
Don't declare local variables before use 62% 29% 10% 105
Fields should usually be private 70% 19% 11% 54
Interface for constants 36% 57% 7% 244
Know the core libraries 93% 0% 7% 60
Minimize ripple effects 90% 2% 8% 49
Naming conventions 30% 63% 7% 162
Output parameters 49% 34% 17% 65
Separate public and private members 70% 27% 3% 37
String concatenation does not scale 85% 10% 4% 96
Tag or marker interfaces 80% 20% 0% 10
Uncommon classes need explicit imports 78% 14% 8% 49
Use @Override liberally 90% 8% 2% 40
Use CVS or other source code control 100% 0% 0% 2
Use final liberally 63% 19% 18% 136
Use javadoc liberally 83% 8% 9% 53
Use static imports rarely 62% 24% 13% 112
Use System.exit with care 67% 21% 12% 300
Validate method arguments 74% 15% 11% 65
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 75% 7% 18% 61
Designing for subclassing 77% 15% 8% 26
Overridable methods need special care 83% 5% 12% 42
Remember styles of inheritance 92% 0% 8% 25
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 58% 30% 12% 154
Beware of DecimalFormat 45% 36% 19% 42
Beware of floating point numbers 90% 8% 2% 40
Clarifying method 87% 10% 3% 39
Coding conventions 79% 9% 12% 43
Compile regular expressions once 86% 5% 9% 22
Conditional compile 52% 35% 13% 86
Consider code generators 81% 9% 9% 54
Consider immutable forms for dates 46% 38% 15% 26
Conventional name for return value 72% 19% 8% 72
Defensive copying 87% 5% 8% 149
Design by Contract 86% 7% 7% 59
Extra space in argument list 21% 76% 3% 316
Generating unique IDs 64% 24% 12% 530
Include 'from', exclude 'to' 70% 15% 15% 27
Multiple return statements 58% 34% 8% 190
Overloading can be tricky 80% 15% 5% 41
Package by feature, not layer 65% 14% 21% 178
Passwords never in clear text 90% 10% 0% 21
Prefer empty items to null ones 83% 12% 6% 144
Quote dynamic text when logging 88% 8% 4% 25
Self-encapsulate fields 55% 24% 21% 78
Test using main method 41% 51% 8% 49
Try alternatives to ResourceBundle 37% 41% 22% 27
Use a fake system clock 68% 8% 24% 25
Use a testing framework (JUnit) 85% 8% 8% 66
Use Ant for build scripts 79% 14% 7% 105
Use boxing with care 69% 26% 6% 70
Use enums to restrict arguments 74% 13% 13% 38
Validate state with class invariants 67% 15% 19% 27
Validation belongs in a Model Object 62% 33% 5% 42
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 83% 14% 3% 71
Assert use cases 61% 26% 13% 38
Assertions in general 92% 8% 0% 25
Force enabling of assertions 52% 37% 11% 27
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 66% 20% 13% 253
Beware of mistaken field redeclares 89% 5% 5% 19
Construct Object using class name 75% 17% 8% 65
Constructors in general 71% 21% 7% 28
Constructors shouldn't call overridables 67% 25% 8% 24
Copy constructors 68% 22% 10% 356
Initializing fields to 0-false-null is redundant 69% 26% 5% 94
SerializationYesNoUndecidedVotes
Implementing Serializable 69% 14% 18% 450
Serialization and subclassing 56% 22% 22% 36
Some classes need readResolve 84% 8% 8% 37
ThreadsYesNoUndecidedVotes
Avoid ThreadGroup 52% 24% 24% 120
Data integrity first, liveness second 68% 16% 16% 38
Document thread safety 76% 10% 14% 29
Launch thread is just another user thread 80% 5% 15% 20
Objects communicating across threads 76% 12% 13% 78
Remember the types of locking 81% 10% 10% 157
Stop threads through cooperation 61% 31% 8% 118
Synchronize access to mutable fields 50% 33% 16% 129
Synchronized is implementation detail 55% 25% 20% 40
Thread priorities are not portable 75% 12% 12% 16
Use Timer to schedule periodic tasks 71% 17% 12% 994
© 2010 Hirondelle Systems | Source Code | Contact | License | Quotes | RSS
Individual code snippets can be used under this BSD license - Last updated on June 5, 2010.
Over 150,000 unique IPs last month - Built with WEB4J.
- In Memoriam : Bill Dirani -