Click here to Skip to main content
15,897,371 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: NULL Checking and Defensive Programming Pin
AshokParikh18-Dec-08 23:38
AshokParikh18-Dec-08 23:38 
GeneralRe: NULL Checking and Defensive Programming Pin
Robert Surtees19-Dec-08 2:56
Robert Surtees19-Dec-08 2:56 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult19-Dec-08 2:58
mvePIEBALDconsult19-Dec-08 2:58 
GeneralRe: NULL Checking and Defensive Programming Pin
bmcleod19-Dec-08 3:28
bmcleod19-Dec-08 3:28 
GeneralRe: NULL Checking and Defensive Programming Pin
notmasteryet19-Dec-08 3:37
notmasteryet19-Dec-08 3:37 
GeneralRe: NULL Checking and Defensive Programming Pin
Le centriste19-Dec-08 4:58
Le centriste19-Dec-08 4:58 
GeneralRe: NULL Checking and Defensive Programming Pin
Randor 19-Dec-08 5:54
professional Randor 19-Dec-08 5:54 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic20-Dec-08 15:21
Nemanja Trifunovic20-Dec-08 15:21 
Randor wrote:
Of course checking for NULL pointers is a philosophy however its one that I follow. I always check for NULL pointers before using them and when I am done using my pointer I assign it a NULL value. Its two simple rules that I follow and guarantees that I never have a NULL pointer exception in my code.


There is no such thing as a "NULL pointer exception" - there is "access violation" and if you follow your rules you may still very easily run into it, as demonstrated in the code snippet here[^].


GeneralRe: NULL Checking and Defensive Programming Pin
Randor 20-Dec-08 18:30
professional Randor 20-Dec-08 18:30 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic21-Dec-08 4:16
Nemanja Trifunovic21-Dec-08 4:16 
GeneralRe: NULL Checking and Defensive Programming [modified] Pin
Nemanja Trifunovic19-Dec-08 12:07
Nemanja Trifunovic19-Dec-08 12:07 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult19-Dec-08 17:10
mvePIEBALDconsult19-Dec-08 17:10 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic20-Dec-08 12:55
Nemanja Trifunovic20-Dec-08 12:55 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult20-Dec-08 13:44
mvePIEBALDconsult20-Dec-08 13:44 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic20-Dec-08 14:46
Nemanja Trifunovic20-Dec-08 14:46 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult20-Dec-08 17:00
mvePIEBALDconsult20-Dec-08 17:00 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic20-Dec-08 17:08
Nemanja Trifunovic20-Dec-08 17:08 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic21-Dec-08 4:19
Nemanja Trifunovic21-Dec-08 4:19 
GeneralRe: NULL Checking and Defensive Programming Pin
Dave Kreskowiak20-Dec-08 20:28
mveDave Kreskowiak20-Dec-08 20:28 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic21-Dec-08 4:00
Nemanja Trifunovic21-Dec-08 4:00 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult21-Dec-08 4:02
mvePIEBALDconsult21-Dec-08 4:02 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic21-Dec-08 4:06
Nemanja Trifunovic21-Dec-08 4:06 
GeneralRe: NULL Checking and Defensive Programming Pin
Randor 20-Dec-08 14:40
professional Randor 20-Dec-08 14:40 
GeneralRe: NULL Checking and Defensive Programming Pin
Nemanja Trifunovic20-Dec-08 15:25
Nemanja Trifunovic20-Dec-08 15:25 
GeneralRe: NULL Checking and Defensive Programming Pin
PIEBALDconsult20-Dec-08 17:05
mvePIEBALDconsult20-Dec-08 17:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.