private string _typeName;
/// <summary>
/// Add new type name to the specified object for TypeNameSet.
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = "TypeNameSet")]
[Parameter(ParameterSetName = "MemberSet")]
[Parameter(ParameterSetName = NotePropertySingleMemberSet)]
[Parameter(ParameterSetName = NotePropertyMultiMemberSet)]
[ValidateNotNullOrEmpty]
public string TypeName
{
set { _typeName = value; }
get { return _typeName; }
}
-- https://github.com/PowerShell/PowerShell/blob/15c2245af97486...Honestly it seems like just a lot of code and very little meaning. I can't help but think that there's a better way of expressing the solution.
I could have picked the wrong file, but I was poking around in lots of directories before I found any significant C# code at all. It seems like there's a whole 'nother level of boilerplate in the directory structure.
There's no logic there, this is basically just boilerplate for some other code to set properties on an object. Something that actually has some business logic will be much more interesting to read, eg.
https://github.com/PowerShell/PowerShell/blob/15c2245af97486...
I'm fine with verbosity. I'm fine with lots of data type declarations, annotations, things that make the compiler happy, etc.
But a file full of getters and setters? I can put up with it, but I don't understand why.
public string TypeName { get; set; }
not sure why it's not here, could just be older code. The [Parameter] etc stuff is all powershell-specific metadata that defines how to use it from the powershell language.
It would be nice to see if some other codebases managed to free themselves from some of this cruft and make something more approachable.
There are quite a few appealing things about the language, but I'm having trouble shaking the feeling that it's kind of like Java. I know both languages have evolved a lot, but some codebases might get stuck in some old patterns.