func (x X) init() { x.foo = 1 }
func (x X) Control() { makeAChange(x.foo); return x.foo }Rule 3:
func (_ X) makeAChange(foo) { return foo + 1 }
Ed Sumerfield's musings. Life rocks.
func (x X) init() { x.foo = 1 }
func (x X) Control() { makeAChange(x.foo); return x.foo }Rule 3:
func (_ X) makeAChange(foo) { return foo + 1 }
Never write "catch (Exception e)" unless you can enumerate the reasons why it is acceptable.
A try catch allows us to intercept situations in our code flow that occur somewhere down a call stack. Generally associated with exception flow but not restricted to that concept.
Primarily talking to C# (or Java) Exception semantics but applicable to other languages to different degrees. An exception is a class that inherits from a based Exception allowing it to be "thrown" for later "catching" higher up the call stack.
The "System.Exception ("java.lang.Exception") represent the top of a hierarchy under which all exception types must be declared.
So this is where the problem starts. The following code is evil and should never be used unless you understand what the exceptions are (pun intended).
try {Because the class Exception exists at the top of the hierarchy all exception types created for the application or system types will be caught. For example, a catch Exception will intercept a NullReferenceException (NullPointerException) what should only occur for a coding bug and never in normal production flows. All exception flows should be handled intentionally using the specific thrown class only.
// do something useful
}
catch (Exception e) {
// react to problem
}
static void Main(string[] args) {These kinds of constructs would want to control situations like unexpected exceptions and log them for review. An exception that is not caught and ends up being thrown to the runtime may only be reported to standard out and perhaps be lost to anyone trying to determine why a program crashed.
var count = 2;
var running = true;
while (running) {
try {
Console.WriteLine("Hello World " + count);
if (count-- == 0) running = false;
}
catch (Exception e) {
Console.WriteLine("Unexpected error: {0}", e.Message);
}
}
}
try {In this manner all interactions will protect the management program and allow for positive feedback to the user or developer of the dynamic library.
var dll = Assembly.LoadFile("hello.dll");
foreach (Type type in dll.GetExportedTypes()) {
var hello = Activator.CreateInstance(type);
type.InvokeMember("World", BindingFlags.InvokeMethod, null, hello, new object[]);
}
}
catch (Exception e) {
Console.WriteLine("The DLL shouldn't have done that");
}
try {This means that all thread starting code should wrap thread entry points in a simple management method to ensure consistent exception handling throughout the application.
new Thread(MyThread).Start();
}
catch (Exception e) {
// This will not catch the threads exception.
}
public static void MyThread() {
try {
throw new Exception("Thrown in threads");
}
catch (Exception e) {
Console.WriteLine("Threads should report their exceptions");
}
}
We know that teams need to see the future and feel part of its creation. We talk to roadmaps and share in decisions that re-enforce our shared understanding.
However, we spend a lot of time "doing" because we think we have to. Teams only thrive when they understand the future and become part of creating it.
I think we humans have a problem expressing decent without recognizing existing value.
A system with invented boundaries, requires that people decent when the boundaries are breached.
A system with intentional boundaries requires that those boundaries are challenged.
The evolution of a flexible system is an interplay between the intentional rigidity of good rules and the intentional experimentation of alternatives.
Breaching boundaries is the clue that we are assessing the current rules.
Limiting change is not rigidity, it is the siting of theories that describe optimal flow, each of which requires proofs.
The problem is an old one; who decides what a development team should focus on next. Traditionally, we say "the business" but we know that product quality and technical debt can loose out. When does "the business" consider security important? Unfortunately, in todays tech world, security is consistently an afterthought.
I believe I have a solution, which stems from trying to understand the question. "Who decides the priority of a story" is the wrong question. It obviously depends on the story. Agile teams profess working together for a common goal, all skills sharing ideas, planning and implementing together, but we never said that everyone on the team knows everything or is skilled or knowledgable enough to make all decisions. Hence the team thing.
So the answer is "Allow prioritization within skill scope" or said more verbosely, "People with specific skill sets make prioritization decisions related to the scope of their skills and goals".
At the end of the day, everyone in the company wants the same thing. Lets make some money, using quality products that are stable and support the services the business sells all the time, and no one wants our products to be exposed to attack.
Story priorities must be defined in this sequence:
1) Production Operations Team