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. Something original

Something original

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpcomgraphicsgame-dev
24 Posts 11 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.
  • S Super Lloyd

    Inheriting the maintenance of some 3rd party code today! Mused over it, looking at the compilation warningS.... I did find this piece of code, aw... I should say, while I know it's valid C#, it displays a creativity beyond my own!!!

    public class DesignRegistrationSearchCriteria
    {
    public string Manufacturer { get; set; }
    public string manufacturer { get; set; }
    // ...
    }

    My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!

    M Offline
    M Offline
    MacSpudster
    wrote on last edited by
    #14

    A *much* better version:

    public class DesignRegistrationSearchCriteria
    {
    private string _Manufacturer;

    private string \_manufacturer
    {
       get { return \_Manufacturer; }
       set { \_Manufacturer = value;
    }
    
    public string Manufacturer
    {
       get { return \_Manufacturer; }
       set { \_Manufacturer = value; }
    }
    
    
    public string manufacturer
    {
       get { return \_manufacturer; }
       set { \_manufacturer = value; }
    }
    
    // ...
    

    }

    L B 2 Replies Last reply
    0
    • S Sentenryu

      A guy that worked here for 7 months left for us a mvc application that only has 1 view model for 17 views. Where do you think he put all the data? yes, on that view model. That thing has properties that differ only by casing, only by swapping 'c' with 'ç', only by using accentuation (like 'Região' and 'Regiao') and by all of that('regiao', 'região', 'Regiao', 'Região'). All of those properties have a different meaning. You're lucky that you only need to deal with low/upper case differences.

      I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p) "Given the chance I'd rather work smart than work hard." - PHS241 "'Sophisticated platform' typically means 'I have no idea how it works.'"

      L Offline
      L Offline
      Lutoslaw
      wrote on last edited by
      #15

      Sentenryu wrote:

      That thing has properties that differ only by casing, only by swapping 'c' with 'ç', only by using accentuation (latike 'Região' and 'Regiao') and by all of that('regiao', 'região', 'Regiao', 'Região').

      Coool. What does "regiao" mean, anyway? A LOT of :java::java::java:?

      Greetings - Jacek

      S 1 Reply Last reply
      0
      • M MacSpudster

        A *much* better version:

        public class DesignRegistrationSearchCriteria
        {
        private string _Manufacturer;

        private string \_manufacturer
        {
           get { return \_Manufacturer; }
           set { \_Manufacturer = value;
        }
        
        public string Manufacturer
        {
           get { return \_Manufacturer; }
           set { \_Manufacturer = value; }
        }
        
        
        public string manufacturer
        {
           get { return \_manufacturer; }
           set { \_manufacturer = value; }
        }
        
        // ...
        

        }

        L Offline
        L Offline
        Lutoslaw
        wrote on last edited by
        #16

        public class TrafficLightsWentWrong
        {
        public string manufacturer
        {
        get { return Manufacturer; }
        set { Manufacturer = value; }
        }
        public string Manufacturer
        {
        get { return _manufacturer; }
        set { _manufacturer = value; }
        }
        public string _manufacturer
        {
        get
        {
        // reducing memory usage
        return manufacturer;
        }
        set { manufacturer = value; }
        }
        }

        Greetings - Jacek

        1 Reply Last reply
        0
        • L Lutoslaw

          Sentenryu wrote:

          That thing has properties that differ only by casing, only by swapping 'c' with 'ç', only by using accentuation (latike 'Região' and 'Regiao') and by all of that('regiao', 'região', 'Regiao', 'Região').

          Coool. What does "regiao" mean, anyway? A LOT of :java::java::java:?

          Greetings - Jacek

          S Offline
          S Offline
          Sentenryu
          wrote on last edited by
          #17

          Portuguese for region, but he also has properties for coffe, 5 different types of coffe. And some bird species. Sadly, no woody woodpecker :sigh:

          I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p) "Given the chance I'd rather work smart than work hard." - PHS241 "'Sophisticated platform' typically means 'I have no idea how it works.'"

          L 1 Reply Last reply
          0
          • S Sentenryu

            Portuguese for region, but he also has properties for coffe, 5 different types of coffe. And some bird species. Sadly, no woody woodpecker :sigh:

            I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p) "Given the chance I'd rather work smart than work hard." - PHS241 "'Sophisticated platform' typically means 'I have no idea how it works.'"

            L Offline
            L Offline
            Lutoslaw
            wrote on last edited by
            #18

            Is there a single property for each actual type of coffee or each type of coffee has it's own set of properties (with various accentation variants, like Blackcoffee, blackçcoffee, Milkçoffee, milçcoffee, etc..)?

            Greetings - Jacek

            S 1 Reply Last reply
            0
            • L Lutoslaw

              Is there a single property for each actual type of coffee or each type of coffee has it's own set of properties (with various accentation variants, like Blackcoffee, blackçcoffee, Milkçoffee, milçcoffee, etc..)?

              Greetings - Jacek

              S Offline
              S Offline
              Sentenryu
              wrote on last edited by
              #19

              I could copy and paste the code and you wouldn't believe, you nailed it. Each type of coffe has it's own set of properties. I'm very luck that i don't have to deal with that code... yet...

              I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p) "Given the chance I'd rather work smart than work hard." - PHS241 "'Sophisticated platform' typically means 'I have no idea how it works.'"

              L 1 Reply Last reply
              0
              • S Sentenryu

                I could copy and paste the code and you wouldn't believe, you nailed it. Each type of coffe has it's own set of properties. I'm very luck that i don't have to deal with that code... yet...

                I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p) "Given the chance I'd rather work smart than work hard." - PHS241 "'Sophisticated platform' typically means 'I have no idea how it works.'"

                L Offline
                L Offline
                Lutoslaw
                wrote on last edited by
                #20

                Excuse me, but it is getting very interesting. Region + birds + coffee = :doh: . What kind of app would need all of those... tags [^]>? You are pulling my leg, don't you?

                Greetings - Jacek

                1 Reply Last reply
                0
                • M MacSpudster

                  A *much* better version:

                  public class DesignRegistrationSearchCriteria
                  {
                  private string _Manufacturer;

                  private string \_manufacturer
                  {
                     get { return \_Manufacturer; }
                     set { \_Manufacturer = value;
                  }
                  
                  public string Manufacturer
                  {
                     get { return \_Manufacturer; }
                     set { \_Manufacturer = value; }
                  }
                  
                  
                  public string manufacturer
                  {
                     get { return \_manufacturer; }
                     set { \_manufacturer = value; }
                  }
                  
                  // ...
                  

                  }

                  B Offline
                  B Offline
                  Brisingr Aerowing
                  wrote on last edited by
                  #21

                  Compilation error on line 8. '}' expected.

                  brisingr_aerowing@Gryphon-PC $ rake in_the_dough Raking in the dough brisingr_aerowing@Gryphon-PC $ make lots_of_money Making lots_of_money

                  1 Reply Last reply
                  0
                  • S Super Lloyd

                    Inheriting the maintenance of some 3rd party code today! Mused over it, looking at the compilation warningS.... I did find this piece of code, aw... I should say, while I know it's valid C#, it displays a creativity beyond my own!!!

                    public class DesignRegistrationSearchCriteria
                    {
                    public string Manufacturer { get; set; }
                    public string manufacturer { get; set; }
                    // ...
                    }

                    My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!

                    E Offline
                    E Offline
                    ExcellentOrg
                    wrote on last edited by
                    #22

                    Capital M is for days on which you are gonna be paid your slavery subsistence allowance (aka Salary). small m is at all other times.

                    1 Reply Last reply
                    0
                    • B BotCar

                      Makes sense. You wouldn't want people getting a compiler error because they mis-capitalized something. That said, there's 212 ways to capitalize "manufacturer". You have some work to do...

                      What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake.

                      M Offline
                      M Offline
                      MarkRHolbrook
                      wrote on last edited by
                      #23

                      We have some of that going on in this project too. We have a class something like:

                      public partial class Location
                      {
                      Location Location { get; set; }
                      Location location { get; set; }
                      }

                      But what really killed me is your signature line: What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake.

                      M 1 Reply Last reply
                      0
                      • M MarkRHolbrook

                        We have some of that going on in this project too. We have a class something like:

                        public partial class Location
                        {
                        Location Location { get; set; }
                        Location location { get; set; }
                        }

                        But what really killed me is your signature line: What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake.

                        M Offline
                        M Offline
                        MarkRHolbrook
                        wrote on last edited by
                        #24

                        As I sat here working I thought about your signature again: What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake. What struck me is that most of my career has been in high-resolution measurement and robotic control. And I specifically remember two projects where this signature almost became truth. First was a big Sieko SCARA robotic disk sorter. This robot measured almost 4 feet at its longest extension and it could retract and move 180 degrees and extend out 4 feet in the other direction in just about 1/10 of a second. The thing was bloody fast! We of course built a plexiglass sensor tripped cage around the thing so no idiot would get it it's way. Well one did. He removed the plexiglass portion where he needed to work, jumped the sensor and leaned in slightly to look at an issue with a printer. He spent about a week in the hospital after the bump on the head. The next was an instrument down the line from the disk sorter. It was a combiner. It had a big chuck on it to pick up about 25 disks and it would move laterally left/right to combine disks into caddies for shipment. Of course it needed to be fast so we used the biggest NEMA steppers and drivers we could find. This thing could traverse about 4 feet in 1/10 of a second. It too had a plexiglass cage. But one day I was working underneath it looking at some issues with the conveyor, I was well clear but then I heard this scream and instinctively I hit one of the gazillion estop buttons we'd wired in. A young assemply worker had her hand caught between the side of the machine and the moving carriage. Crushed quite a few bones. Why she had her hand in there was beyond me. But of course it was the software's fault for not "knowing" that a hand was in the way and gracefully stopping. Sigh... Third was an instrument that spun silicon wafers to coat them for prep. It used a big servo motor for the spinner. They had to spin pretty fast. They would come in, a mechanical centering device would center them on the vacuum chuck, retract then they would lower into a bowl and the big servo motor would spin them up to a fairly high speed. Well those of you familiar with servos know they need to be tuned. Kd, Ki, Kp, etc. Usually you have to do it under load. So stupid me put a 300mm wafer on the chuck, centered it, lowered it in to the bowl, opened the protective lid, jumped the protection sensor and hit go on the tuning algorithm. That thing

                        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