Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help - Wednesday, December 02, 2009
Blog
 
# Wednesday, December 02, 2009

Pascal casing means that the first letter of each word in a name is capitalized: EmployeeSalary, OrderDetails, PassengerName.

Camel casing is similar to Pascal casing, except that the first letter of the first word in the name is not capitalized:

Wednesday, December 02, 2009 9:35:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The statements that allow us to jump immediately to another line in the program.

There are four jump statement.

  1. Goto
  2. Continue
  3. Break
  4. Return
Wednesday, December 02, 2009 9:17:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

constant is a variable whose value cannot be changed throughout its lifetime:

const int abc = 5; // This value cannot be changed

Constants have the following characteristics:

  1. They must be initialized when they are declared, and once a value has been assigned, it can never be overwritten.
  2. The value of a constant must be computable at compile time. Therefore, we can’t initialize a constant with a value taken from a variable. If you need to do this, you will need to use a readonly field.
  3. Constants are always implicitly static. However, notice that we don’t have to include the static modifier in the constant declaration.
Wednesday, December 02, 2009 9:14:20 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The scope of a variable is the region of code from which the variable can be accessed. In general, the scope is determined by the following rules:

  • A field (also known as a member variable) of a class is in scope for as long as its containing class is in scope (this is the same as for C++, Java, and VB).
  • local variable is in scope until a closing brace indicates the end of the block statement or method in which it was declared.
  • A local variable that is declared in a for, while, or similar statement is in scope in the body of that loop.

Wednesday, December 02, 2009 9:07:39 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

An assembly is the logical unit that contains compiled code targeted at the .NET Framework.

An assembly is completely self-describing, and is a logical rather than a physical unit, which means that it can be stored across more than one file (indeed dynamic assemblies are stored in memory, not on file at all). If an assembly is stored in more than one file, then there will be one main file that contains the entry point and describes the other files in the assembly.

Note that the same assembly structure is used for both executable code and library code. The only real difference is that an executable assembly contains a main program entry point, whereas a library assembly doesn’t.

Assemblies come in two types: shared and private assemblies.


Private Assembly :
------------------
Private assemblies are the simplest type. They normally ship with software and are intended to be used only with that software.

The system guarantees that private assemblies will not be used by other software, because an application may only load private assemblies that are located in the same folder that the main executable is loaded in, or in a subfolder of it.

Shared Assembly :
-----------------
Shared assemblies are intended to be common libraries that any other application can use. Because any other software can access a shared assembly, more precautions need to be taken against the following risks:

  •  Name collisions, where another company’s shared assembly implements types that have the same names as those in your shared assembly. Because client code can theoretically have access to both assemblies simultaneously, this could be a serious problem.
  • The risk of an assembly being overwritten by a different version of the same assembly—the new version being incompatible with some existing client code.
Wednesday, December 02, 2009 8:44:44 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Language Interoperability is that classes written in one language should be able to talk directly to classes written in another language.

  • A class written in one language can inherit from a class written in another language.

  • The class can contain an instance of another class, no matter what the languages of the two classes are.

  • An object can directly call methods against another object written in another language.

  • Objects (or references to objects) can be passed around between methods.

  • When calling methods between languages we can step between the method calls in the debugger, even when this means stepping between source code written in different languages.

 

Wednesday, December 02, 2009 5:57:15 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Tuesday, December 01, 2009

Difference between DataGrid and Grid View is given below:-

Datagrid..
1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.

Grid View : ..
1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates

Tuesday, December 01, 2009 11:34:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Thursday, November 19, 2009

Here are several techniques for achieving good coding practices that are less heavy-handed than laying down rigid coding standards:

 

Assign two people to every part of the project

 

If two people have to work on each line of code, you’ll guarantee that at least two people think it works and is readable. The mechanisms for teaming two people can range from pair programming to mentor-trainee pairs to buddy- system reviews.

 

Review every line of code

 

A code review typically involves the programmer and at least two reviewers.  That means that at least three people read every line of code. Another name for  peer review is “peer pressure.” In addition to providing a safety net in case the original programmer leaves the project, reviews improve code quality because the programmer knows that the code will be read by others. Even if your shop hasn’t created explicit coding standards, reviews provide a subtle way of moving toward a group coding standard—decisions are made by the group during reviews, and, over time, the group will derive its own standards.

 

