Skip navigation.
Home

news aggregator

December 17, 2004

08:51

A little while back, we got to see how fun recursive sorting algorithms cam be. But that's not the only place where we can have funn + funn-1. How about ... exception handling in java!

public String waitForCreditCardProcessing(String cardNumber,int expDateMonth,int expDateYear)
{
  try {
    while (!getCCProcResult()) {
      System.out.println(cardNumber+","+expDateMonth+"/"+expDateYear);
      Thread.sleep(1000);
    }
    return "Success!";
  } catch (Throwable except) {
    return waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear);
  }
}

Adam Explains ...

getCCProcResult is another method that polls for a file that is dropped into a directory to indicate the credit card processing result. Yes, cardNumber, expDateMonth, etc. are instance variables and do not need to be passed as arguments and serve no purpose here.

Yes, it recurses when there is an exception. If something causes it to always throw an exception, it recurses until it blows the stack.

Oh... and one more thing... the calling code is:

if (!waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear).equalsIgnoreCase("Success!")) ...

Note that "Success!" just meant that the file containing the response now exists and did not indicate the result. There was other code that checked this file and reported whether the card was declined or not.

As an added bonus, it prints the card number it is waiting for settlement on to stdout. This means that the Linux server running this code would spew customer credit card numbers to it's console TTY. Anyone in the colocation facility that turned on the monitor could have gone to Vegas.

Speaking of added bonus, for the "side bar" post, we have Amazon's fast shipping secret.

08:51

A little while back, we got to see how fun recursive sorting algorithms cam be. But that's not the only place where we can have funn + funn-1. How about ... exception handling in java!

public String waitForCreditCardProcessing(String cardNumber,int expDateMonth,int expDateYear)
{
  try {
    while (!getCCProcResult()) {
      System.out.println(cardNumber+","+expDateMonth+"/"+expDateYear);
      Thread.sleep(1000);
    }
    return "Success!";
  } catch (Throwable except) {
    return waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear);
  }
}

Adam Explains ...

getCCProcResult is another method that polls for a file that is dropped into a directory to indicate the credit card processing result. Yes, cardNumber, expDateMonth, etc. are instance variables and do not need to be passed as arguments and serve no purpose here.

Yes, it recurses when there is an exception. If something causes it to always throw an exception, it recurses until it blows the stack.

Oh... and one more thing... the calling code is:

if (!waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear).equalsIgnoreCase("Success!")) ...

Note that "Success!" just meant that the file containing the response now exists and did not indicate the result. There was other code that checked this file and reported whether the card was declined or not.

As an added bonus, it prints the card number it is waiting for settlement on to stdout. This means that the Linux server running this code would spew customer credit card numbers to it's console TTY. Anyone in the colocation facility that turned on the monitor could have gone to Vegas.

Speaking of added bonus, for the "side bar" post, we have Amazon's fast shipping secret.

08:51

A little while back, we got to see how fun recursive sorting algorithms cam be. But that's not the only place where we can have funn + funn-1. How about ... exception handling in java!

public String waitForCreditCardProcessing(String cardNumber,int expDateMonth,int expDateYear)
{
  try {
    while (!getCCProcResult()) {
      System.out.println(cardNumber+","+expDateMonth+"/"+expDateYear);
      Thread.sleep(1000);
    }
    return "Success!";
  } catch (Throwable except) {
    return waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear);
  }
}

Adam Explains ...

getCCProcResult is another method that polls for a file that is dropped into a directory to indicate the credit card processing result. Yes, cardNumber, expDateMonth, etc. are instance variables and do not need to be passed as arguments and serve no purpose here.

Yes, it recurses when there is an exception. If something causes it to always throw an exception, it recurses until it blows the stack.

Oh... and one more thing... the calling code is:

if (!waitForCreditCardProcessing(cardNumber,expDateMonth,expDateYear).equalsIgnoreCase("Success!")) ...

Note that "Success!" just meant that the file containing the response now exists and did not indicate the result. There was other code that checked this file and reported whether the card was declined or not.

As an added bonus, it prints the card number it is waiting for settlement on to stdout. This means that the Linux server running this code would spew customer credit card numbers to it's console TTY. Anyone in the colocation facility that turned on the monitor could have gone to Vegas.

