Click here to Skip to main content

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, embarrasing 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: Function name choice PinprofessionalSmart K88-Sep-14 8:57 
GeneralRe: Function name choice [modified] PinmemberJohn M. Drescher8-Sep-14 9:12 
GeneralRe: Function name choice PinprofessionalSmart K88-Sep-14 9:20 
GeneralRe: Function name choice PinmemberOtto Grunf8-Sep-14 9:31 
GeneralThe Sandbox PinmemberColborneGreg30-Aug-14 9:12 
GeneralMessage Removed PinprofessionalBrisingr Aerowing30-Aug-14 11:21 
JokeRe: The Sandbox PinmemberDaveX8630-Aug-14 15:20 
GeneralRe: The Sandbox PinmemberColborneGreg30-Aug-14 19:13 
GeneralKill me PinmemberPhilLenoir28-Aug-14 10:04 
GeneralRe: Kill me PinmemberGary R. Wheeler7-Sep-14 3:38 
GeneralWhat is null equal to? Pinmembersloosecannon25-Aug-14 6:59 
GeneralRe: What is null equal to? PinmemberPIEBALDconsult25-Aug-14 7:27 
GeneralRe: What is null equal to? Pinmembermark merrens25-Aug-14 7:56 
AnswerRe: What is null equal to? [modified] PinprofessionalAfzaal Ahmad Zeeshan25-Aug-14 7:59 
In programming a null object means that this doesn't exist in the memory. For example,
 
int i;
 
if(i == null) {
  MessageBox.Show("Yes, Null!");
} else {
  MessageBox.Show("No, value was added somewhere in the code stack");
}
 
This, would execute if there is no value in i, or the i was never initialized. The code that you're having is something like this
 
// if the variable of value is not initialized
// or contains nothing, does not exist in memory
// .equals(null) is a string method, to check string value
// and has same functionality
if (value == null || value.equals(null)) {
   // then return a string that is NOT null but contains "null"
  return "null";
}
 
The method signature would be like,
 
public string Function1 () {
  // returns a string
}
Favourite line: Throw me to them wolves and close the gate up. I am afraid of what will happen to them wolves - Eminem
~! Firewall !~


modified 25-Aug-14 13:29pm.

GeneralRe: What is null equal to? Pinmembersloosecannon25-Aug-14 8:45 
GeneralRe: What is null equal to? PinprotectorOriginalGriff25-Aug-14 9:15 
GeneralRe: What is null equal to? PinprofessionalBrisingr Aerowing25-Aug-14 13:06 
GeneralRe: What is null equal to? Pinmembersloosecannon25-Aug-14 19:01 
GeneralRe: What is null equal to? PinmemberRob Grainger27-Aug-14 6:47 
GeneralRe: What is null equal to? PinmemberRob Grainger29-Sep-14 0:20 
GeneralRe: What is null equal to? PinprofessionalPaulo Zemek25-Aug-14 9:49 
GeneralRe: What is null equal to? PinprofessionalV.25-Aug-14 20:43 
JokeRe: What is null equal to? PinmemberVark11126-Aug-14 9:23 
GeneralRe: What is null equal to? Pinmembersloosecannon27-Aug-14 4:40 
GeneralRe: What is null equal to? PinprofessionalEddy Vluggen27-Aug-14 8:33 
GeneralRe: What is null equal to? Pinmembersloosecannon27-Aug-14 8:41 
GeneralRe: What is null equal to? PinprofessionalRichard Deeming27-Aug-14 8:53 
GeneralRe: What is null equal to? Pinmemberjeron126-Aug-14 13:03 
GeneralRe: What is null equal to? Pinmembersloosecannon27-Aug-14 4:36 
GeneralRe: What is null equal to? PinmemberRob Grainger27-Aug-14 6:49 
GeneralRe: What is null equal to? PinmemberColborneGreg31-Aug-14 8:39 
GeneralRe: What is null equal to? Pinprofessionalsankarsan parida4-Sep-14 1:22 
GeneralRe: What is null equal to? PinmemberMunchies_Matt10-Sep-14 13:59 
GeneralGive a right username and a right password and you're in... Pinprofessionalyiangos25-Aug-14 5:38 
GeneralRe: Give a right username and a right password and you're in... Pinmembertgrt25-Aug-14 5:42 
GeneralRe: Give a right username and a right password and you're in... [modified] PinmemberPIEBALDconsult25-Aug-14 5:47 
GeneralRe: Give a right username and a right password and you're in... PinmemberBobJanova1-Sep-14 2:48 
GeneralRe: Give a right username and a right password and you're in... PinmemberJMK-NI25-Aug-14 5:53 
GeneralRe: Give a right username and a right password and you're in... PinprofessionalIan Shlasko25-Aug-14 5:55 
GeneralRe: Give a right username and a right password and you're in... Pinprofessionalyiangos25-Aug-14 6:41 
GeneralRe: Give a right username and a right password and you're in... Pinmemberdexterama25-Aug-14 6:06 
GeneralRe: Give a right username and a right password and you're in... Pinprofessionalyiangos25-Aug-14 6:50 
GeneralRe: Give a right username and a right password and you're in... PinmemberPIEBALDconsult25-Aug-14 6:56 
GeneralRe: Give a right username and a right password and you're in... Pinprofessionalyiangos25-Aug-14 7:05 
GeneralRe: Give a right username and a right password and you're in... PinprofessionalMarc Koutzarov29-Aug-14 22:44 
GeneralRe: Give a right username and a right password and you're in... Pinprofessionalyiangos31-Aug-14 7:38 
GeneralAndroid gravity constants PinprofessionalIndivara18-Aug-14 23:04 
GeneralRe: Android gravity constants PinprofessionalBernhard Hiller19-Aug-14 1:08 
GeneralRe: Android gravity constants PinprofessionalRichard Deeming19-Aug-14 2:47 
GeneralRe: Android gravity constants PinmemberKP Lee21-Aug-14 18:57 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 27 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid