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. The Engineer (wears a cowboy hat)

The Engineer (wears a cowboy hat)

Scheduled Pinned Locked Moved The Weird and The Wonderful
javascript
8 Posts 7 Posters 0 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.
  • R Offline
    R Offline
    RobCroll
    wrote on last edited by
    #1

    Bumped into an interesting “Engineered” approach the other day. Went for a meeting to discuss 2 applications that share many common features. So I was expecting 2 solutions, each sharing a number of projects. How wrong I was. It turned out to be 2 applications in the one project! I didn't react surprised because I've seen the approach before. One project liberally sprinkled with pre-processor directives.

    #if APP_ABC
    //Do stuff for ABC application
    #else
    //Do stuff for XYZ application
    #endif

    Fortunately the developer reassured me he was an Engineer a few times so that made me feel a lot of better. :doh:

    "You get that on the big jobs."

    J Sander RosselS 2 Replies Last reply
    0
    • R RobCroll

      Bumped into an interesting “Engineered” approach the other day. Went for a meeting to discuss 2 applications that share many common features. So I was expecting 2 solutions, each sharing a number of projects. How wrong I was. It turned out to be 2 applications in the one project! I didn't react surprised because I've seen the approach before. One project liberally sprinkled with pre-processor directives.

      #if APP_ABC
      //Do stuff for ABC application
      #else
      //Do stuff for XYZ application
      #endif

      Fortunately the developer reassured me he was an Engineer a few times so that made me feel a lot of better. :doh:

      "You get that on the big jobs."

      J Offline
      J Offline
      JV9999
      wrote on last edited by
      #2

      What no #if DEBUG vs #if RELEASE bugs in that code? :doh: Damn, he's good ;P You should have asked him if he ever swapped dll's between the applications. That would be great fun :laugh:

      R 1 Reply Last reply
      0
      • R RobCroll

        Bumped into an interesting “Engineered” approach the other day. Went for a meeting to discuss 2 applications that share many common features. So I was expecting 2 solutions, each sharing a number of projects. How wrong I was. It turned out to be 2 applications in the one project! I didn't react surprised because I've seen the approach before. One project liberally sprinkled with pre-processor directives.

        #if APP_ABC
        //Do stuff for ABC application
        #else
        //Do stuff for XYZ application
        #endif

        Fortunately the developer reassured me he was an Engineer a few times so that made me feel a lot of better. :doh:

        "You get that on the big jobs."

        Sander RosselS Offline
        Sander RosselS Offline
        Sander Rossel
        wrote on last edited by
        #3

        My company actually uses such an approach for a Form. The two Forms just happen to look the same. Every Method looks a bit like this:

        If m_screenMode = ScreenMode.ScreenOne Then
        ' Do stuff.
        Else
        ' Do other stuff.
        End If

        Fixing one mode almost always messes up the other one. Adding Controls to the Form messes up the other one unless you do not forget to hide it etc... It even got to a point where I had to change the name of the Form at runtime because of some other Classes that need a Formname as parameter... Really horrible! X|

        It's an OO world.

        T D B 3 Replies Last reply
        0
        • Sander RosselS Sander Rossel

          My company actually uses such an approach for a Form. The two Forms just happen to look the same. Every Method looks a bit like this:

          If m_screenMode = ScreenMode.ScreenOne Then
          ' Do stuff.
          Else
          ' Do other stuff.
          End If

          Fixing one mode almost always messes up the other one. Adding Controls to the Form messes up the other one unless you do not forget to hide it etc... It even got to a point where I had to change the name of the Form at runtime because of some other Classes that need a Formname as parameter... Really horrible! X|

          It's an OO world.

          T Offline
          T Offline
          TorstenH
          wrote on last edited by
          #4

          I have cleared such a mess here. They had all in one and methods with at least 1000 lines. Total horror!

          regards Torsten I never finish anyth...

          G 1 Reply Last reply
          0
          • T TorstenH

            I have cleared such a mess here. They had all in one and methods with at least 1000 lines. Total horror!

            regards Torsten I never finish anyth...

            G Offline
            G Offline
            gavindon
            wrote on last edited by
            #5

            my current project rebuild that I inherited, has one page that has over 1000 lines of code in the page load. That's it, all in the page load....

            Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning. A crisis on your part does not constitute one on mine.

            1 Reply Last reply
            0
            • Sander RosselS Sander Rossel

              My company actually uses such an approach for a Form. The two Forms just happen to look the same. Every Method looks a bit like this:

              If m_screenMode = ScreenMode.ScreenOne Then
              ' Do stuff.
              Else
              ' Do other stuff.
              End If

              Fixing one mode almost always messes up the other one. Adding Controls to the Form messes up the other one unless you do not forget to hide it etc... It even got to a point where I had to change the name of the Form at runtime because of some other Classes that need a Formname as parameter... Really horrible! X|

              It's an OO world.

              D Offline
              D Offline
              djdanlib 0
              wrote on last edited by
              #6

              I had to decipher code from a VB project like that once. It was an ungodly mess... Each form had about eight different possible modes (to use your terminology) which depended on a lot of things that happened when the form was loaded, and to top it off, each one had multiple steps, like a Wizard of some sort. Well, you had to be a real Wizard to understand that code. I guess I qualified? My employer, which was not the perpetrator of that code, had been contacted to translate that VB mess into a Python-based script with a Web front end. The original "engineer" didn't have a lot of time to tell us how it all worked. We did it. So you have my sympathies!

              1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                My company actually uses such an approach for a Form. The two Forms just happen to look the same. Every Method looks a bit like this:

                If m_screenMode = ScreenMode.ScreenOne Then
                ' Do stuff.
                Else
                ' Do other stuff.
                End If

                Fixing one mode almost always messes up the other one. Adding Controls to the Form messes up the other one unless you do not forget to hide it etc... It even got to a point where I had to change the name of the Form at runtime because of some other Classes that need a Formname as parameter... Really horrible! X|

                It's an OO world.

                B Offline
                B Offline
                BillW33
                wrote on last edited by
                #7

                Yeah, I have seen that kind of stuff in legacy code. Really a pain to work with it. :(

                Just because the code works, it doesn't mean that it is good code.

                1 Reply Last reply
                0
                • J JV9999

                  What no #if DEBUG vs #if RELEASE bugs in that code? :doh: Damn, he's good ;P You should have asked him if he ever swapped dll's between the applications. That would be great fun :laugh:

                  R Offline
                  R Offline
                  RobCroll
                  wrote on last edited by
                  #8

                  Interesting approach that dll idea. I think we'll work on that :laugh:

                  "You get that on the big jobs."

                  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