Require code sign-offs

 

In other fields, technical drawings are approved and signed by the managing  engineer. The signature means that to the best of the engineer’s knowledge, the  drawings are technically competent and error-free. Some companies treat code the same way. Before code is considered to be complete, senior technical personnel must sign the code listing.

 

Route good code examples for review

 

A big part of good management is communicating your objectives clearly. One way to communicate your objectives is to circulate good code to your programmers or post it for public display. In doing so, you provide a clear example of the quality you’re aiming for. Similarly, a coding-standards manual can consist mainly of a set of “best code listings.” Identifying certain listings as “best” sets an example for others to follow. Such a manual is easier to update than an English-language standards manual and effortlessly presents subtleties in coding style that are hard to capture point by point in prose descriptions.

 

Emphasize that code listings are public assets

 

Programmers sometimes feel that the code they’ve written is “their code,” as if it were private property. Although it is the result of their work, code is part of the project and should be freely available to anyone else on the project that needs it. It should be seen by others during reviews and maintenance, even if at no other time.

One of the most successful projects ever reported developed 83,000 lines of code in 11 work-years of effort. Only one error that resulted in system failure was detected in the first 13 months of operation. This accomplishment is even more dramatic when you realize that the project was completed in the late 1960s, without online compilation or interactive debugging. Productivity on the project, 7500 lines of code per work-year in the late 1960s, is still impressive by today’s standards. The chief programmer on the project reported that one key to the project’s success was the identification of all computer runs (erroneous and otherwise) as public rather than private assets (Baker and Mills 1973). This idea  has extended into modern contexts including Extreme Programming’s idea of collective ownership (Beck 2000), as well as in other contexts.

 

Reward good code

 

Use your organization’s reward system to reinforce good coding practices. Keep these considerations in mind as you develop your reinforcement system:  

  • The reward should be something that the programmer wants. (Many programmers find “attaboy” rewards distasteful, especially when they come from nontechnical managers.)
  • Code that receives an award should be exceptionally good. If you give an award to a programmer everyone else knows does bad work, you look like Charlie Chaplin trying to run a cake factory. It doesn’t matter that the programmer has a cooperative attitude or always comes to work on time. You lose credibility if your reward doesn’t match the technical merits of the situation. If you’re not technically skilled enough to make the good-code judgment, don’t! Don’t make the award at all, or let your team choose the recipient.

 

One easy standard

 

If you’re managing a programming project and you have a programming background, an easy and effective technique for eliciting good work is to say “I  must be able to read and understand any code written for the project.” That the manager isn’t the hottest technical hotshot can be an advantage in that it may discourage “clever” or tricky code.

Thursday, November 19, 2009 11:36:40 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   General  | 
  1. Separation of Code from HTML
    To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently. This makes it much easier for teams of programmers and designers to collaborate efficiently.
  2. Support for compiled languages
    developer can use VB.NET and access features such as strong typing and object-oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes.
  3. Use services provided by the .NET Framework
    The .NET Framework provides class libraries that can be used by your application. Some of the key classes help you with input/output, access to operating system services, data access, or even debugging. We will go into more detail on some of them in this module.
  4. Graphical Development Environment
    Visual Studio .NET provides a very rich development environment for Web
    developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML.
  5. State management
    To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management. State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down.
  6. Update files while the server is running!
    Components of your application can be updated while the server is online and clients are connected. The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished.
  7. XML-Based Configuration Files
    Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application.
Thursday, November 19, 2009 10:27:53 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Wednesday, November 11, 2009

STA (Single Threaded Apartment) is basically the concept that only one thread will interact with your code at a time. Calls into your apartment are marshaled via windows messages (using a non-visible) window. This allows calls to be queued and wait for operations to complete.

MTA (Multi Threaded Apartment) is where many threads can all operate at the same time and the onus is on you as the developer to handle the thread security.

Wednesday, November 11, 2009 4:34:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
Copyright © 2010 SoftwareCodeHelp. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: