Poll Summary

Number Of Votes Cast
69,898
Overall Acceptance Rates
Choice Number Percentage
Yes 45,081 64%
No 15,559 22%
Undecided 9,258 13%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 21% 1530
Always maintain HttpSessions 76% 15% 9% 139
Beware multilingual submit buttons 65% 19% 16% 130
Beware of common hacks 84% 9% 7% 103
Beware of custom cookies 80% 7% 13% 91
Beware of doubly escaped ampersands 76% 14% 10% 72
Beware of URL rewriting 62% 23% 15% 150
Choose form validation style carefully 72% 16% 11% 116
Consider Controllers for redirects 50% 24% 26% 34
Do not synchronize doGet, doPost 69% 20% 11% 730
Emit flexible URLs 73% 9% 18% 56
Escape special characters 60% 28% 11% 831
Forward versus redirect 73% 14% 13% 594
JSPs should contain only presentation logic 88% 6% 5% 219
Loss of data during restart 65% 14% 21% 85
Manage sessions closely 80% 11% 9% 147
Measure web app performance 86% 7% 6% 170
Minimize site response time 74% 13% 12% 89
Parse parameters into domain objects 38% 33% 29% 24
Pre-populate forms 47% 35% 18% 91
Prefer JSTL tags 74% 15% 11% 194
Prefer UTF-8 in all layers 80% 10% 10% 124
Prevent self-linking 38% 54% 8% 26
Refactor large Controllers 76% 12% 12% 17
Repel invalid requests 74% 13% 13% 23
Reuse login page for errors 71% 19% 10% 163
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 22% 19% 63
Session-scope objects often Serializable 75% 12% 13% 104
Struts seems mediocre 44% 38% 18% 200
Thread-safety in web apps 75% 16% 9% 287
Understand details of FORM tags 83% 7% 10% 29
Use Cascading Style Sheets 80% 13% 7% 85
Use extensions for fine-grained security 57% 31% 12% 42
Use Model-View-Controller framework 90% 3% 7% 293
Use templates to standardize layout 55% 37% 8% 38
Validate email addresses 44% 41% 15% 364
Validate generated HTML 73% 15% 12% 285
Web usability guidelines 85% 3% 12% 34
Wrap file upload requests 48% 27% 25% 60
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 65% 17% 18% 320
Actions 69% 20% 10% 88
Align menu items 68% 20% 13% 87
Change theme 69% 17% 14% 141
Consider JGoodies Forms for layouts 75% 9% 16% 93
Don't bury dialogs 61% 17% 22% 23
Don't subclass JDialog or JFrame 30% 40% 30% 135
Filter table rows 53% 40% 7% 15
Input dialogs 54% 23% 23% 39
Launch other applications 78% 22% 0% 23
Layout Managers 63% 24% 13% 199
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 66% 19% 16% 90
Observers and listeners 45% 30% 25% 162
Preferences dialogs 41% 19% 41% 27
Provide an uncaught exception handler 59% 21% 20% 96
Render table cells 68% 16% 17% 262
Sort table rows 47% 29% 24% 62
Splash screen 58% 30% 12% 283
Standardized dialogs 54% 33% 12% 24
Swing in general 76% 9% 15% 34
Swing threads 58% 24% 19% 140
Swing utility tasks 81% 14% 5% 37
Timers 33% 52% 16% 116
Using JavaHelp 56% 27% 17% 84
Using preferences 45% 32% 23% 62
Verify input with Model Objects 70% 20% 10% 10
Verify input with regular expressions 43% 34% 23% 35
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 46% 33% 21% 310
Avoid empty catch blocks 84% 10% 7% 285
Be specific in throws clause 59% 35% 7% 237
Beware of unknown root causes 33% 29% 38% 21
Checked versus unchecked exceptions 53% 28% 19% 1377
Exception translation 91% 6% 3% 103
Exceptions and control flow 69% 16% 14% 147
Finally and catch 67% 19% 14% 505
Javadoc all exceptions 55% 24% 21% 107
Pass all pertinent data to exceptions 96% 1% 3% 106
Stack trace as String 78% 14% 9% 682
Use template for repeated try-catch 62% 12% 26% 69
Input-OutputYesNoUndecidedVotes
Always close streams 78% 14% 8% 286
Buffering usually appropriate 90% 7% 3% 59
Console input 53% 30% 17% 232
Copy a file 71% 22% 7% 68
Reading and writing binary files 52% 24% 24% 200
Reading and writing Serializable objects 62% 24% 14% 302
Reading and writing text files 61% 22% 16% 3043
DatabasesYesNoUndecidedVotes
Business identifiers as String 85% 10% 6% 249
Connection pools 87% 6% 7% 271
Consider data layer tools 61% 18% 21% 33
Consider using standard SQL 70% 16% 14% 86
Consider wrapper classes for optional data 76% 13% 11% 62
Data access objects 64% 19% 17% 244
Data exception wrapping 74% 16% 10% 50
Data is king 89% 6% 5% 96
Don't perform basic SQL tasks in code 85% 9% 6% 65
Encapsulate connections 79% 7% 14% 43
Keep SQL out of code 54% 33% 14% 162
Prefer PreparedStatement 90% 5% 5% 62
Reduce database code duplication 93% 0% 7% 27
Remember the basics of database design 88% 7% 5% 56
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 71% 17% 12% 24
Use template for transactions 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 82% 9% 9% 592
Encapsulate collections 83% 5% 11% 168
Iterate without an index 76% 18% 6% 281
Prefer Collections over older classes 84% 6% 9% 109
Two ways of using Iterator 62% 23% 14% 1115
Use for-each liberally 79% 14% 7% 192
Use interface references to Collections 69% 19% 11% 98
Use standard Collections 81% 7% 12% 133
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 36% 22% 468
Implementing compareTo 52% 31% 17% 343
Implementing equals 60% 26% 14% 273
Implementing hashCode 57% 26% 17% 359
Implementing toString 50% 30% 19% 370
Never rely on finalize 70% 18% 12% 83
Common TasksYesNoUndecidedVotes
Arrays as String 45% 37% 18% 258
Clipboard copy and paste 79% 12% 9% 1545
Command line operations 42% 42% 16% 182
Compare and sort Strings 54% 31% 15% 234
Copy an array 61% 28% 11% 574
Determine if Strings are equal 69% 23% 8% 497
Examine bytecode 50% 39% 11% 38
Fetch web page and header 65% 20% 15% 307
Generate random numbers 63% 26% 11% 8974
Get database connection 56% 28% 16% 1104
Get size of object in memory 40% 45% 16% 325
Implement code tables 52% 20% 28% 40
Internationalization 52% 25% 23% 52
Logging messages 62% 21% 17% 1266
Measure application performance 78% 15% 7% 54
Modernize old code 90% 6% 4% 48
Open file in native directory 67% 33% 0% 3
Parse text 61% 21% 18% 587
Pattern-match lines of a file 58% 28% 14% 200
Read jar version information 61% 34% 5% 61
Recovering resources 88% 6% 6% 33
Recursive file listing 74% 15% 10% 1058
Replace a substring 61% 29% 10% 367
Representing money 76% 11% 13% 442
Send an email 57% 23% 21% 1912
Time execution speed 72% 22% 7% 123
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 69% 17% 13% 143
Command objects 58% 16% 26% 19
Factory methods 63% 21% 15% 640
Immutable objects 82% 9% 9% 969
Lazy initialization 75% 15% 10% 148
Model Objects 67% 15% 18% 88
Plugin Factory 71% 12% 17% 24
Private constructor 75% 15% 10% 790
Singleton 73% 18% 9% 284
Template method 70% 22% 7% 54
Type-Safe Enumerations 80% 11% 9% 352
Wrapper (Decorator) 61% 22% 17% 36
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 84% 9% 8% 92
Avoid raw types 79% 14% 7% 169
Beware of instanceof operator 61% 24% 16% 1572
Class for constants 69% 19% 12% 566
Construct classes from the outside in 93% 6% 2% 54
Do not break portability 75% 19% 6% 69
Don't declare local variables before use 60% 25% 16% 206
Fields should usually be private 66% 19% 14% 104
Interface for constants 31% 57% 12% 600
Know the core libraries 87% 3% 10% 90
Minimize ripple effects 88% 4% 8% 109
Naming conventions 32% 61% 7% 309
Nest classes with care 43% 29% 29% 7
Output parameters 42% 38% 20% 142
Separate public and private members 71% 22% 7% 69
String concatenation does not scale 84% 10% 6% 152
Tag or marker interfaces 67% 20% 14% 138
Uncommon classes need explicit imports 77% 13% 10% 90
Use @Override liberally 85% 8% 7% 250
Use final liberally 60% 24% 16% 472
Use javadoc liberally 77% 12% 11% 134
Use static imports rarely 60% 27% 13% 456
Use System.exit with care 67% 19% 14% 549
Use Version Control tools 73% 14% 14% 44
Validate method arguments 66% 23% 11% 185
Wisdom, not rules 96% 4% 0% 28
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 76% 9% 15% 140
Designing for subclassing 73% 15% 12% 59
Overridable methods need special care 84% 6% 10% 86
Remember styles of inheritance 93% 0% 7% 43
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 13% 260
Beware of Byte Order Marks 67% 28% 6% 18
Beware of DecimalFormat 45% 32% 23% 161
Beware of floating point numbers 91% 7% 2% 101
Clarifying method 90% 6% 4% 82
Coding conventions 86% 5% 9% 80
Compile regular expressions once 79% 12% 9% 43
Conditional compile 51% 38% 11% 191
Consider code generators 74% 14% 12% 69
Consider immutable forms for dates 44% 38% 19% 48
Conventional name for return value 72% 20% 7% 123
Defensive copying 87% 5% 8% 367
Design by Contract 82% 8% 10% 129
Don't use tab characters 31% 65% 4% 220
Extra space in argument list 20% 74% 6% 500
Generating unique IDs 58% 28% 14% 1733
Include 'from', exclude 'to' 76% 14% 10% 50
Multiple return statements 56% 33% 11% 392
Overloading can be tricky 76% 15% 8% 84
Package by feature, not layer 68% 16% 16% 623
Passwords never in clear text 69% 16% 14% 104
Prefer empty items to null ones 71% 20% 9% 352
Quote dynamic text when logging 80% 13% 8% 79
Self-encapsulate fields 61% 17% 22% 162
Structs are occasionally useful 69% 20% 11% 90
Test using main method 40% 50% 10% 98
Try alternatives to ResourceBundle 30% 36% 34% 56
Use a fake system clock 59% 24% 17% 106
Use a testing framework (JUnit) 83% 9% 8% 103
Use Ant for build scripts 73% 14% 13% 222
Use boxing with care 66% 22% 12% 176
Use enums to restrict arguments 75% 13% 13% 95
Validate state with class invariants 58% 24% 18% 62
Validation belongs in a Model Object 59% 32% 9% 111
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 85% 11% 4% 128
Assert use cases 40% 41% 19% 155
Assertions in general 90% 10% 0% 30
Force enabling of assertions 54% 31% 15% 48
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 66% 18% 16% 439
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 55% 30% 15% 187
Constructors in general 68% 25% 7% 44
Constructors shouldn't call overridables 61% 24% 15% 131
Constructors shouldn't start threads 72% 10% 17% 29
Copy constructors 65% 23% 12% 966
Don't pass 'this' out of a constructor 61% 26% 13% 23
Initializing fields to 0-false-null is redundant 68% 24% 8% 266
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 891
Serialization and subclassing 52% 30% 18% 89
Some classes need readResolve 79% 10% 11% 63
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 76% 11% 14% 324
Avoid ThreadGroup 55% 25% 20% 153
Data integrity first 73% 11% 16% 114
Document thread safety 73% 17% 10% 41
Dump thread information 79% 16% 5% 19
Handle InterruptedException 58% 25% 17% 24
Launch thread is just another user thread 84% 6% 9% 32
Objects communicating across threads 72% 16% 12% 123
Perform N tasks in parallel 67% 14% 18% 168
Prefer modern libraries for concurrency 93% 7% 0% 14
Query host for the number of processors 92% 4% 4% 25
Read-write locks 78% 12% 9% 74
Remember the types of intrinsic lock 81% 10% 9% 248
Schedule periodic tasks 68% 20% 13% 1775
Stop threads through cooperation 63% 29% 8% 148
Synchronize access to mutable fields 55% 30% 15% 173
Synchronized is implementation detail 60% 26% 14% 84
Thread priorities are not portable 67% 19% 14% 36
Use finally to unlock 86% 14% 0% 22
© 2014 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 -