Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. This one made me sigh

This one made me sigh

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
7 Posts 7 Posters 38 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CARPETBURNER
    wrote on last edited by
    #1

    Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

    S R M R J 6 Replies Last reply
    0
    • C CARPETBURNER

      Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      :laugh:

      SSK. Anyone who says sunshine brings happiness has never danced in the rain.

      1 Reply Last reply
      0
      • C CARPETBURNER

        Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

        R Offline
        R Offline
        Russell Jones
        wrote on last edited by
        #3

        PeterTheGreat wrote:

        There are no Subs!!

        They got something right then :-P Russ

        1 Reply Last reply
        0
        • C CARPETBURNER

          Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          Unfortunately this is a misfeature of VB.NET that's inherited from VB6. If you declare a Function, but omit the type of the return value, it is implicitly Object (Variant in VB6). The other misfeature is that in Classic VB, the return value of the function was set by assigning to the name of the function - there was no Return statement. The last value set was the return value, but it didn't return straight away when set. This was very confusing. You could easily forget to set it (in which case it would be defaulted, I think, to the default value for the type, in this case Nothing). Option Strict fixes many problems in VB code (or, rather, turns them into compile-time errors, forcing you to fix them), and thankfully failing to define the return value of a function is one of them, at least as of VB 7.1 (.NET 2003). You will have to fix all the type-coercion errors if you turn it on, though, using explicit casts. I try to use DirectCast where possible (where I know that the object is already of the type I'm asking it to convert to).


          DoEvents: Generating unexpected recursion since 1991

          1 Reply Last reply
          0
          • C CARPETBURNER

            Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

            R Offline
            R Offline
            Ri Qen Sin
            wrote on last edited by
            #5

            That's some pretty bad naming for the functions. According to the naming conventions of .NET, I believe it should be ValidateSession() or at least something with a verb. ValidSession is something I'd use for a boolean value.

            ROFLOLMFAO

            1 Reply Last reply
            0
            • C CARPETBURNER

              Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

              J Offline
              J Offline
              Jeffrey Walton
              wrote on last edited by
              #6

              Hi Peter,

              PeterTheGreat wrote:

              Outsourcing Contrators

              I'm curious. Where did you get your contractors or the firm with which you are contracting? Jeff

              1 Reply Last reply
              0
              • C CARPETBURNER

                Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings :-( Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Validsession() End Sub Public Function validSEssion() if session("username")="" then response.redirect("\Logout.aspx") End Function On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #7

                PeterTheGreat wrote:

                compiled a project from our Outsourcing Contrators...

                That kind of tells something. I'll just keep my Soapbox thoughts about outsourced contractors to myself :rolleyes:

                "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups