I make my boost::signals public because I'm lazy.
class Button {
public:
signal<void()> clicked;
};
int main() {
Button btn;
btn.clicked.connect(handleClick);
}
... rather than encapsulating with a Button::OnClicked(boost::function<void()>).
Is this going to come back and bite me?
...
I was poking around in XNA and saw that the Vector3 class in it was using public fields instead of properties. I tried a quick benchmark and found that, for a struct the difference is quite dramatic (adding two Vectors together a 100 million times took 2.0s with properties and 1.4s with fields). For a reference type, the difference doesn...
I have a lot of C# code that uses public fields, and I would like to convert them to properties.
I have Resharper, and it will do them one by one, but this will take forever.
Does anyone know of an automated refactoring tool that can help with this?
...
... it just doesn't work, at all. I've tried for days, with all different combinations of frick'n stuff and it won't budge.
There are certainly people out there who seem to be blogging about breezing through this sort of thing without seeing a glimpse of an issue saying things like "We all know that you can show public properties of ex...
Hello,
This is something I find rather curious, that a lot of third party libraries such as FileHelpers and Command Line Parser are designed to work at field level rather than property level.
Is there a particular reason why so many have chosen to target their tools at public fields rather than properties?
My personal feeling is that p...
I know it's possible to define public instance variable with @public keyword.
However, Objective-C syntax does not allow accessing other class' variable.
What features should I expected from @public Ivar? Or how do I access other class' Ivars?
...
can someone show a description of the information of what a pgp looks like if only the descriptions were there but not the actual information? something like (i dont remember if the values are correct):
packet-type[4 bits],
total length in bytes[16 bits],
packet version type [4 bits],
creation-time[32 bits],
encryption-algori...
Possible Duplicate:
Public Data members vs Getters, Setters
In what cases should public fields be used, instead of properties or getter and setter methods (where there is no support for properties)? Where exactly is their use recommended, and why, or, if it is not, why are they still allowed as a language feature? After all, t...
I was performing a code review and I saw a class that a developer had created, that only contained public instance-fields. This class is not used in business logic; it is merely used to hold test data (the developer created this for a test).
Is this alright? Why or why not?
...