Poll Summary

Number Of Votes Cast
43,863
Overall Acceptance Rates
Choice Number Percentage
Yes 28,963 66%
No 9,536 22%
Undecided 5,364 12%

Servlets and JSPsYesNoUndecidedVotes
A Web App Framework - WEB4J 58% 23% 19% 482
Always maintain HttpSessions 74% 14% 11% 98
Beware multilingual submit buttons 67% 14% 19% 57
Beware of common hacks 89% 3% 8% 65
Beware of custom cookies 83% 8% 10% 52
Beware of doubly escaped ampersands 74% 18% 9% 57
Beware of URL rewriting 60% 25% 15% 55
Choose form validation style carefully 70% 18% 12% 97
Consider Controllers for redirects 65% 18% 18% 17
Do not synchronize doGet, doPost 69% 20% 11% 580
Emit flexible URLs 73% 7% 20% 41
Escape special characters 62% 27% 10% 705
Forward versus redirect 76% 12% 12% 392
JSPs should contain only presentation logic 88% 7% 6% 196
Loss of data during restart 58% 14% 28% 36
Manage sessions closely 86% 9% 5% 128
Measure web app performance 85% 8% 7% 124
Minimize site response time 75% 13% 13% 79
Parse parameters into domain objects 31% 31% 38% 16
Pre-populate forms 46% 35% 19% 74
Prefer JSTL tags 75% 15% 10% 167
Prefer UTF-8 in all layers 89% 4% 7% 81
Prevent self-linking 43% 48% 10% 21
Refactor large Controllers 79% 7% 14% 14
Repel invalid requests 74% 11% 16% 19
Reuse login page for errors 75% 17% 8% 84
Send trouble-ticket emails 65% 12% 24% 17
Serve binary content 58% 21% 21% 24
Session-scope objects often Serializable 77% 9% 14% 74
Struts seems mediocre 46% 36% 18% 184
Thread-safety in web apps 75% 16% 9% 267
Understand details of FORM tags 85% 8% 8% 13
Use Cascading Style Sheets 76% 18% 5% 38
Use extensions for fine-grained security 57% 30% 13% 23
Use Model-View-Controller framework 89% 4% 7% 232
Use templates to standardize layout 58% 32% 11% 19
Validate email addresses 46% 40% 14% 283
Validate generated HTML 77% 13% 10% 172
Web usability guidelines 86% 3% 10% 29
Wrap file upload requests 48% 24% 27% 33
SwingYesNoUndecidedVotes
A Swing App - StocksMonitor 64% 16% 21% 180
Actions 73% 13% 15% 55
Align menu items 76% 16% 8% 62
Change theme 71% 16% 13% 118
Consider JGoodies Forms for layouts 79% 9% 11% 53
Don't bury dialogs 60% 20% 20% 15
Don't subclass JDialog or JFrame 32% 43% 24% 74
Filter table rows 55% 36% 9% 11
Indicate table sort 59% 28% 12% 32
Input dialogs 50% 29% 21% 28
Launch other applications 77% 23% 0% 13
Layout Managers 72% 18% 10% 97
Look and Feel guidelines 86% 7% 7% 42
Minimal Swing application 64% 24% 12% 25
Observers and listeners 48% 27% 25% 63
Preferences dialogs 30% 20% 50% 20
Provide an uncaught exception handler 62% 22% 16% 32
Render table cells 74% 11% 15% 159
Sort table rows 52% 28% 20% 40
Splash screen 61% 29% 10% 216
Standardized dialogs 58% 32% 11% 19
Swing in general 76% 8% 16% 25
Swing threads 60% 23% 16% 98
Swing utility tasks 77% 15% 8% 26
Timers 31% 54% 15% 74
Using JavaHelp 56% 26% 18% 57
Using preferences 32% 40% 28% 40
Verify input with Model Objects 60% 20% 20% 5
Verify input with regular expressions 50% 29% 21% 24
ExceptionsYesNoUndecidedVotes
Avoid @throws in javadoc 43% 33% 24% 171
Avoid empty catch blocks 84% 9% 7% 230
Be specific in throws clause 58% 36% 6% 192
Beware of unknown root causes 50% 25% 25% 8
Checked versus unchecked exceptions 55% 27% 18% 890
Exception translation 91% 5% 4% 76
Exceptions and control flow 74% 15% 11% 99
Finally and catch 67% 21% 12% 331
Javadoc all exceptions 59% 24% 17% 58
Pass all pertinent data to exceptions 95% 1% 4% 79
Stack trace as String 80% 12% 8% 530
Use template for repeated try-catch 62% 13% 25% 52
Input-OutputYesNoUndecidedVotes
Always close streams 81% 13% 6% 154
Buffering usually appropriate 91% 6% 2% 47
Console input 48% 34% 17% 128
Copy a file 73% 9% 18% 11
Reading and writing binary files 100% 0% 0% 6
Reading and writing Serializable objects 71% 19% 10% 136
Reading and writing text files 63% 22% 15% 2340
DatabasesYesNoUndecidedVotes
Business identifiers as String 85% 10% 5% 165
Connection pools 87% 7% 6% 225
Consider data layer tools 52% 22% 26% 23
Consider using standard SQL 72% 13% 15% 68
Consider wrapper classes for optional data 73% 14% 12% 49
Data access objects 62% 20% 19% 167
Data exception wrapping 77% 15% 8% 39
Data is king 89% 5% 6% 62
Do not perform database tasks in code 83% 11% 6% 53
Encapsulate connections 79% 9% 12% 34
Keep SQL out of code 56% 33% 11% 117
Prefer PreparedStatement 88% 5% 7% 42
Reduce database code duplication 94% 0% 6% 18
Remember the basics of database design 89% 4% 6% 47
Simplify database operations 54% 15% 31% 13
Try pseudo-persistence for mock ups 65% 18% 18% 17
Use template for transactions 67% 7% 27% 15
CollectionsYesNoUndecidedVotes
Choosing the right Collection 85% 8% 7% 308
Encapsulate collections 87% 3% 10% 99
Iterate without an index 74% 20% 6% 199
Prefer Collections over older classes 82% 8% 10% 77
Two ways of using Iterator 66% 20% 14% 616
Use for-each liberally 87% 10% 3% 98
Use interface references to Collections 69% 19% 12% 67
Use standard Collections 81% 8% 11% 75
Overriding Object MethodsYesNoUndecidedVotes
Avoid clone 43% 35% 22% 341
Implementing compareTo 55% 28% 17% 219
Implementing equals 61% 26% 13% 209
Implementing hashCode 56% 27% 17% 284
Implementing toString 46% 33% 21% 241
Never rely on finalize 70% 19% 11% 63
Common TasksYesNoUndecidedVotes
Arrays as String 46% 38% 16% 160
Clipboard copy and paste 83% 10% 7% 1038
Command line operations 64% 18% 18% 11
Compare and sort Strings 61% 26% 13% 143
Copy an array 67% 23% 10% 399
Determine if Strings are equal 75% 19% 6% 373
Examine bytecode 37% 48% 15% 27
Fetch web page and header 67% 19% 14% 255
Generate random numbers 63% 27% 10% 4605
Get database connection 57% 28% 15% 750
Get size of object in memory 41% 43% 15% 237
Implement code tables 54% 23% 23% 13
Internationalization 60% 16% 24% 25
Logging messages 66% 17% 16% 824
Measure application performance 74% 16% 9% 43
Modernize old code 88% 9% 3% 33
Parse text 61% 22% 18% 422
Pattern-match lines of a file 64% 27% 9% 114
Read jar version information 43% 43% 14% 7
Recovering resources 84% 8% 8% 25
Recursive file listing 76% 14% 9% 850
Replace a substring 62% 29% 9% 323
Representing money 75% 12% 13% 291
Send an email 59% 21% 20% 1442
Time execution speed 74% 21% 5% 99
Common Design PatternsYesNoUndecidedVotes
Abstract Factory 73% 16% 11% 101
Command objects 57% 21% 21% 14
Factory methods 65% 20% 15% 421
Immutable objects 85% 7% 8% 568
Lazy initialization 78% 15% 7% 95
Model Objects 66% 14% 21% 58
Plugin Factory 75% 25% 0% 12
Private constructor 73% 16% 11% 515
Singleton 76% 17% 7% 207
Template method 74% 19% 6% 47
Type-Safe Enumerations 83% 10% 8% 269
Common PracticesYesNoUndecidedVotes
Avoid basic style errors 85% 7% 7% 41
Avoid raw types 83% 10% 7% 83
Beware of instanceof operator 62% 24% 14% 876
Class for constants 71% 19% 10% 321
Construct classes from the outside in 90% 7% 2% 41
Do not break portability 72% 20% 8% 50
Don't declare local variables before use 63% 26% 11% 135
Fields should usually be private 71% 18% 12% 68
Interface for constants 36% 56% 8% 351
Know the core libraries 94% 0% 6% 62
Minimize ripple effects 91% 3% 7% 75
Naming conventions 29% 64% 7% 212
Output parameters 45% 36% 19% 95
Separate public and private members 73% 24% 2% 45
String concatenation does not scale 86% 10% 4% 122
Tag or marker interfaces 69% 19% 12% 26
Uncommon classes need explicit imports 77% 15% 8% 61
Use @Override liberally 87% 8% 6% 53
Use CVS or other source code control 71% 14% 14% 7
Use final liberally 60% 25% 15% 214
Use javadoc liberally 83% 7% 11% 75
Use static imports rarely 59% 29% 12% 192
Use System.exit with care 67% 20% 13% 407
Validate method arguments 67% 23% 10% 103
InheritanceYesNoUndecidedVotes
Consider composition instead of subclassing 75% 7% 18% 84
Designing for subclassing 78% 14% 8% 36
Overridable methods need special care 82% 7% 11% 55
Remember styles of inheritance 93% 0% 7% 28
More Common PracticesYesNoUndecidedVotes
Avoid null if possible 58% 27% 15% 185
Beware of DecimalFormat 44% 34% 22% 100
Beware of floating point numbers 87% 10% 3% 63
Clarifying method 89% 9% 2% 54
Coding conventions 84% 7% 10% 61
Compile regular expressions once 83% 7% 10% 30
Conditional compile 50% 40% 11% 129
Consider code generators 79% 12% 9% 58
Consider immutable forms for dates 44% 41% 15% 39
Conventional name for return value 74% 18% 8% 92
Defensive copying 87% 6% 7% 217
Design by Contract 87% 6% 6% 77
Don't use tab characters 29% 64% 7% 87
Extra space in argument list 20% 75% 5% 384
Generating unique IDs 60% 28% 13% 893
Include 'from', exclude 'to' 74% 14% 11% 35
Multiple return statements 58% 32% 10% 264
Overloading can be tricky 83% 12% 4% 48
Package by feature, not layer 66% 16% 18% 291
Passwords never in clear text 78% 15% 7% 41
Prefer empty items to null ones 76% 17% 7% 222
Quote dynamic text when logging 88% 10% 2% 40
Self-encapsulate fields 57% 22% 22% 102
Test using main method 42% 48% 10% 73
Try alternatives to ResourceBundle 28% 39% 33% 36
Use a fake system clock 58% 19% 23% 43
Use a testing framework (JUnit) 83% 8% 9% 78
Use Ant for build scripts 79% 15% 6% 126
Use boxing with care 70% 21% 9% 112
Use enums to restrict arguments 69% 13% 18% 62
Validate state with class invariants 65% 22% 14% 37
Validation belongs in a Model Object 60% 34% 6% 68
AssertionsYesNoUndecidedVotes
Assert is for private arguments only 86% 11% 2% 88
Assert use cases 54% 36% 11% 56
Assertions in general 92% 8% 0% 25
Force enabling of assertions 50% 35% 15% 34
ConstructorsYesNoUndecidedVotes
Avoid JavaBeans style of construction 65% 19% 16% 308
Beware of mistaken field redeclares 90% 5% 5% 20
Construct Object using class name 68% 24% 8% 96
Constructors in general 69% 26% 6% 35
Constructors shouldn't call overridables 60% 25% 15% 72
Copy constructors 67% 22% 11% 561
Don't let this reference escape 75% 25% 0% 4
Initializing fields to 0-false-null is redundant 69% 24% 7% 139
SerializationYesNoUndecidedVotes
Implementing Serializable 68% 15% 17% 616
Serialization and subclassing 52% 30% 18% 56
Some classes need readResolve 81% 9% 11% 47
ThreadsYesNoUndecidedVotes
Always shutdown an ExecutorService 72% 8% 20% 25
Avoid ThreadGroup 55% 24% 21% 142
Data integrity first 72% 13% 15% 53
Document thread safety 74% 15% 12% 34
Dump thread information 75% 25% 0% 4
Handle InterruptedException 50% 50% 0% 2
Launch thread is just another user thread 80% 8% 12% 25
Objects communicating across threads 72% 15% 12% 97
Perform N tasks in parallel 100% 0% 0% 7
Prefer modern libraries for concurrency 100% 0% 0% 2
Query host for the number of processors 88% 12% 0% 8
Read-write locks 88% 8% 4% 26
Remember the types of intrinsic lock 79% 11% 10% 196
Schedule periodic tasks 69% 19% 12% 1402
Stop threads through cooperation 63% 28% 9% 139
Synchronize access to mutable fields 51% 32% 17% 141
Synchronized is implementation detail 59% 26% 15% 61
Thread priorities are not portable 73% 14% 14% 22
Use finally to unlock 67% 33% 0% 3
© 2012 Hirondelle Systems | Source Code | Contact | License | RSS
Individual code snippets can be used under this BSD license - Last updated on August 1, 2010.
Over 180,000 unique IPs last month - Built with WEB4J.
- In Memoriam : Bill Dirani -