Poll Summary

Number Of Votes Cast
75,892
Overall Acceptance Rates
Choice Number Percentage
Yes 48,732 64%
No 16,892 22%
Undecided 10,268 14%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 61% 18% 21% 1775
Always maintain HttpSessions 74% 17% 9% 148
Beware multilingual submit buttons 65% 19% 16% 150
Beware of common hacks 84% 8% 8% 119
Beware of custom cookies 77% 7% 16% 102
Beware of doubly escaped ampersands 77% 13% 9% 75
Beware of URL rewriting 62% 22% 15% 165
Choose form validation style carefully 72% 18% 11% 120
Consider Controllers for redirects 46% 26% 28% 39
Do not synchronize doGet, doPost 69% 20% 11% 752
Emit flexible URLs 72% 8% 20% 60
Escape special characters 60% 29% 11% 853
Forward versus redirect 72% 14% 14% 642
JSPs should contain only presentation logic 88% 6% 6% 224
Loss of data during restart 64% 16% 20% 94
Manage sessions closely 81% 11% 9% 150
Measure web app performance 86% 8% 6% 184
Minimize site response time 74% 13% 13% 92
Parse parameters into domain objects 38% 33% 29% 24
Pre-populate forms 46% 35% 19% 96
Prefer JSTL tags 74% 15% 11% 198
Prefer UTF-8 in all layers 80% 9% 10% 137
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% 178
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% 202
Thread-safety in web apps 75% 16% 10% 292
Understand details of FORM tags 80% 7% 13% 30
Use Cascading Style Sheets 75% 15% 9% 106
Use extensions for fine-grained security 57% 32% 11% 44
Use Model-View-Controller framework 90% 3% 7% 299
Use templates to standardize layout 51% 40% 9% 43
Validate email addresses 44% 41% 15% 370
Validate generated HTML 72% 15% 13% 300
Web usability guidelines 86% 3% 11% 36
Wrap file upload requests 46% 27% 27% 63
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 67% 17% 16% 359
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 64% 16% 20% 25
Don't subclass JDialog or JFrame 31% 40% 29% 147
Filter table rows 50% 38% 12% 16
Input dialogs 52% 25% 22% 40
Launch other applications 72% 28% 0% 25
Layout Managers 64% 23% 13% 225
Look and Feel guidelines 85% 9% 6% 47
Minimal Swing application 61% 21% 18% 110
Observers and listeners 46% 30% 24% 185
Preferences dialogs 43% 18% 39% 28
Provide an uncaught exception handler 60% 21% 19% 114
Render table cells 67% 16% 17% 278
Sort table rows 47% 29% 24% 68
Splash screen 57% 31% 13% 295
Standardized dialogs 54% 35% 12% 26
Swing in general 76% 9% 15% 34
Swing threads 58% 23% 19% 151
Swing utility tasks 79% 13% 8% 39
Timers 33% 49% 18% 130
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% 342
Avoid empty catch blocks 83% 10% 6% 301
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% 1451
Exception translation 90% 6% 3% 115
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% 700
Use template for repeated try-catch 63% 12% 25% 75
Input-OutputYesNoUndecidedVotes
Always close streams 76% 15% 9% 316
Buffering usually appropriate 89% 6% 5% 62
Console input 54% 29% 17% 253
Copy a file 67% 23% 10% 87
Reading and writing binary files 51% 25% 24% 238
Reading and writing Serializable objects 59% 26% 16% 334
Reading and writing text files 61% 22% 17% 3103
DatabasesYesNoUndecidedVotes
Business identifiers as String 83% 11% 7% 275
Connection pools 87% 6% 7% 280
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% 65
Data access objects 64% 19% 17% 256
Data exception wrapping 75% 15% 11% 55
Data is king 88% 6% 6% 101
Don't perform basic SQL tasks in code 85% 9% 6% 68
Encapsulate connections 80% 7% 14% 44
Keep SQL out of code 53% 33% 14% 172
Prefer PreparedStatement 90% 4% 6% 67
Reduce database code duplication 93% 0% 7% 28
Remember the basics of database design 88% 7% 5% 58
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% 656
Encapsulate collections 82% 7% 11% 177
Iterate without an index 77% 18% 6% 298
Prefer Collections over older classes 85% 6% 9% 115
Two ways of using Iterator 62% 23% 15% 1238
Use for-each liberally 76% 16% 8% 222
Use interface references to Collections 69% 20% 11% 105
Use standard Collections 82% 7% 11% 153
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 42% 35% 22% 494
Implementing compareTo 52% 32% 17% 355
Implementing equals 60% 27% 13% 290
Implementing hashCode 56% 26% 18% 370
Implementing toString 51% 30% 19% 390
Never rely on finalize 71% 16% 12% 91
Common TasksYesNoUndecidedVotes
Arrays as String 46% 37% 17% 274
Clipboard copy and paste 79% 12% 9% 1636
Command line operations 44% 39% 17% 247
Compare and sort Strings 53% 32% 15% 254
Copy an array 61% 28% 11% 599
Determine if Strings are equal 68% 24% 9% 516
Examine bytecode 52% 38% 10% 40
Fetch web page and header 65% 21% 15% 313
Generate random numbers 62% 26% 12% 10071
Get database connection 56% 28% 16% 1139
Get size of object in memory 40% 44% 16% 343
Implement code tables 54% 22% 24% 46
Internationalization 53% 25% 22% 59
Logging messages 61% 22% 17% 1364
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% 615
Pattern-match lines of a file 58% 28% 14% 223
Read jar version information 59% 32% 9% 81
Recovering resources 85% 9% 6% 34
Recursive file listing 74% 15% 11% 1084
Replace a substring 59% 30% 10% 381
Representing money 75% 12% 13% 467
Send an email 56% 23% 21% 1996
Time execution speed 70% 22% 8% 128
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 70% 17% 14% 155
Command objects 55% 20% 25% 20
Factory methods 63% 21% 16% 698
Immutable objects 82% 9% 9% 1044
Lazy initialization 74% 16% 10% 160
Model Objects 65% 15% 20% 97
Plugin Factory 69% 12% 19% 26
Private constructor 75% 15% 11% 829
Singleton 74% 18% 9% 296
Template method 70% 23% 7% 57
Type-Safe Enumerations 80% 11% 9% 368
Wrapper (Decorator) 67% 19% 13% 52
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 86% 8% 7% 104
Avoid raw types 78% 14% 8% 183
Beware of instanceof operator 61% 24% 16% 1702
Class for constants 68% 20% 12% 665
Construct classes from the outside in 93% 5% 2% 59
Do not break portability 77% 18% 5% 73
Don't declare local variables before use 58% 26% 16% 239
Fields should usually be private 67% 20% 13% 112
Interface for constants 31% 56% 13% 666
Know the core libraries 83% 7% 11% 103
Minimize ripple effects 87% 3% 10% 126
Naming conventions 32% 60% 8% 332
Nest classes with care 50% 33% 17% 12
Output parameters 40% 38% 22% 157
Separate public and private members 70% 20% 10% 81
String concatenation does not scale 85% 10% 6% 157
Tag or marker interfaces 67% 19% 14% 176
Uncommon classes need explicit imports 78% 13% 9% 99
Use @Override liberally 84% 9% 7% 355
Use final liberally 60% 23% 17% 538
Use javadoc liberally 76% 12% 11% 148
Use static imports rarely 60% 27% 13% 558
Use System.exit with care 67% 19% 14% 571
Use Version Control tools 72% 11% 17% 53
Validate method arguments 64% 22% 14% 208
Wisdom, not rules 97% 3% 0% 35
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% 274
Beware of Byte Order Marks 68% 29% 4% 28
Beware of DecimalFormat 45% 31% 23% 172
Beware of floating point numbers 91% 7% 2% 107
Clarifying method 91% 6% 3% 88
Coding conventions 87% 5% 8% 83
Compile regular expressions once 76% 15% 9% 46
Conditional compile 50% 39% 11% 202
Consider code generators 74% 14% 11% 70
Consider immutable forms for dates 45% 37% 18% 49
Conventional name for return value 72% 21% 8% 131
Defensive copying 88% 5% 7% 398
Design by Contract 82% 10% 9% 146
Don't use tab characters 34% 62% 5% 253
Extra space in argument list 20% 74% 6% 520
Generating unique IDs 58% 27% 15% 1963
Include 'from', exclude 'to' 77% 13% 10% 52
Multiple return statements 55% 32% 13% 420
Overloading can be tricky 76% 16% 8% 92
Package by feature, not layer 70% 14% 16% 765
Passwords never in clear text 69% 17% 14% 121
Prefer empty items to null ones 70% 20% 10% 377
Quote dynamic text when logging 79% 14% 7% 86
Self-encapsulate fields 62% 18% 20% 175
Structs are occasionally useful 68% 17% 15% 149
Test using main method 39% 49% 12% 102
Try alternatives to ResourceBundle 32% 33% 35% 60
Use a fake system clock 58% 24% 18% 121
Use a testing framework (JUnit) 84% 8% 7% 107
Use Ant for build scripts 74% 14% 12% 248
Use boxing with care 66% 21% 12% 185
Use enums to restrict arguments 75% 13% 12% 114
Validate state with class invariants 57% 25% 17% 63
Validation belongs in a Model Object 60% 31% 9% 118
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 82% 13% 4% 136
Assert use cases 38% 41% 21% 183
Assertions in general 91% 9% 0% 32
Force enabling of assertions 55% 30% 15% 53
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 18% 18% 471
Beware of mistaken field redeclares 83% 10% 7% 30
Construct Object using class name 54% 30% 16% 201
Constructors in general 67% 26% 7% 46
Constructors shouldn't call overridables 59% 24% 16% 143
Constructors shouldn't start threads 69% 17% 14% 36
Copy constructors 65% 23% 12% 1056
Don't pass 'this' out of a constructor 62% 24% 15% 34
Initializing fields to 0-false-null is redundant 69% 23% 8% 306
SerializationYesNoUndecidedVotes
Implementing Serializable 64% 18% 18% 946
Serialization and subclassing 51% 31% 19% 95
Some classes need readResolve 76% 12% 12% 68
ThreadsYesNoUndecidedVotes
Always shut down an ExecutorService 75% 11% 14% 394
Avoid ThreadGroup 54% 25% 21% 156
Data integrity first 74% 12% 15% 129
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% 16% 19% 215
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% 82
Remember the types of intrinsic lock 80% 10% 10% 251
Schedule periodic tasks 68% 19% 13% 1855
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 -