Speaking of added bonus, for the "side bar" post, we have Amazon's fast shipping secret.

December 16, 2004

09:23

Maybe I'm shooting at an unfair target here, but Dave sent in this from Crystal Reports. Now if you think BASIC code can get ugly ... well, just take a look at this ...

if {crGetPassportDetails;1.Name} = 'SOUTH AFRICA' then "Visitors to " + 'South Africa' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'PUERTO RICO' then "Visitors to " + 'Puerto Rico' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'UNITED ARAB EMIRATES' then "Visitors to " + 'United Arab Emirates' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CAYMAN ISLANDS' then "Visitors to " + 'Cayman Islands' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'HONG KONG' then "Visitors to " + 'Hong Kong' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'RUSSIA FED EUROPE' then "Visitors to " + 'Russia Fed Europe' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CZECH REPUBLIC' then "Visitors to " + 'Czech Republic' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'COSTA RICA' then "Visitors to " + 'Costa Rica' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'NEW ZEALAND' then "Visitors to " + 'New Zealand' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ANTIGUA AND BARBUDA' then "Visitors to " + 'Antigua and Barbuda' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ST LUCIA' then "Visitors to " + 'St Lucia' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else "Visitors to " + Mid ({crGetPassportDetails;1.Name},1,1 ) + LowerCase(mid({crGetPassportDetails;1.Name},2,length({crGetPassportDetails;1.Name}))) + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

And for your off-topic "sidebar" post, check out what American Apparel is "pimpin'".

09:23

Maybe I'm shooting at an unfair target here, but Dave sent in this from Crystal Reports. Now if you think BASIC code can get ugly ... well, just take a look at this ...

if {crGetPassportDetails;1.Name} = 'SOUTH AFRICA' then "Visitors to " + 'South Africa' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'PUERTO RICO' then "Visitors to " + 'Puerto Rico' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'UNITED ARAB EMIRATES' then "Visitors to " + 'United Arab Emirates' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CAYMAN ISLANDS' then "Visitors to " + 'Cayman Islands' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'HONG KONG' then "Visitors to " + 'Hong Kong' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'RUSSIA FED EUROPE' then "Visitors to " + 'Russia Fed Europe' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CZECH REPUBLIC' then "Visitors to " + 'Czech Republic' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'COSTA RICA' then "Visitors to " + 'Costa Rica' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'NEW ZEALAND' then "Visitors to " + 'New Zealand' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ANTIGUA AND BARBUDA' then "Visitors to " + 'Antigua and Barbuda' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ST LUCIA' then "Visitors to " + 'St Lucia' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else "Visitors to " + Mid ({crGetPassportDetails;1.Name},1,1 ) + LowerCase(mid({crGetPassportDetails;1.Name},2,length({crGetPassportDetails;1.Name}))) + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

And for your off-topic "sidebar" post, check out what American Apparel is "pimpin'".

09:23

Maybe I'm shooting at an unfair target here, but Dave sent in this from Crystal Reports. Now if you think BASIC code can get ugly ... well, just take a look at this ...

if {crGetPassportDetails;1.Name} = 'SOUTH AFRICA' then "Visitors to " + 'South Africa' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'PUERTO RICO' then "Visitors to " + 'Puerto Rico' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'UNITED ARAB EMIRATES' then "Visitors to " + 'United Arab Emirates' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CAYMAN ISLANDS' then "Visitors to " + 'Cayman Islands' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'HONG KONG' then "Visitors to " + 'Hong Kong' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'RUSSIA FED EUROPE' then "Visitors to " + 'Russia Fed Europe' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'CZECH REPUBLIC' then "Visitors to " + 'Czech Republic' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'COSTA RICA' then "Visitors to " + 'Costa Rica' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'NEW ZEALAND' then "Visitors to " + 'New Zealand' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ANTIGUA AND BARBUDA' then "Visitors to " + 'Antigua and Barbuda' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else if {crGetPassportDetails;1.Name} = 'ST LUCIA' then "Visitors to " + 'St Lucia' + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

else "Visitors to " + Mid ({crGetPassportDetails;1.Name},1,1 ) + LowerCase(mid({crGetPassportDetails;1.Name},2,length({crGetPassportDetails;1.Name}))) + " require a full passport which must be valid for " + {@MinMonths} + " months after departure from this country."

And for your off-topic "sidebar" post, check out what American Apparel is "pimpin'".

December 15, 2004

11:06

... just as Thomas Magle Brodersen found in some production code.

int CEDitLocation::FetchLocationInfo(int index)
{
  for(int ix=0; ix < m_RegArray.GetSize(); ix++){
    if (ix==index)
    {
      m_location=m_RegArray[ix].m_LocationName;
      m_display_type=m_RegArray[ix].m_DisplayType ;
      m_address=m_RegArray[ix].m_IpAddress ;

      UpdateData(false);
      break;
    }
  }
...

11:06

... just as Thomas Magle Brodersen found in some production code.

int CEDitLocation::FetchLocationInfo(int index)
{
  for(int ix=0; ix < m_RegArray.GetSize(); ix++){
    if (ix==index)
    {
      m_location=m_RegArray[ix].m_LocationName;
      m_display_type=m_RegArray[ix].m_DisplayType ;
      m_address=m_RegArray[ix].m_IpAddress ;

      UpdateData(false);
      break;
    }
  }
...

11:06

... just as Thomas Magle Brodersen found in some production code.

int CEDitLocation::FetchLocationInfo(int index)
{
  for(int ix=0; ix < m_RegArray.GetSize(); ix++){
    if (ix==index)
    {
      m_location=m_RegArray[ix].m_LocationName;
      m_display_type=m_RegArray[ix].m_DisplayType ;
      m_address=m_RegArray[ix].m_IpAddress ;

      UpdateData(false);
      break;
    }
  }
...

December 14, 2004

10:18

Being as uncultured as I am, I'm completely to come up with some witty way to tie-in today's post with the Charles Dickens' classic. To my credit though, I did make it through the ultra-condensed version and I watched LOTR:The Two Towers (which I'm sure is a pretty similar story).

Anyway ... Ryan discovered, something we can definately file under "least usefull comments" ... 

Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer)
Dim i As Integer
'this is the version that doesn't have uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
End Sub




Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer, ByVal uerr() As Double, ByVal verr() As Double)

Dim i As Integer
'this is the version that has uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
bwFile.Write(CType(uerr(i), Single))
bwFile.Write(CType(verr(i), Single))
End Sub

And to the other extreme, just immagine how much fun Rob Tevlin has learning how "for" loops and the like work ... every day ...

%REM
This agent has the "On Error" swithced on. If the agent does not run the first thing to do is comment this out.
This will help find the error and save you lots of time.
%END REM


10:18

Being as uncultured as I am, I'm completely to come up with some witty way to tie-in today's post with the Charles Dickens' classic. To my credit though, I did make it through the ultra-condensed version and I watched LOTR:The Two Towers (which I'm sure is a pretty similar story).

Anyway ... Ryan discovered, something we can definately file under "least usefull comments" ... 

Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer)
Dim i As Integer
'this is the version that doesn't have uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
End Sub




Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer, ByVal uerr() As Double, ByVal verr() As Double)

Dim i As Integer
'this is the version that has uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
bwFile.Write(CType(uerr(i), Single))
bwFile.Write(CType(verr(i), Single))
End Sub

And to the other extreme, just immagine how much fun Rob Tevlin has learning how "for" loops and the like work ... every day ...

%REM
This agent has the "On Error" swithced on. If the agent does not run the first thing to do is comment this out.
This will help find the error and save you lots of time.
%END REM


10:18

Being as uncultured as I am, I'm completely to come up with some witty way to tie-in today's post with the Charles Dickens' classic. To my credit though, I did make it through the ultra-condensed version and I watched LOTR:The Two Towers (which I'm sure is a pretty similar story).

Anyway ... Ryan discovered, something we can definately file under "least usefull comments" ... 

Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer)
Dim i As Integer
'this is the version that doesn't have uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
End Sub




Public Overloads Sub WriteFileRecord(ByVal npoints As Integer, ByVal itime As Integer, ByVal uerr() As Double, ByVal verr() As Double)

Dim i As Integer
'this is the version that has uerr and verr in it
bwFile.Write(npoints)
bwFile.Write(itime)
bwFile.Write(CType(uerr(i), Single))
bwFile.Write(CType(verr(i), Single))
End Sub

And to the other extreme, just immagine how much fun Rob Tevlin has learning how "for" loops and the like work ... every day ...

%REM
This agent has the "On Error" swithced on. If the agent does not run the first thing to do is comment this out.
This will help find the error and save you lots of time.
%END REM


December 13, 2004

09:14

I most of us felt (or, will feel) let down after getting our first job of college. Going from the world of "assume there is an unlimited budget, now ..." to "change the text of the error message generated by ..." makes you feel as if your hard-earned Computer Science degree was as useful as Mordar, your almost-equally hard-earned level 28 half-elf wizard. Of course, this is nothing compared to what Michael Jervis must have felt ...

Shortly after graduating, I started with a small web shop that had just been acquired by a big Tin shifter to start up their services offering. My new boss had written his own ASP editor that he wanted me to use in preference of any decent mature third party code editors, or visual Interdev. Last time I looked (a few years back) it was still available, shame it appears to have disappeared. It was a true master piece of an editor. It was impossible to indent code, as the TAB key in the main text area (no syntax highlighting of course) was forcibly bound to change control focus. The choice of colour was "interesting" and it had many other amazing features. But that was just the start of my boss' genius.

This truly is a masterpiece. While a screenshot may be worth a bunch of words, running the application itself is worth ... well ... quite a lot more.

Check it out. It's really worth it. Back to Michael ....

For his next trick, he decided source code control was unnecessary. "If I need to preserve some code, I'll just zip it up." queue the loss of a large amount of work due to re-writing pages and overwriting files by accident.

The real killer though was this was 1999, this was pre Y2K. He was gripped by an awesome fear that SQL Server 7 would turn out not to be Y2K compliant after all, and thus stored all dates in text fields and manually parsed them. Not enough? Ok, just to make sure he didn't make a mistake, he included the date in a second column, in reverse. One text field whateverdate, varchar(8) one whateverdate_reverse, also varchar(8) one with 01101999 the other with 19991001. Hmm. Still not TOO safe, what if his code was not Y2K compliant? How about we ALSO store the date as a separate Year, Month and Day field, varchar(4), varchar(2) and varchar(2). Wasn't that fun? Oh, and to add to the misery, until I started there no-one had done ADO updating, so every insert/update was a hand-rolled SQL statement.

Anyway. Eventually we got bigger, I got moved to work with a new technology with skilled developers all around me, and was happy.

09:14

I most of us felt (or, will feel) let down after getting our first job of college. Going from the world of "assume there is an unlimited budget, now ..." to "change the text of the error message generated by ..." makes you feel as if your hard-earned Computer Science degree was as useful as Mordar, your almost-equally hard-earned level 28 half-elf wizard. Of course, this is nothing compared to what Michael Jervis must have felt ...

Shortly after graduating, I started with a small web shop that had just been acquired by a big Tin shifter to start up their services offering. My new boss had written his own ASP editor that he wanted me to use in preference of any decent mature third party code editors, or visual Interdev. Last time I looked (a few years back) it was still available, shame it appears to have disappeared. It was a true master piece of an editor. It was impossible to indent code, as the TAB key in the main text area (no syntax highlighting of course) was forcibly bound to change control focus. The choice of colour was "interesting" and it had many other amazing features. But that was just the start of my boss' genius.

This truly is a masterpiece. While a screenshot may be worth a bunch of words, running the application itself is worth ... well ... quite a lot more.

Check it out. It's really worth it. Back to Michael ....

For his next trick, he decided source code control was unnecessary. "If I need to preserve some code, I'll just zip it up." queue the loss of a large amount of work due to re-writing pages and overwriting files by accident.

The real killer though was this was 1999, this was pre Y2K. He was gripped by an awesome fear that SQL Server 7 would turn out not to be Y2K compliant after all, and thus stored all dates in text fields and manually parsed them. Not enough? Ok, just to make sure he didn't make a mistake, he included the date in a second column, in reverse. One text field whateverdate, varchar(8) one whateverdate_reverse, also varchar(8) one with 01101999 the other with 19991001. Hmm. Still not TOO safe, what if his code was not Y2K compliant? How about we ALSO store the date as a separate Year, Month and Day field, varchar(4), varchar(2) and varchar(2). Wasn't that fun? Oh, and to add to the misery, until I started there no-one had done ADO updating, so every insert/update was a hand-rolled SQL statement.

