P. 1
Rob Miles CSharp Yellow Book 2011

Rob Miles CSharp Yellow Book 2011

|Views: 40|Likes:
Published by tejvan

More info:

Published by: tejvan on Mar 06, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/27/2012

pdf

text

original

A value type holds a simple value. Value types are passed as values into method calls
and their values are copied upon assignment; i.e. x = y causes the value in y to be
copied into x. Changes to the value in x will not affect the value of y. Note that this is
in contrast to reference types where the result of the assignment would make x and y
refer to the same instance. Virtual Method

A method is a member of a class. I can call the method to do a job. Sometimes I may
want to extend a class to produce a child class which is a more specialized version of
that class. In that case I may want to replace (override) the method in the parent with a
new one in the child class. For this to take place the method in the parent class must
have been marked as virtual. Only virtual methods can be overridden. Making a
method virtual slightly slows down access to it, in that the program must look for any
overrides of the method before calling it. This is why not all methods are made virtual
initially.

Glossary of Terms

Glossary of Terms 193

Index

(

() 20, 22

/

/* 38

;

; 21

{

{ 20

+

+ 23

A

abstract

classes and interfaces 116
methods 115
references to abstract classes 118
accessor 93, 127
ArrayList 134
access element 135
find size 135
remove element 135
search 136
arrays 61
elements 62
subscripts 62
two dimensional 63
assignment 21
assignments 49

B

base method 112, 120
block 41
boolean 31
brace 20
break 46
button 156
button events 157

C

C 14
camel case 32
case 70
casting 34
chain saw 14
char 29, 124
case 125

tests 126
class 19
class members 90
Close 73
code reuse 109
color 155
column printing 51
comments 38
compiler 15
component properties 154
components 104, 154
computer 6
data processing 7
embedded system 8
hardware & software 6
program 7
programming 8
condition 39
Console 21
constants 41
constructor 98
chaining 115
custom 99
default 98
failure 102
management 101
overloading 100
parameters 99
context 24
continue 46
CPU 165
custom constructors 99

D

data 7, 26
data protection 112
default 70
default constructor 98
delegates 162
pointers 162
Dictionary 137
double 20

E

edit form 159
elements 62
enumerated types 76
Equals method 121
escape sequence 29
event management 158
events 162
exception 171
class 172
multiple catches 173
throwing 172
type 172
expressions 32
data types 35

Glossary of Terms

Glossary of Terms 194

operands 33
operators 33

F

files

streams 141
foreach 143
Form 153, 159
Dispose 161
modal 161
fridge 6
fully qualified name 73

G

Generics 134, 136
global namespace 178
gozzinta 21
graphical user interface 153
GUID 109

H

hash table 131
Hashtable 132

I

identifier 17, 31
if 39
immutable 124
information 7
inheritance 109
integers 27
interface
abstraction 104
design 108
implementing 106
implementing multiple 108
reference 106

K

keyword 17

L

label 154
Length 125
library 175
List class 136
literal values 26, 35
loops 43
break 46
continue 46
do - while 43
for 44
while 44

M

member protection 91
MessageBox 161
metadata 11
methods 17, 52
base method 112
Main 17
overriding 111
replace 113
sealed 114
stopping overriding 114
virtual 111
mutator 91, 127

N

namespace 19, 177
global 178
nesting 179
separate files 180
using 179
namespaces 73
narrowing 34
nested blocks 58
nesting namespaces 179
new 85, 98

O

object class 119
object oriented 15
objects 83, 89, 115
container 129
equals 121
factory method 141
key 133
properties 127
this 123
operands 33
operating system 7
operators 33
combining logical 40
priority 33
relational 39
unary 48
out parameters 56
overflow 27
overloading
constructors 100
overriding 111

P

parameters 22, 53
parenthesis 23
Parse 22
pause 169
plumber 9
pointers 162
print formatting 50

Glossary of Terms

Glossary of Terms 195

print placeholders 50
priority 33
private 91, 92
program
Main 19
program flow 38
programmer 6
Programmers Point
Always provide an equals behaviour 122
Avoid Many Dimensions 65, 67, 68
Block Copy is Evil 110
Break Down Your Conditions 41
Bug fixes cause bugs 182
Casts Add Clarity 36
Check your maths 27
Choose Variable Types Carefully 31
Clever is not always Clever 46
Construction Should Be Planned 102, 103
Data Structures are Important 89
Delegates are strong magic 164, 165
Design wth Methods 55
Design Your Class Construction Process 115
Design your error exceptions yourself 173
Design your fault reporting 180
Document your Side Effects 56

Don’t use new fangled stuff just because it is there

138
Don't Replace Methods 114
Enums are Good 76, 78
Every Message Counts 153
Flipping Conditions 47
Fully Qualified Names are Good 180
Give Your Variables Sensible Names 32
Good Communicators 13
Great Programmers 16
Importance of Hardware 8
Importance of Specification 10
Interfaces are just promises 109
Internationalise your code 104, 105
Know Your Data Source 20
Langauges do Help 57
Make sure you use the right equals 121
Metadata 11
Metadata members Members and Methods 92
Not everything should be possible 90
Pace Your Comments 38
Plan for Failure 58
Plan Your Variables 61
private data and public methods 92, 93, 94
Production Code 148
Program Layout 25
Programming Languages 14
Programs often fail in the error handlers 174
Static Data Members are Useful and Dangerous 96
Static Method Members can be used to make
libraries 98
Streams are wonderful 142
Strive for Simplicity 49
Structures are Crucial 82
Stupid Computers 14

Switches are Good 71
There is only so much you can do 141
Try to avoid the garbage man 87
Use break With Care 46
Use Numbers Not Messages 150
Use Simple Variable Types 29
Users have strong opinions about the user interface
161
Version Control and Change Management 177,
180, 182
programming languages 13
properties 90, 126
in interfaces 128
public 92
punctuation 25

R

ReadLine 21
recipie 16
reference 84, 85, 87
parameters 56
to abstract class 118
replacing methods 113
return 53

S

scope 76, 87
sealed 114
searching 131
semicolon 21
source files 174
Star Trek 7
statement 17
returning values 49
static 19, 94
data 95
methods 96
story telling 37
stream 71
streams 141
StreamWriter 72
string 29, 124
comparison 125
editing 125
immutable 124
Length 125
literal 23
StringBuilder 126
structures 79
accessing 80
defining 79
subscripts 62
switch 68, 69
case 70
System namespace 19

Glossary of Terms

Glossary of Terms 196

T

text based editing 152
TextBox 155
this 123
Thread 165
Monitor 169
mutex 168
Sleep 169
Start 166
threads 163
ThreadStart 166
ToString 119
ToUpper 125
Trim 126

U

unicode 30
user 6
using 19

V

value parameters 55
variable scope 58
variables 16, 26
arrays 61
assignment 32
bool 31
char 29
declaring 26
double 20
float 28
list 20
string 30
structures 79
text 29
types 26
verbatim 30
virtual methods 111
void 19

W

widening 34
WriteLine 23

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->