C# Basics / GUI App Flashcards
How are the GUIs in C# driven?
They are event driven (mouse clicks, keystrokes etc…)
Describe Generic Programming
It allows you to define a class with placeholders for the type of its fields, methods, parameters, etc. Generics replace these placeholders with some specific type at compile time.
A generic class can be defined using angle brackets <>.
Example:
class MyGenericClass<t></t>
(You can take any character or word instead of T.)
Now, the compiler assigns the type based on the type passed by the caller when instantiating a class.
https://www.tutorialsteacher.com/csharp/csharp-generics
Describe Functional Programming
With functional programming, you specify what you want to accomplish in a task, but not how to accomplish it. For example, with Microsoft’s LINQ you can say, “Here’s a collection of numbers, give me the sum of its elements
What are the Benefits of functional programming?
You do not need to specify the mechanics of walking through the elements and adding them into a running total one at a time — LINQ handles all that for you. Functional programming speeds application development and reduces errors
What does CLR stand for?
Common Language Runtime
What is the Common Language Runtime?
The Common Language Runtime (CLR) executes .NET programs and provides functionality to make them easier to develop and debug. The CLR is a virtual machine (VM)—software that manages the execution of programs and hides from them the underlying operating system and hardware
What are some benefits of the CLR?
The CLR provides various services to managed code: - integrating software components written in different .NET languages - error handling between such components, - enhanced security, - automatic memory management and more
How does the CLR work?
Managed code is compiled into machine-specific instructions in the following steps: - First, the code is compiled into Microsoft Intermediate Language (MSIL). Code converted into MSIL from other languages and sources can be woven together by the CLR—this allows programmers to work in their preferred .NET programming language. The MSIL for an app’s components is placed into the app’s executable file—the file that causes the computer to perform the app’s tasks. - When the app executes, another compiler (known as the just-in-time compiler or JIT compiler) in the CLR translates the MSIL in the executable file into machine-language code (for a particular platform). - The machine-language code executes on that platform.
What is language Interoperability?
The .NET Framework provides a high level of language interoperability. Because software components written in different .NET languages (such as C# and Visual Basic) are all compiled into MSIL, the components can be combined to create a single unified program. Thus, MSIL allows the .NET Framework to be language independent
When do you change the name of form controls?
Only when the controls have an active role in the form. eg buttons can be clicked, check boxes can be checked, and some labels are dynamic and will change text, but static labels that will never change do not need to be renamed to something meaningful.
What is the naming convention for controls?
start with a lower case letter and camelCase
What is step 1 of Developing an application?
- Clearly define what the program is to do. For example, the Wage Calculator program: - Purpose: To calculate the user’s gross pay - Input: Number of hours worked, hourly pay rate - Process: Multiply number of hours worked by hourly pay rate (result is the user’s gross pay) - Output: Display a message indicating the user’s gross pay
What is step 2 of Developing an application?
What us step 3 of Developing an application?
What is step 4 of Developing an Application?