Poll Summary

Number Of Votes Cast
75,275
Overall Acceptance Rates
Choice Number Percentage
Yes 48,363 64%
No 16,749 22%
Undecided 10,163 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 21% 1752
Always maintain HttpSessions 75% 16% 9% 147
Beware multilingual submit buttons 64% 20% 16% 147
Beware of common hacks 84% 8% 8% 119
Beware of custom cookies 78% 6% 16% 101
Beware of doubly escaped ampersands 77% 13% 9% 75
Beware of URL rewriting 61% 23% 16% 161
Choose form validation style carefully 72% 18% 11% 120
Consider Controllers for redirects 47% 24% 29% 38
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% 635
JSPs should contain only presentation logic 88% 6% 6% 224
Loss of data during restart 64% 15% 21% 92
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 80% 10% 10% 136
Prevent self-linking 38% 54% 8% 26
Refactor large Controllers 78% 11% 11% 18
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 75% 15% 10% 104
Use extensions for fine-grained security 57% 32% 11% 44
Use Model-View-Controller framework 90% 3% 7% 299
Use templates to standardize layout 50% 40% 10% 42
Validate email addresses 44% 41% 15% 370
Validate generated HTML 72% 15% 13% 299
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 47% 26% 27% 62
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 67% 17% 16% 356
Actions 70% 20% 10% 90
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% 146
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% 224
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 61% 20% 18% 109
Observers and listeners 46% 30% 23% 183
Preferences dialogs 43% 18% 39% 28
Provide an uncaught exception handler 60% 21% 19% 114
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% 148
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 45% 33% 22% 334
Avoid empty catch blocks 83% 10% 6% 300
Be specific in throws clause 59% 34% 7% 250
Beware of unknown root causes 33% 30% 37% 27
Checked versus unchecked exceptions 53% 28% 19% 1445
Exception translation 91% 6% 3% 112
Exceptions and control flow 70% 15% 15% 157
Finally and catch 67% 19% 14% 531
Javadoc all exceptions 56% 23% 21% 125
Pass all pertinent data to exceptions 95% 1% 4% 113
Stack trace as String 77% 14% 9% 697
Use template for repeated try-catch 62% 12% 26% 74
Input-OutputYesNoUndecidedVotes
Always close streams 77% 15% 8% 311
Buffering usually appropriate 89% 6% 5% 62
Console input 54% 29% 18% 251
Copy a file 66% 23% 10% 86
Reading and writing binary files 51% 25% 24% 238
Reading and writing Serializable objects 59% 26% 15% 327
Reading and writing text files 61% 22% 17% 3103
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 272
Connection pools 87% 6% 7% 278
Consider data layer tools 57% 19% 24% 37
Consider using standard SQL 68% 18% 14% 93
Consider wrapper classes for optional data 75% 14% 11% 64
Data access objects 64% 19% 17% 256
Data exception wrapping 74% 15% 11% 54
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 90% 4% 6% 67
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 82% 9% 10% 649
Encapsulate collections 82% 7% 11% 177
Iterate without an index 76% 18% 6% 295
Prefer Collections over older classes 85% 6% 9% 113
Two ways of using Iterator 62% 23% 14% 1223
Use for-each liberally 77% 16% 7% 217
Use interface references to Collections 69% 19% 12% 104
Use standard Collections 82% 7% 11% 151
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 36% 22% 490
Implementing compareTo 52% 32% 17% 354
Implementing equals 60% 27% 13% 290
Implementing hashCode 56% 26% 17% 369
Implementing toString 51% 30% 19% 388
Never rely on finalize 70% 17% 13% 87
Common TasksYesNoUndecidedVotes
Arrays as String 46% 37% 17% 272
Clipboard copy and paste 79% 12% 9% 1622
Command line operations 44% 39% 17% 243
Compare and sort Strings 53% 32% 15% 252
Copy an array 61% 28% 11% 597
Determine if Strings are equal 68% 24% 8% 514
Examine bytecode 51% 38% 10% 39
Fetch web page and header 65% 21% 15% 312
Generate random numbers 62% 26% 12% 9957
Get database connection 56% 28% 16% 1134
Get size of object in memory 40% 44% 16% 340
Implement code tables 54% 22% 24% 46
Internationalization 53% 25% 22% 59
Logging messages 61% 22% 17% 1357
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% 613
Pattern-match lines of a file 58% 28% 14% 221
Read jar version information 60% 32% 8% 80
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 15% 10% 1082
Replace a substring 59% 30% 11% 380
Representing money 75% 12% 13% 464
Send an email 56% 23% 21% 1988
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% 690
Immutable objects 82% 9% 9% 1035
Lazy initialization 75% 15% 10% 159
Model Objects 65% 16% 20% 96
Plugin Factory 69% 12% 19% 26
Private constructor 75% 15% 11% 823
Singleton 74% 18% 9% 296
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 362
Wrapper (Decorator) 68% 18% 14% 50
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 86% 8% 7% 104
Avoid raw types 78% 14% 8% 181
Beware of instanceof operator 61% 24% 15% 1691
Class for constants 68% 20% 12% 656
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% 231
Fields should usually be private 67% 20% 13% 112
Interface for constants 32% 56% 13% 657
Know the core libraries 83% 6% 11% 100
Minimize ripple effects 87% 3% 10% 126
Naming conventions 32% 61% 8% 330
Nest classes with care 50% 33% 17% 12
Output parameters 40% 38% 22% 157
Separate public and private members 71% 20% 9% 80
String concatenation does not scale 85% 10% 6% 157
Tag or marker interfaces 68% 19% 13% 174
Uncommon classes need explicit imports 78% 13% 9% 98
Use @Override liberally 84% 9% 7% 348
Use final liberally 60% 23% 17% 535
Use javadoc liberally 77% 12% 12% 146
Use static imports rarely 61% 27% 13% 547
Use System.exit with care 67% 19% 14% 568
Use Version Control tools 73% 12% 15% 52
Validate method arguments 64% 22% 14% 206
Wisdom, not rules 97% 3% 0% 33
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 14% 155
Designing for subclassing 72% 15% 12% 65
Overridable methods need special care 84% 6% 10% 93
Remember styles of inheritance 93% 0% 7% 45
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 273
Beware of Byte Order Marks 69% 27% 4% 26
Beware of DecimalFormat 45% 32% 23% 170
Beware of floating point numbers 91% 7% 2% 107
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 88% 5% 7% 392
Design by Contract 81% 10% 9% 145
Don't use tab characters 33% 62% 5% 250
Extra space in argument list 20% 74% 6% 518
Generating unique IDs 58% 27% 15% 1939
Include 'from', exclude 'to' 77% 13% 10% 52
Multiple return statements 55% 32% 13% 419
Overloading can be tricky 76% 16% 8% 92
Package by feature, not layer 70% 14% 16% 748
Passwords never in clear text 69% 18% 13% 119
Prefer empty items to null ones 70% 20% 10% 375
Quote dynamic text when logging 79% 14% 7% 86
Self-encapsulate fields 62% 18% 20% 175
Structs are occasionally useful 68% 17% 15% 145
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 82% 13% 4% 136
Assert use cases 39% 41% 21% 179
Assertions in general 91% 9% 0% 32
Force enabling of assertions 56% 29% 15% 52
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 18% 468
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 54% 30% 16% 199
Constructors in general 67% 26% 7% 46
Constructors shouldn't call overridables 60% 24% 16% 142
Constructors shouldn't start threads 69% 17% 14% 35
Copy constructors 65% 23% 12% 1047
Don't pass 'this' out of a constructor 62% 24% 15% 34
Initializing fields to 0-false-null is redundant 68% 23% 8% 301
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 942
Serialization and subclassing 51% 31% 18% 94
Some classes need readResolve 78% 11% 11% 65
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 387
Avoid ThreadGroup 55% 25% 20% 155
Data integrity first 73% 12% 15% 128
Document thread safety 74% 16% 9% 43
Dump thread information 81% 14% 5% 21
Handle InterruptedException 59% 24% 17% 29
Launch thread is just another user thread 85% 6% 9% 33
Objects communicating across threads 71% 16% 12% 129
Perform N tasks in parallel 65% 15% 20% 208
Prefer modern libraries for concurrency 93% 7% 0% 15
Query host for the number of processors 93% 3% 3% 30
Read-write locks 77% 15% 9% 81
Remember the types of intrinsic lock 80% 10% 10% 250
Schedule periodic tasks 68% 19% 13% 1846
Stop threads through cooperation 63% 29% 8% 148
Synchronize access to mutable fields 55% 29% 16% 180
Synchronized is implementation detail 60% 25% 15% 88
Thread priorities are not portable 67% 19% 14% 43
Use finally to unlock 84% 9% 6% 32
© 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 -