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. They grow up so fast..

They grow up so fast..

Scheduled Pinned Locked Moved The Weird and The Wonderful
collaborationcareer
8 Posts 6 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.
  • J Offline
    J Offline
    jim lahey
    wrote on last edited by
    #1

    At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:

    int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
    this.dataSource.SelectParameters.Add("status", status.ToString());

    Given that Status is an enum with integer values, this would actually suffice:

    this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());

    Bless.

    F B A Z 4 Replies Last reply
    0
    • J jim lahey

      At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:

      int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
      this.dataSource.SelectParameters.Add("status", status.ToString());

      Given that Status is an enum with integer values, this would actually suffice:

      this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());

      Bless.

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #2

      At least the kid theoretically understood what he wanted to accomplish. I'm guessing that you showing him the "correct" way will result in them learning as opposed to doing it over and over again. (Silver lining)

      I wasn't, now I am, then I won't be anymore.

      1 Reply Last reply
      0
      • J jim lahey

        At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:

        int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
        this.dataSource.SelectParameters.Add("status", status.ToString());

        Given that Status is an enum with integer values, this would actually suffice:

        this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());

        Bless.

        B Offline
        B Offline
        BobJanova
        wrote on last edited by
        #3

        A 19 year old producing a working but slightly inelegant solution isn't really a horror. I hope he takes your tips on board and learns the little tricks like this.

        1 Reply Last reply
        0
        • J jim lahey

          At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:

          int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
          this.dataSource.SelectParameters.Add("status", status.ToString());

          Given that Status is an enum with integer values, this would actually suffice:

          this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());

          Bless.

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do. From them, I'd expect something more like this:

          if (Page.IsPostBack == false)
          {
          int status = -1;
          if (_statusBy == Status.FirstStatus)
          {
          status = 0;
          }
          if (_statusBy == Status.SecondStatus)
          {
          status = 1;
          }
          if (_statusBy == Status.ThirdStatus)
          {
          status = 2;
          }
          litStatus.Text = status.ToString();
          }
          string strCmdMySqlCmd = "SELECT * FROM myTable WHERE mtStatus = " + litStatus.Text + " AND mtRecordNumber = " + Request.QueryString["PleaseInjectSomeSql"];
          myDataSource.SelectCommand = strCmdMySqlCmd;

          Count yourself lucky to have such a bright apprentice.

          Thou mewling ill-breeding pignut!

          J 1 Reply Last reply
          0
          • A AspDotNetDev

            That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do. From them, I'd expect something more like this:

            if (Page.IsPostBack == false)
            {
            int status = -1;
            if (_statusBy == Status.FirstStatus)
            {
            status = 0;
            }
            if (_statusBy == Status.SecondStatus)
            {
            status = 1;
            }
            if (_statusBy == Status.ThirdStatus)
            {
            status = 2;
            }
            litStatus.Text = status.ToString();
            }
            string strCmdMySqlCmd = "SELECT * FROM myTable WHERE mtStatus = " + litStatus.Text + " AND mtRecordNumber = " + Request.QueryString["PleaseInjectSomeSql"];
            myDataSource.SelectCommand = strCmdMySqlCmd;

            Count yourself lucky to have such a bright apprentice.

            Thou mewling ill-breeding pignut!

            J Offline
            J Offline
            jim lahey
            wrote on last edited by
            #5

            AspDotNetDev wrote:

            That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do

            Don't get me started, I'll be here all night and it's a friday.

            AspDotNetDev wrote:

            Count yourself lucky to have such a bright apprentice.

            I do, don't get me wrong - I was just surprised that despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff. For a measure of how bright he is, he already hates MOSS development, and that after only a couple of weeks. Clever lad.

            Sander RosselS 1 Reply Last reply
            0
            • J jim lahey

              AspDotNetDev wrote:

              That is far better than some of the garbage I have seen well-aged developers who have been with the company for years do

              Don't get me started, I'll be here all night and it's a friday.

              AspDotNetDev wrote:

              Count yourself lucky to have such a bright apprentice.

              I do, don't get me wrong - I was just surprised that despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff. For a measure of how bright he is, he already hates MOSS development, and that after only a couple of weeks. Clever lad.

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

              jim lahey wrote:

              despite his ability to understand and get on with things fairly autonomously he still does some slightly daft stuff

              Don't we all do that from time to time? :)

              It's an OO world.

              public class Naerling : Lazy<Person>{
              public void DoWork(){ throw new NotImplementedException(); }
              }

              1 Reply Last reply
              0
              • J jim lahey

                At our place we have a few of the "senior" apprentices staying with us in the dev team for a year. When I say "senior", they're about 19 in human years, but look about 8. I got to mentor one for a few weeks and threw him in at the deep end by giving him a MOSS WebPart to develop. For the most part, he's done an OK job and seems to be getting the hang of things, but still comes out with stuff like this:

                int status = (int)(Status)Enum.Parse(typeof(Status), _statusBy.ToString());
                this.dataSource.SelectParameters.Add("status", status.ToString());

                Given that Status is an enum with integer values, this would actually suffice:

                this.dataSource.SelectParameters.Add("status", ((int)_statusBy).ToString());

                Bless.

                Z Offline
                Z Offline
                zenwalker1985
                wrote on last edited by
                #7

                Lol we have this code base written by our german counterparts from like 10 years, and i am sure most of them are atleast in their 40+ age having atleast 10+ years of experience. Lol their code starts with main and ends every god damn thing in it only. There are many surprising methods with 2000 lines of code in it. :zzz: :confused:

                My cUr10U5 w0rlD

                J 1 Reply Last reply
                0
                • Z zenwalker1985

                  Lol we have this code base written by our german counterparts from like 10 years, and i am sure most of them are atleast in their 40+ age having atleast 10+ years of experience. Lol their code starts with main and ends every god damn thing in it only. There are many surprising methods with 2000 lines of code in it. :zzz: :confused:

                  My cUr10U5 w0rlD

                  J Offline
                  J Offline
                  jim lahey
                  wrote on last edited by
                  #8

                  We've got them too. I have to rely on an in house component that dynamically changes the datasource in a particular GIS file type. You have to give it the path to the file you want to change and a new filename for the changed version. If you pass it two nulls or two empty strings or two strings that have never been anywhere near a valid path or filename, it runs through without a peep. If you pass it a null or empty path and a valid new file name it creates an empty file with the name you gave it. If you feed it with correct parameters it also runs through without making any noise, so every single piece of software that uses this component has to check the paths are valid and that the created file at least isn't empty. I guess it's taking the single responsibility principle a little too far :)

                  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