@KendallFrey I view the value of interfaces in terms of decoupling your code while keeping it cohesive. When you are going to apply a function in the definition of another function, you could decouple the two by applying an input of the function. And then afterwards, when you apply the newly defined function you simply apply it to the function you intended on applying or to whatever function you find to be a better implementation or one that does what you want. This makes code neatly reusable
@KendallFrey It's a more difficult route but if you are aiming for maximum reuse and having all implementations depend on abstractions, it is quite a beautiful route
Ah you think OOP is your ally? You merely adopted the OOP. I was born in it, molded by it. I didn't see the light until I was already an engineer, by then it was nothing to me but blinding!
So....I signed my application with a digital signature key. I published used click once. When my co workers download the update Symantec is still saying it does not have a valid digital signature -.-
@Hpjchobbes Flags enums are pretty much an old-programming carryover. They're efficient, but they do pretty much require changing logic anytime you change the enum
If you need the efficiency of being able to store bitflags and Kendall's suggestion doesn't work because you need names or somesuch, you're pretty stuck with it
I'm not sure how likely it is you need the efficiency though. And you need a lot of flags to be worth it
@Hpjchobbes I'm not sure what your end goal is here, so IDK how to structure it. If it's just a package for passing flags around, I think what you've got it what you're looking for
It's a list of account types (Bank, CreditCard, CurrentAsset, CurrentLiability, Income, OtherIncome) where the user can select one or more selections. There's also some pre-defined selections (like AllIncomeAndExpense or BalanceSheet) which is a combination of account types.
Each of these account types have a numeric value 0-14, which for my query I need to include in a CSV list
Sure. I think they way you have it set up is what you want, then. If you wanted to pack it a little tighter, you could do something with an internal flags enum and use properties to unpack it each time, but that's a time-memory tradeoff
and I think it's too inflexible to be good, personally.
Hello, this may sound like an odd or stupid question, but what is the type of a function in C#? I want to do something like Func<double, double> f = some_bool ? Math.Sin : Math.Cos;but this doesn't work...
anyone here familiar with winforms, is it possible to have a click event function defined in another class file....as opposed to defining it in the codebehind of a form? But still be able to attach it to say the button click event of the form
WinForms normally has the events themselves in codebehind, that I've seen. If it's then some class' responsibility that's being invoked, you then call that class form codebehind
But I never got /very/ deep into winforms, so don't count me an expert