· 4 years ago · Jul 17, 2021, 04:38 PM
1 .NET:
2 Current version: 5.0.5
3 Current core version: 3.1.14 LTS
4 Preview version: 6.0.0 Preview 3
5
6 CLR:
7 common types system:
8 boxing/unboxing:
9 types:
10 Class:
11 implicitly inherits: System.Object
12 require constructor: 1
13 defines:
14 operations:
15 methods:
16 events:
17 properties:
18 data:
19 fields:
20 possible characteristics:
21 sealed: cannot derive from
22 implements: implements 1..n interfaces
23 abstract: cannot be instantiated
24 inherits: instances of c. can be used anywhere base c. is specified
25 exported: visible outside assembly defined in
26 not exported: not visible outside assembly defined in
27 can be nested: 1
28 c. member without definiton: abstract
29 c. with 1...n abstract members: abstraction
30 Structure:
31 require constructor: 1
32 implicitly inherits: System.ValueType -> System.Object
33 defines:
34 operations:
35 methods:
36 data:
37 fields:
38 primitive types:
39 types:
40 Boolean:
41 Byte:
42 Char:
43 DateTime:
44 Decimal:
45 Double:
46 Int16:
47 Int32:
48 Int64:
49 SByte:
50 Single:
51 UInt16:
52 UInt32:
53 UInt64:
54 aliases:
55 int: int32
56 interfaces:
57 Enumeration:
58 inherits directly: System.Enum
59 has:
60 name:
61 underlying type:
62 either:
63 - Byte
64 - Int32
65 - UInt64
66 can define methods: 0
67 can define properties, events: 0
68 can implement interfacece: 0
69 delegates:
70 l:
71 - https://docs.microsoft.com/en-us/dotnet/standard/base-types/common-type-system
72
73 EF:
74 OData:
75 AutoMapper:
76 Migrations:
77 Reverse engineering (scaffolding):
78 EF Core:
79 model:
80 made up of:
81 - entity classes
82 - context object
83
84 ASP.NET:
85 - DI:
86 - genereric DI
87 - OWIN
88 - Exception filtering
89 - DataMapper vs ActiveRecord
90 - /assets/Screenshot%20from%202020-12-29%2000-33-24.png
91 - EF:
92 - ADO.net vs EF?
93 - fluent API
94
95 C#:
96 current version:
97 version: 9.0
98 version features:
99 kewords:
100 - init
101 - record type
102 ref keyword:
103 unsafe operation:
104 типаж:
105 type class:
106 comparison operator:
107 - for structs
108 LINQ:
109 delegates:
110 variation:
111 contrvariation:
112 structs:
113 differences from classes:
114 s. interfaces:
115 closures:
116 generics:
117 virtual methods:
118 v. destructor:
119 default() call:
120 type classes:
121 seen here: https://www.youtube.com/watch?v=joz5N89_Gro
122 reflection:
123 attributes:
124 existing attributes:
125 custom attributes:
126 tail optimization in C#:
127 action vs predicate vs func:
128 passing arguments by assigment:
129 parent / derived class constructor call order:
130 exception handling:
131 indexers:
132 events:
133 accessors:
134 runtime type:
135 inheritance:
136 multiple inheritance via interfaces:
137 version introduced in:
138 collections:
139 which getter is used for which collection: Count, Length, Capacity
140 Dynamic properties:
141 strings:
142 interpolation:
143 '$ symbol':
144 '@ symbol':
145 how is works in combination with $:
146 StringBuilder:
147 Why is this code block valid: |
148 private static read-only Dictionary<Types, List<Condition>> Mapping = new Dictionary<Types, List<Condition>> {
149 [Types.Definition] = {block =>
150 {
151 const string foo = @".+?:.+";
152 return Regex.IsMatch(block.ToString(), foo);
153 }
154 }
155 };
156 Method extensions:
157 custom m. e.:
158 l:
159 - https://habr.com/ru/post/24765/
160 Out vs Ref keyword:
161 refData:
162 value vs reference:
163 - is `object` the only reference type?
164 keywords:
165 static:
166 const:
167 fixed:
168 as: 'as does not throw exceptions, it just returns null (new operator will throw exp)'
169 unsafe:
170 properties keywords:
171 - override
172 - virtual:
173 why are they bad?
174 methods keywords:
175 - override
176 volatile:
177 l:
178 - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/volatile
179 Class declaration keywords:
180 - internal
181 - abstract
182 - sealed
183 - partial
184 - static
185 Property vs Field:
186 Static constructors:
187 Abstract vs Virtual methods:
188 - Abstract methods are implicitly virtual. It is an error to use the static keyword in abstract method declaration
189 Why interface cannot have access modifier (PHP for example can have *public* access modifier):
190 Lambda functions cause GC allocations? Ordinary functions do not:
191 C#8 default interface implementation:
192 Deconstruction and pattern matching:
193 l:
194 - https://livebook.manning.com/book/c-sharp-in-depth-fourth-edition/chapter-12/
195 Async programming:
196 - process:
197 - is: inert container
198 - defines: virtual address space
199 - if no threads in process:
200 - in Windows world: process exists
201
202 multi-threading:
203 - m context
204 - managed thread
205 - thread:
206 - size:
207 - executes: code
208 - scheduled by: OS
209 - caveats:
210 - slower execution:
211 - because of:
212 - context switch
213 - Mechanisms of thread sync:
214 - types:
215 - semaphore:
216 - enforces thread identity: 0
217 - used to: control access to a pool of resources
218 - guarantees order in which blocked threads enter: 0
219 - WaitOne:
220 - calling multiple times: 1
221 - can be released by:
222 - Release()
223 - Release(Int32)
224 - types:
225 - local:
226 - aka: unnamed
227 - exists within: process
228 - system:
229 - aka: named
230 - visible throughout: OS
231 - can be represented by multiple Semaphore objects: 1
232 - existing s. s. be opened: 1
233 - l:
234 - https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex
235
236 - mutex:
237 - enforces thread identity: 1
238 - can be passed across application domain boundaries: 1
239 - methods:
240 - WaitOne:
241 - request: ownership of a mutex
242 - overloads:
243 - WaitOne(In32)
244 - calling multiple times:
245 - can be done by: owning thread
246 - calls should be followed by calling: ReleaseMutex method the same number of times
247 - can also be used for: inter-process synchronization
248 - l:
249 - https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex
250 - abandoned mutex:
251 - m. is said to be a. when: thread terminates while owning m.
252 - system-wide mutex:
253 - types:
254 - local:
255 - aka: unnamed
256 - exists within: process
257 - system:
258 - aka: named
259 - visible throughout: OS
260 - can be represented by multiple Mutex objects: 1
261 - existing s. m. be opened: 1
262 - monitor:
263 - l:
264 - https://docs.microsoft.com/en-us/dotnet/api/system.threading.monitor
265 - enforcing thread identity means: mutex can be released only by the thread that acquired it
266 - lock free:
267 - lock free data structure
268 - On which thread Task operates?
269 - What's task scheduler?
270 - Different contexts (shared etc.);
271 - Does Async mean multi-threaded in C# context?
272 - Communication between threads, dispatching
273 - TPL:
274 - STAThread:
275 - availability on all platforms:
276 - .GetHash
277 - Interlocked:
278 - Deadlock:
279 - atomic operations:
280 - atomic floats:
281 - difference from a. ints:
282 Interfaces:
283 explicit i. method implementation:
284 implicit i. method implementation:
285 built-in interfaces:
286 IClonable:
287 IEnumerable:
288 IEnumeator:
289 - how to get element by key?
290 IEnumerable extends: ICollection
291 ICollection extends: IList
292 IQueryable extends: IEnumerable, IQueryable(Linq)
293
294 generics:
295 - условные обобщения (conditional generalizations?), constraints?
296 user-defined conversion:
297 runtime type:
298 built-ins:
299 - Collections
300 - Hash
301 - Span
302 - Tuple:
303 - you cannot use duck-typing for tuple arguments of different sizes
304 typecasting:
305 (T)null:
306 upcasting:
307 downcasting:
308
309 Memory management:
310 where arguments of functions are stored:
311 note from Anton: |
312 Есть нюансы))) есть, по крайней мере в плюсах, другие соглашения об вызове и они могут пихать параметры в регистры)
313 Heap vs stack:
314 Fragmentation:
315 - example of fragmentation
316 How memory gets allocated for object:
317 GC:
318 GC generations:
319 GC is triggered:
320 GC execution speed factors:
321 GC types:
322 mark-and-sweep:
323 used in: go
324 considered bad:
325 l:
326 go vs c# GC: https://medium.com/servicetitan-engineering/go-vs-c-part-3-compiler-runtime-type-system-modules-and-everything-else-faa423dddb34
327 empty class instance size:
328 size of structures:
329 - |
330 class B
331 {
332 Int i;
333 string s;
334 byte b;
335 }
336 - |
337 class A
338 {
339 B b;
340 int i;
341 short s;
342 byte b;
343 }
344
345 where(predicate).count() vs .count(predicate):
346 l:
347 - https://dou.ua/lenta/articles/net-for-beginners
348
349 ASMDEF:
350 l:
351 - https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
352 NGEN:
353