Something original
-
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!
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; } } // ...
}
-
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.'"
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
-
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; } } // ...
}
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
-
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
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.'"
-
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.'"
-
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
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.'"
-
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.'"
-
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; } } // ...
}
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
-
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!
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.
-
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.
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.
-
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.
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