Poll Summary

Number Of Votes Cast
79,362
Overall Acceptance Rates
Choice Number Percentage
Yes 50,743 64%
No 17,765 22%
Undecided 10,854 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 62% 18% 20% 1910
Always maintain HttpSessions 74% 17% 10% 151
Beware multilingual submit buttons 65% 19% 16% 155
Beware of common hacks 84% 8% 8% 123
Beware of custom cookies 77% 8% 15% 105
Beware of doubly escaped ampersands 78% 13% 9% 77
Beware of URL rewriting 63% 23% 15% 172
Choose form validation style carefully 71% 18% 11% 121
Consider Controllers for redirects 46% 26% 28% 39
Do not synchronize doGet, doPost 69% 20% 11% 768
Emit flexible URLs 73% 8% 19% 63
Escape special characters 60% 29% 12% 865
Forward versus redirect 72% 14% 14% 658
JSPs should contain only presentation logic 88% 6% 6% 226
Loss of data during restart 65% 15% 20% 97
Manage sessions closely 81% 11% 9% 150
Measure web app performance 86% 8% 6% 186
Minimize site response time 74% 13% 13% 94
Parse parameters into domain objects 40% 32% 28% 25
Pre-populate forms 45% 36% 19% 97
Prefer JSTL tags 74% 15% 11% 200
Prefer UTF-8 in all layers 80% 9% 11% 144
Prevent self-linking 41% 52% 7% 27
Refactor large Controllers 79% 11% 11% 19
Repel invalid requests 75% 12% 12% 24
Reuse login page for errors 70% 18% 12% 185
Send trouble-ticket emails 57% 14% 29% 21
Serve binary content 59% 23% 18% 74
Session-scope objects often Serializable 75% 12% 13% 120
Struts seems mediocre 43% 38% 18% 203
Thread-safety in web apps 75% 16% 10% 293
Understand details of FORM tags 78% 9% 12% 32
Use Cascading Style Sheets 76% 14% 10% 111
Use extensions for fine-grained security 53% 35% 12% 49
Use Model-View-Controller framework 90% 3% 7% 302
Use templates to standardize layout 53% 38% 9% 45
Validate email addresses 44% 41% 15% 374
Validate generated HTML 72% 15% 13% 306
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 47% 27% 27% 64
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 67% 17% 16% 381
Actions 71% 20% 10% 92
Align menu items 67% 20% 13% 93
Change theme 68% 18% 14% 142
Consider JGoodies Forms for layouts 71% 8% 21% 112
Don't bury dialogs 64% 16% 20% 25
Don't subclass JDialog or JFrame 30% 41% 29% 153
Filter table rows 50% 39% 11% 18
Input dialogs 52% 25% 22% 40
Launch other applications 73% 27% 0% 26
Layout Managers 63% 24% 14% 235
Look and Feel guidelines 85% 8% 6% 48
Minimal Swing application 61% 21% 18% 118
Observers and listeners 45% 30% 25% 194
Preferences dialogs 47% 17% 37% 30
Provide an uncaught exception handler 60% 22% 19% 124
Render table cells 67% 16% 17% 284
Sort table rows 45% 30% 25% 71
Splash screen 56% 31% 13% 305
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 58% 23% 19% 154
Swing utility tasks 79% 13% 8% 39
Timers 33% 49% 18% 131
Using JavaHelp 53% 30% 17% 90
Using preferences 46% 32% 22% 65
Verify input with Model Objects 64% 18% 18% 11
Verify input with regular expressions 44% 33% 23% 39
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 44% 33% 23% 358
Avoid empty catch blocks 83% 10% 6% 305
Be specific in throws clause 60% 33% 7% 256
Beware of unknown root causes 33% 30% 37% 27
Checked versus unchecked exceptions 52% 28% 20% 1502
Exception translation 91% 6% 3% 122
Exceptions and control flow 70% 15% 15% 162
Finally and catch 66% 20% 14% 538
Javadoc all exceptions 56% 23% 21% 133
Pass all pertinent data to exceptions 95% 1% 4% 117
Stack trace as String 77% 14% 8% 708
Use template for repeated try-catch 65% 11% 24% 79
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 9% 328
Buffering usually appropriate 88% 6% 6% 67
Console input 54% 29% 17% 262
Copy a file 68% 23% 9% 96
Reading and writing binary files 49% 26% 25% 260
Reading and writing Serializable objects 58% 26% 16% 351
Reading and writing text files 61% 23% 17% 3136
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 10% 7% 287
Connection pools 87% 6% 7% 282
Consider data layer tools 58% 18% 24% 38
Consider using standard SQL 68% 18% 14% 94
Consider wrapper classes for optional data 76% 13% 10% 67
Data access objects 64% 20% 17% 269
Data exception wrapping 74% 14% 12% 57
Data is king 88% 6% 7% 106
Don't perform basic SQL tasks in code 86% 9% 6% 70
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 54% 32% 14% 176
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 90% 3% 7% 30
Remember the basics of database design 88% 7% 5% 60
Simplify database operations 53% 26% 21% 19
Try pseudo-persistence for mock ups 63% 26% 11% 27
Use template for transactions 67% 6% 28% 18
CollectionsYesNoUndecidedVotes
Choosing the right Collection 81% 9% 10% 689
Encapsulate collections 81% 7% 12% 184
Iterate without an index 77% 17% 6% 306
Prefer Collections over older classes 85% 6% 9% 117
Two ways of using Iterator 62% 24% 15% 1319
Use for-each liberally 76% 15% 8% 236
Use interface references to Collections 70% 19% 11% 109
Use standard Collections 82% 7% 11% 161
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 35% 23% 509
Implementing compareTo 51% 33% 16% 370
Implementing equals 60% 27% 13% 301
Implementing hashCode 56% 27% 17% 372
Implementing toString 51% 30% 19% 404
Never rely on finalize 72% 16% 12% 92
Common TasksYesNoUndecidedVotes
Arrays as String 47% 36% 17% 279
Clipboard copy and paste 78% 13% 9% 1697
Command line operations 45% 38% 17% 271
Compare and sort Strings 52% 33% 15% 267
Copy an array 60% 29% 12% 616
Determine if Strings are equal 67% 24% 9% 524
Examine bytecode 51% 37% 12% 43
Fetch web page and header 65% 21% 15% 313
Generate random numbers 62% 26% 12% 10915
Get database connection 56% 28% 16% 1163
Get size of object in memory 40% 44% 16% 349
Implement code tables 59% 20% 22% 51
Internationalization 52% 27% 21% 62
Logging messages 61% 22% 16% 1420
Measure application performance 77% 14% 9% 56
Modernize old code 89% 7% 4% 54
Open file in native directory 62% 25% 12% 8
Parse text 61% 22% 17% 631
Pattern-match lines of a file 58% 28% 15% 236
Read jar version information 58% 34% 8% 86
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 16% 11% 1093
Replace a substring 59% 30% 11% 386
Representing money 75% 12% 13% 482
Send an email 56% 24% 21% 2027
Time execution speed 70% 22% 8% 128
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 71% 16% 13% 160
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 738
Immutable objects 82% 9% 9% 1089
Lazy initialization 76% 15% 9% 171
Model Objects 65% 15% 20% 99
Plugin Factory 70% 11% 19% 27
Private constructor 74% 15% 11% 858
Singleton 73% 17% 9% 299
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 375
Wrapper (Decorator) 60% 24% 16% 62
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 7% 7% 109
Avoid raw types 79% 13% 8% 187
Beware of instanceof operator 61% 24% 15% 1758
Class for constants 67% 20% 13% 720
Construct classes from the outside in 91% 6% 3% 64
Do not break portability 77% 18% 5% 73
Don't declare local variables before use 57% 26% 17% 253
Fields should usually be private 67% 21% 13% 117
Interface for constants 32% 55% 13% 715
Know the core libraries 81% 8% 11% 110
Minimize ripple effects 85% 4% 11% 131
Naming conventions 32% 60% 8% 343
Nest classes with care 54% 31% 15% 13
Output parameters 41% 38% 21% 165
Separate public and private members 71% 19% 10% 83
String concatenation does not scale 85% 10% 6% 162
Tag or marker interfaces 66% 19% 15% 196
Uncommon classes need explicit imports 78% 13% 9% 101
Use @Override liberally 82% 10% 8% 393
Use final liberally 60% 23% 17% 581
Use javadoc liberally 76% 11% 12% 157
Use static imports rarely 59% 27% 13% 610
Use System.exit with care 67% 19% 14% 585
Use Version Control tools 70% 12% 18% 57
Validate method arguments 63% 22% 15% 220
Wisdom, not rules 95% 2% 2% 40
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 77% 8% 15% 164
Designing for subclassing 74% 15% 12% 68
Overridable methods need special care 83% 6% 10% 96
Remember styles of inheritance 93% 0% 7% 46
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 63% 23% 14% 286
Beware of Byte Order Marks 70% 27% 3% 30
Beware of DecimalFormat 45% 31% 24% 175
Beware of floating point numbers 89% 9% 3% 114
Clarifying method 91% 5% 3% 91
Coding conventions 86% 5% 10% 84
Compile regular expressions once 76% 16% 8% 50
Conditional compile 50% 39% 11% 209
Consider code generators 75% 14% 11% 73
Consider immutable forms for dates 46% 37% 17% 52
Conventional name for return value 72% 20% 8% 137
Defensive copying 87% 6% 7% 416
Design by Contract 81% 10% 10% 156
Don't use tab characters 35% 61% 4% 283
Extra space in argument list 20% 74% 6% 533
Generating unique IDs 58% 26% 15% 2087
Include 'from', exclude 'to' 77% 13% 10% 52
Multiple return statements 55% 32% 13% 435
Overloading can be tricky 77% 16% 7% 95
Package by feature, not layer 70% 14% 16% 857
Passwords never in clear text 68% 17% 15% 127
Prefer empty items to null ones 69% 20% 11% 393
Quote dynamic text when logging 80% 13% 7% 91
Self-encapsulate fields 63% 18% 19% 181
Structs are occasionally useful 67% 16% 17% 179
Test using main method 39% 49% 12% 104
Try alternatives to ResourceBundle 33% 33% 34% 61
Use a fake system clock 58% 23% 19% 130
Use a testing framework (JUnit) 84% 9% 7% 111
Use Ant for build scripts 74% 15% 12% 254
Use boxing with care 67% 21% 13% 190
Use enums to restrict arguments 73% 14% 13% 119
Validate state with class invariants 58% 25% 17% 64
Validation belongs in a Model Object 60% 31% 9% 118
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 137
Assert use cases 37% 43% 20% 191
Assertions in general 88% 12% 0% 33
Force enabling of assertions 55% 30% 15% 53
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 63% 19% 18% 510
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 54% 30% 16% 204
Constructors in general 66% 28% 6% 47
Constructors shouldn't call overridables 60% 24% 15% 156
Constructors shouldn't start threads 72% 15% 13% 39
Copy constructors 65% 22% 13% 1141
Don't pass 'this' out of a constructor 59% 26% 15% 39
Initializing fields to 0-false-null is redundant 68% 23% 9% 328
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 977
Serialization and subclassing 50% 31% 19% 98
Some classes need readResolve 76% 12% 11% 72
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 12% 13% 430
Avoid ThreadGroup 55% 25% 20% 157
Data integrity first 73% 11% 16% 137
Document thread safety 73% 18% 9% 45
Dump thread information 77% 18% 5% 22
Handle InterruptedException 60% 23% 17% 30
Launch thread is just another user thread 85% 6% 9% 34
Objects communicating across threads 71% 17% 12% 130
Perform N tasks in parallel 63% 17% 20% 250
Prefer modern libraries for concurrency 94% 6% 0% 16
Query host for the number of processors 91% 6% 3% 33
Read-write locks 73% 15% 12% 94
Remember the types of intrinsic lock 80% 10% 9% 256
Schedule periodic tasks 67% 19% 14% 1892
Stop threads through cooperation 63% 29% 8% 149
Synchronize access to mutable fields 56% 28% 16% 184
Synchronized is implementation detail 62% 24% 14% 91
Thread priorities are not portable 67% 18% 16% 45
Use finally to unlock 85% 9% 6% 34
© 2016 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 -