Poll Summary

Number Of Votes Cast
25,437
Overall Acceptance Rates
Choice Number Percentage
Yes 17,371 68%
No 5,187 20%
Undecided 2,879 11%

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