Posts

Showing posts from January, 2015

Cracking C# Interview Questions Part One

Most asked questions:  Explain the difference between abstract class and interface. Constructors: What is Static Constructor? Static constructor is used to initialize static data members as soon as the class is referenced for first time. Static constructor does not take access modifiers and or have any parameter and cannot access any non-static data member of class. Whereas the instance constructor is used to initialize instance member of object of class. It is called whenever a new object is created ( either explicitly or implicitly). Inheritance: Are private data members inherited? Yes, but they cannot be accessed by child class methods. What are Delegates? A delegate in C# allows us to pass a method of a class to object of another class that can call these methods. It is alias of function pointer in C++.

What most programmers need to learn - Basics of Programming

The main thing programmers need to learn is self discipline. The discipline to always write the clearest code you can, the discipline to re factor code if it becomes muddy through changes later in development, the discipline to remove unused code and add comments. What you think is important in being a good programmer and the usual answer is code should be clear, understandable and maintainable. But it is very rare to actually consistently follow through with that. Keeping this in mind requires self discipline, because it means not stopping "when it works". If all the variables would have the wrong name the code could still function perfectly, but the code would be super confusing. The step from functional code to clear code brings very little reward in the short term: it worked already and after cleaning it up it still works. That is why discipline is required to take this step.  Let me give a few examples of the kinds of things I often see in code written by starting progra...

What is Programming???

Programming is a creative process done by programmers to instruct a computer on how to do a task. Hollywood has helped instill an image of programmers as uber techies who can sit down at a computer and break any password in seconds.  Sadly the reality is far less interesting! The purpose of programming is to find a sequence of instructions that will automate performing a specific task or solving a given problem. The process of programming thus often requires expertise in many different subjects, including knowledge of the  application domain , specialized  algorithms  and  formal logic . It is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This code can be written in a variety of computer programming languages. Some of these languages include Java, C, and Python. Computer code is a collection of typed words that the computer can clearly understand. Just as a human translator might transla...