Anyway. Eventually we got bigger, I got moved to work with a new technology with skilled developers all around me, and was happy.

09:14

I most of us felt (or, will feel) let down after getting our first job of college. Going from the world of "assume there is an unlimited budget, now ..." to "change the text of the error message generated by ..." makes you feel as if your hard-earned Computer Science degree was as useful as Mordar, your almost-equally hard-earned level 28 half-elf wizard. Of course, this is nothing compared to what Michael Jervis must have felt ...

Shortly after graduating, I started with a small web shop that had just been acquired by a big Tin shifter to start up their services offering. My new boss had written his own ASP editor that he wanted me to use in preference of any decent mature third party code editors, or visual Interdev. Last time I looked (a few years back) it was still available, shame it appears to have disappeared. It was a true master piece of an editor. It was impossible to indent code, as the TAB key in the main text area (no syntax highlighting of course) was forcibly bound to change control focus. The choice of colour was "interesting" and it had many other amazing features. But that was just the start of my boss' genius.

This truly is a masterpiece. While a screenshot may be worth a bunch of words, running the application itself is worth ... well ... quite a lot more.

Check it out. It's really worth it. Back to Michael ....

For his next trick, he decided source code control was unnecessary. "If I need to preserve some code, I'll just zip it up." queue the loss of a large amount of work due to re-writing pages and overwriting files by accident.

The real killer though was this was 1999, this was pre Y2K. He was gripped by an awesome fear that SQL Server 7 would turn out not to be Y2K compliant after all, and thus stored all dates in text fields and manually parsed them. Not enough? Ok, just to make sure he didn't make a mistake, he included the date in a second column, in reverse. One text field whateverdate, varchar(8) one whateverdate_reverse, also varchar(8) one with 01101999 the other with 19991001. Hmm. Still not TOO safe, what if his code was not Y2K compliant? How about we ALSO store the date as a separate Year, Month and Day field, varchar(4), varchar(2) and varchar(2). Wasn't that fun? Oh, and to add to the misery, until I started there no-one had done ADO updating, so every insert/update was a hand-rolled SQL statement.

Anyway. Eventually we got bigger, I got moved to work with a new technology with skilled developers all around me, and was happy.

December 10, 2004

11:21

Jeff Davis sent me this advertisement the other day, and I thought it'd be a perfect compliment to a post. But now every time I look at it, I keep seeing something new. So, here it is, your week-end post.

And feel free to send in more stuff like this; I dig it! Hopefully, you do too.

11:21

Jeff Davis sent me this advertisement the other day, and I thought it'd be a perfect compliment to a post. But now every time I look at it, I keep seeing something new. So, here it is, your week-end post.

And feel free to send in more stuff like this; I dig it! Hopefully, you do too.

11:21

Jeff Davis sent me this advertisement the other day, and I thought it'd be a perfect compliment to a post. But now every time I look at it, I keep seeing something new. So, here it is, your week-end post.

And feel free to send in more stuff like this; I dig it! Hopefully, you do too.

December 9, 2004

09:21

Without Option Strict Off, the compiler wouldn't even let you try to stuff three different return values into a boolean value, as Jeff Atwood's colleague likes to do ...

Friend ReadOnly Property CheckUserRole() As Boolean
  Get
    Dim user As SystemUser = SystemUser.CurrentUser
    If user.AssertRole(RoleTypes.Admin) Then
      Return 0
    Else
      If user.AssertRole(RoleTypes.Training) Then
       Return 1
      Else
        If user.AssertRole(RoleTypes.Supervisor) Then
          Return 2
        End If
      End If
    End If
  End Get
End Property
09:21

Without Option Strict Off, the compiler wouldn't even let you try to stuff three different return values into a boolean value, as Jeff Atwood's colleague likes to do ...

Friend ReadOnly Property CheckUserRole() As Boolean
  Get
    Dim user As SystemUser = SystemUser.CurrentUser
    If user.AssertRole(RoleTypes.Admin) Then
      Return 0
    Else
      If user.AssertRole(RoleTypes.Training) Then
       Return 1
      Else
        If user.AssertRole(RoleTypes.Supervisor) Then
          Return 2
        End If
      End If
    End If
  End Get
End Property