Archives for the 'Software engineering' Category
C# Hidden Danger #2: GetHashCode()
Suppose you have an address book saved as a CSV text file or an XML file. You would like to create a program that loads the address book into memory, and return the contact details of a person, given the name.
There are a number of data structures from which to choose: array, ArrayList, List<T>, Hashtable, […]
C# Hidden Danger #1: The const Keyword
Declaring a constant with the const keyword makes it a compile-time constant. In the generated IL, all references to a compile-time constant will be replaced by its actual value. Now suppose that a compile-time constant is declared in one assembly and referenced in other assemblies. If the definition of the constant ever needs to be […]
Measuring the Greatness of Programmers
What makes a great programmer?
In essence, a great programmer consistently writes good code, fast. Ok, begging the question. Good code is flexible, structured, configurable, succinct, easy to maintain, and free of obvious bugs. (As no one is perfect, no code produced by one person can be completely bug-free).
So that’s the definition. How to measure the […]
Basic Mental Mutilation
Once during a job interview I mentioned that I had been programming since I was ten. At the time BASIC was all the rage. Or maybe BASIC was all there was. Anyway there was no Internet so where could a kid find a GNU C compiler in 1985? Er - hang on, there was no […]
ASP.NET Page Life Cycle
This is a favourite interview question: “what are the sequence of events in the ASP.NET page life cycle?”
Short answer:
Init
Load
PreRender
Unload
Long answer:
PreInit
Init
InitComplete
PreLoad
Load
LoadComplete
PreRender
SaveStateComplete
Unload
Disposed
Short answer with explanation, i.e., what to do when:
Init – read or initialize control properties
Load – set properties in controls and establish database connections
PreRender – make final changes to the contents of the page or its […]
