SlideShare a Scribd company logo
Phil Denoncourt
phil@denoncourtassociates.com
http://philknows.net
» Desktops
˃ WinForm
˃ WPF
˃ Linux, Mac, Solaris
» Servers
˃ Web Apps
˃ Services (web/native)
» Embedded Systems
˃ Micro .NET (Netduino, FEZ Domino)
˃ Windows Phone
˃ Robots
˃ iPhone
» Gaming Consoles
˃ Xbox 360
˃ Wii, Playstation 3 (via Mono)
2
25 Things I've Learned about C# - Phil Denoncourt
http://mono-project.com
» C# compiles to bytecode
˃ So it must be slow
» Bytecode gets compiled to native code upon
first usage
˃ Takes advantage of features that machine’s processor
» Matches C++ in Int math, trig, and I/O.
˃ Little slower in floating point
» C# benefits from disposing of objects when idle
˃ rather than when object is no longer used.
» http://www.osnews.com/story/5602&page=3
3
25 Things I've Learned about C# - Phil Denoncourt
» Built into the framework since 3.0
˃ Add reference to System.Speech
» Recognition
˃ Command based
˃ Dictation
» Synthesis
» Requires SAPI
˃ Windows Vista and Later
˃ Office 2003 and Later
» http://gotspeech.net
4
25 Things I've Learned about C# - Phil Denoncourt
» It’s easy to write
˃ ThreadPool.QueueUserWorkItem
˃ PLINQ
˃ BackgroundWorker component
» It’s hard to debug
˃ Add trace / logging to your code
» Make sure your classes are “ThreadSafe”
˃ Lock keyword
˃ Interlocked class
» http://www.bluebytesoftware.com/blog/
5
25 Things I've Learned about C# - Phil Denoncourt
» Added in 3.0. Implemented as a generic class
˃ Allows you to consider value types that are nullable
» Add ? to end of type
˃ Int?
˃ DateTime?
˃ String is already a reference type, thus already nullable
» Null Coalesce operator
˃ Substitutes a value if the object is null
˃ Really low in operator precedence. Often need parens.
» http://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx
6
25 Things I've Learned about C# - Phil Denoncourt
» Exceptions hold a lot of information
» Throwing them is computationally expensive
˃ Avoid using exceptions as logic flow
» Stack trace line numbers are available if PDBs
are present with the binaries
» There is a difference between
˃ throw
˃ throw ex;
» http://msdn.microsoft.com/en-
us/library/5b2yeyab(v=VS.100).aspx
7
25 Things I've Learned about C# - Phil Denoncourt
» checked
˃ By default, overflow checking is disabled in C#
+ Depending on compiler options
˃ Placing statements in checked block enables checking
˃ There is also an unchecked keyword
˃ http://msdn.microsoft.com/en-us/library/74b4xzyw(v=VS.100).aspx
» volatile
˃ Keyword that indicates field could be updated by multiple threads
+ Disables compiler optimizations that assume single threaded access
˃ Places a “lock” statement around access to the field
˃ http://msdn.microsoft.com/en-us/library/x13ttww7(v=VS.100).aspx
8
25 Things I've Learned about C# - Phil Denoncourt
» Allows you to add new methods to existing classes
˃ Even sealed classes
» Can operate on public members
˃ But not private members
» Good way to add “missing” functionality to class
˃ Good way to make something unmaintainable
» Internally – implemented as a static method
passing in the current instance.
» http://extensionmethod.net/
9
25 Things I've Learned about C# - Phil Denoncourt
» Generic template that defers initialization until
used
» System.Lazy<T>
» Object will be initialized when the value
member is accessed, or ToString() is called.
» http://weblogs.asp.net/gunnarpeipman/archive/2009/05/19/net-framework-4-0-using-system-lazy-lt-t-gt.aspx
10
25 Things I've Learned about C# - Phil Denoncourt
» Lambda operator =>
» Anonymous function
˃ Contains code
» Returns a delegate
» Used extensively in Linq
» http://msdn.microsoft.com/en-
us/library/bb311046.aspx
11
25 Things I've Learned about C# - Phil Denoncourt
» Eliminates a lot of repetitive coding
» Implemented as extension methods in
System.Linq.dll
» Must reference the assembly, and add a using
statement:
˃ using System.Linq;
» Different providers allow access to different types
of data by exposing IQueryable interface
˃ Linq to Objects
˃ Linq to SQL
˃ Linq to Entities
˃ Linq to Xml
» http://msdn.microsoft.com/en-us/netframework/aa904594.aspx
12
25 Things I've Learned about C# - Phil Denoncourt
» Normally static fields exist once per AppDomain
» [ThreadStatic] static fields exist once per Thread
» Static constructors and initializers still only
execute once.
˃ So you have to make sure the object is not null before using it
» http://blogs.msdn.com/b/jfoscoding/archive/2006/07/18/670497.
aspx
13
25 Things I've Learned about C# - Phil Denoncourt
» Allows you to move a class from one assembly
to another without breaking callers
» [assembly:TypeForwardedTo(typeof(classThatWasMoved)]
˃ Place this statement in the original assembly, which must reference
the new assembly.
» Used for refactoring types into different
assemblies, and not have to rebuild the caller
assembly.
˃ Namespace and name can’t change
» Can also redirect entire assembly in .config file
˃ assemblyBinding section
» http://msdn.microsoft.com/en-us/library/ms404275.aspx
14
25 Things I've Learned about C# - Phil Denoncourt
» Don’t need to be based on int
˃ Can be byte, sbyte, short, ushort, int, uint, long, or ulong.
» If you use the FlagsAttribute, you can perform
bitwise operations
˃ Meaning that you can store more than one state in an enum variable.
» http://dotnetperls.com/enum-flags
15
25 Things I've Learned about C# - Phil Denoncourt
» -In addition to allowing shortcuts to
namespaces
» Automatically disposes objects when scope is
outside of the using statement.
» Object doesn’t need to be instantiated in the
using statement
˃ But should
» More than one object can be tracked by a using
statement
˃ But they must be of the same type
» http://msdn.microsoft.com/en-us/library/yh598w02.aspx
16
25 Things I've Learned about C# - Phil Denoncourt
» Allows you to examine metadata about
compiled code.
» Has a reputation for being slow
˃ I haven’t found that to be very true
» Allows access to private methods / fields of a
class
» You can also get the actual IL of the method for
reverse engineering
˃ Which is what Reflector does
» http://msdn.microsoft.com/en-us/library/f7ykdhsy(v=VS.100).aspx
17
25 Things I've Learned about C# - Phil Denoncourt
» Can call other constructor methods
˃ Add :this to call a constructor in the current object
˃ Add :base to call a constructor in the base object
» http://msdn.microsoft.com/en-us/library/ms173115.aspx
18
25 Things I've Learned about C# - Phil Denoncourt
» Allows you to write code against an abstract type
˃ Type Parameter
» When generic is used, a type is specified.
˃ Reduces the amount of boxing
» Generics can be applied to
˃ Classes
˃ Delegates
˃ Methods
˃ Interfaces
» Instead of comparing to null, compare to default(t)
» http://msdn.microsoft.com/en-
us/library/512aeb7t(v=VS.100).aspx
19
25 Things I've Learned about C# - Phil Denoncourt
» Allows you to constrain what types can be used
with a generic
» Can constrain
˃ Classes that implement an interface
˃ Classes must have a common base class
˃ Parameterless constructor
˃ That the type is a class
˃ That the type is a struct
» Constraints enforced by the compiler
» http://msdn.microsoft.com/en-us/library/d5x73970.aspx
20
25 Things I've Learned about C# - Phil Denoncourt
» Very easy since .NET 2.0
˃ No more worrying about holding onto disposable objects
» File class – static methods for
˃ Copying
˃ Renaming
˃ Deleting
˃ Checking existing
˃ Reading /writing data to a file
˃ Encrypt/Decrypt a file
˃ http://msdn.microsoft.com/en-us/library/system.io.file.aspx
» Path class – static methods for
˃ Assembling a filename
˃ Changing extensions
˃ Getting a truly temporary filename
˃ http://msdn.microsoft.com/en-us/library/system.io.path.aspx
21
25 Things I've Learned about C# - Phil Denoncourt
» Mostly done for you
» .NET 4.0 supports 354 different cultures
» Allows you to properly
˃ Format numbers
˃ Format currency
˃ Format date/times
˃ Compare strings
» By default, the culture of the current thread is used
when formatting/comparing
» Globalization != Localization
» http://en.wikibooks.org/wiki/.NET_Development_Foundation/Glo
balization
22
25 Things I've Learned about C# - Phil Denoncourt
» You can write code that writes code
» Emits C# or VB.Net
» Or can build an assembly using a compiler
» Can build the assembly in memory
˃ Doesn’t get written to disk.
» http://www.15seconds.com/issue/020917.htm
23
25 Things I've Learned about C# - Phil Denoncourt
» GZipStream class only compresses one file
» System.IO.Packaging
˃ Add reference to “WindowsBase”
» Add each file as part of the package
» It will add a [Content_Types].xml file to every
zip file
˃ Part of the open packaging specification
» http://madprops.org/blog/zip-your-streams-with-system-io-
packaging/
24
25 Things I've Learned about C# - Phil Denoncourt
» Goto in switch statement
» >> multiplies by powers of 2, << divides
˃ Real fast
» as operator
˃ Faster than cast, doesn’t throw exception
» @ string constant qualifier
˃ Ignores  escapes
» StringBuilder concatenates strings faster
˃ For only for large amounts of data
25
25 Things I've Learned about C# - Phil Denoncourt
» Code Access Security
» Strong names
» Lackluster support for Xml Documentation
» Lack of development in certain libraries
˃ Linq to SQL
˃ ASP.NET
26
25 Things I've Learned about C# - Phil Denoncourt

More Related Content

What's hot

Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store apps
Csaba Fitzl
 
Mitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint SecurityMitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint Security
Csaba Fitzl
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
Roo7break
 
From Problem to Solution: Enumerating Windows Firewall-Hook Drivers
From Problem to Solution: Enumerating Windows Firewall-Hook DriversFrom Problem to Solution: Enumerating Windows Firewall-Hook Drivers
From Problem to Solution: Enumerating Windows Firewall-Hook Drivers
Ollie Whitehouse
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
Peter Hlavaty
 
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
CODE BLUE
 
Red Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite PerimeterRed Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite Perimeter
Mike Felch
 
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru OtsukaTake a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
CODE BLUE
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
Hackito Ergo Sum
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
CODE BLUE
 
bh-us-02-murphey-freebsd
bh-us-02-murphey-freebsdbh-us-02-murphey-freebsd
bh-us-02-murphey-freebsd
webuploader
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
kozossakai
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
enSilo
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
CODE BLUE
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Python
infodox
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniques
enSilo
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Codemotion
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
Royce Davis
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
Jeremy Brown
 
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
CODE BLUE
 

What's hot (20)

Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store apps
 
Mitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint SecurityMitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint Security
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
 
From Problem to Solution: Enumerating Windows Firewall-Hook Drivers
From Problem to Solution: Enumerating Windows Firewall-Hook DriversFrom Problem to Solution: Enumerating Windows Firewall-Hook Drivers
From Problem to Solution: Enumerating Windows Firewall-Hook Drivers
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
 
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
 
Red Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite PerimeterRed Team Tactics for Cracking the GSuite Perimeter
Red Team Tactics for Cracking the GSuite Perimeter
 
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru OtsukaTake a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
 
bh-us-02-murphey-freebsd
bh-us-02-murphey-freebsdbh-us-02-murphey-freebsd
bh-us-02-murphey-freebsd
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Python
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniques
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
 
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
 

Viewers also liked

Poster Competition - Hwan Lee
Poster Competition - Hwan LeePoster Competition - Hwan Lee
Poster Competition - Hwan Lee
Hwan Lee
 
Writing applications using the Microsoft Kinect Sensor
Writing applications using the Microsoft Kinect SensorWriting applications using the Microsoft Kinect Sensor
Writing applications using the Microsoft Kinect Sensor
phildenoncourt
 
Building your own arcade cabinet
Building your own arcade cabinetBuilding your own arcade cabinet
Building your own arcade cabinet
phildenoncourt
 
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
la-roque
 
Motion sensing and detection
Motion sensing and detectionMotion sensing and detection
Motion sensing and detection
Nirav Soni
 
Monitoring of patient in intensive care unit (ICU)
Monitoring of patient in intensive care unit (ICU)Monitoring of patient in intensive care unit (ICU)
Monitoring of patient in intensive care unit (ICU)
Raj Mehta
 
Patient Monitoring
Patient Monitoring	Patient Monitoring
Patient Monitoring
Khalid
 
motion sensing technology
motion sensing technologymotion sensing technology
motion sensing technology
Santosh Kumar
 

Viewers also liked (8)

Poster Competition - Hwan Lee
Poster Competition - Hwan LeePoster Competition - Hwan Lee
Poster Competition - Hwan Lee
 
Writing applications using the Microsoft Kinect Sensor
Writing applications using the Microsoft Kinect SensorWriting applications using the Microsoft Kinect Sensor
Writing applications using the Microsoft Kinect Sensor
 
Building your own arcade cabinet
Building your own arcade cabinetBuilding your own arcade cabinet
Building your own arcade cabinet
 
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
Unama br edinaldo_la-roque_oficina_kinect_20160917_2030
 
Motion sensing and detection
Motion sensing and detectionMotion sensing and detection
Motion sensing and detection
 
Monitoring of patient in intensive care unit (ICU)
Monitoring of patient in intensive care unit (ICU)Monitoring of patient in intensive care unit (ICU)
Monitoring of patient in intensive care unit (ICU)
 
Patient Monitoring
Patient Monitoring	Patient Monitoring
Patient Monitoring
 
motion sensing technology
motion sensing technologymotion sensing technology
motion sensing technology
 

Similar to 25 things i’ve learned about c#

C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
Mohammad Shaker
 
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
PranavPatil822557
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
AFUP_Limoges
 
Need 4 Speed FI
Need 4 Speed FINeed 4 Speed FI
Need 4 Speed FI
Marcel Bruch
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI Apps
Tom Elliott
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
AdaCore
 
The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008
Stephan Chenette
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
Vincent Mercier
 
BSides Iowa 2018: Windows COM: Red vs Blue
BSides Iowa 2018: Windows COM: Red vs BlueBSides Iowa 2018: Windows COM: Red vs Blue
BSides Iowa 2018: Windows COM: Red vs Blue
Andrew Freeborn
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
Dimitry Snezhkov
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
Patrick Chanezon
 
MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptx
gopikahari7
 
.NET for hackers
.NET for hackers.NET for hackers
.NET for hackers
Antonio Parata
 
Hacking Docker the Easy way
Hacking Docker the Easy wayHacking Docker the Easy way
Hacking Docker the Easy way
Borg Han
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
Chris McEniry
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building Blocks
Max Kleiner
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
.NET Debugging Workshop
.NET Debugging Workshop.NET Debugging Workshop
.NET Debugging Workshop
Sasha Goldshtein
 

Similar to 25 things i’ve learned about c# (20)

C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
Machine Learning , Analytics & Cyber Security the Next Level Threat Analytics...
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Need 4 Speed FI
Need 4 Speed FINeed 4 Speed FI
Need 4 Speed FI
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI Apps
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
 
The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
 
BSides Iowa 2018: Windows COM: Red vs Blue
BSides Iowa 2018: Windows COM: Red vs BlueBSides Iowa 2018: Windows COM: Red vs Blue
BSides Iowa 2018: Windows COM: Red vs Blue
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptx
 
.NET for hackers
.NET for hackers.NET for hackers
.NET for hackers
 
Hacking Docker the Easy way
Hacking Docker the Easy wayHacking Docker the Easy way
Hacking Docker the Easy way
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building Blocks
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
 
.NET Debugging Workshop
.NET Debugging Workshop.NET Debugging Workshop
.NET Debugging Workshop
 

Recently uploaded

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 

25 things i’ve learned about c#

  • 2. » Desktops ˃ WinForm ˃ WPF ˃ Linux, Mac, Solaris » Servers ˃ Web Apps ˃ Services (web/native) » Embedded Systems ˃ Micro .NET (Netduino, FEZ Domino) ˃ Windows Phone ˃ Robots ˃ iPhone » Gaming Consoles ˃ Xbox 360 ˃ Wii, Playstation 3 (via Mono) 2 25 Things I've Learned about C# - Phil Denoncourt http://mono-project.com
  • 3. » C# compiles to bytecode ˃ So it must be slow » Bytecode gets compiled to native code upon first usage ˃ Takes advantage of features that machine’s processor » Matches C++ in Int math, trig, and I/O. ˃ Little slower in floating point » C# benefits from disposing of objects when idle ˃ rather than when object is no longer used. » http://www.osnews.com/story/5602&page=3 3 25 Things I've Learned about C# - Phil Denoncourt
  • 4. » Built into the framework since 3.0 ˃ Add reference to System.Speech » Recognition ˃ Command based ˃ Dictation » Synthesis » Requires SAPI ˃ Windows Vista and Later ˃ Office 2003 and Later » http://gotspeech.net 4 25 Things I've Learned about C# - Phil Denoncourt
  • 5. » It’s easy to write ˃ ThreadPool.QueueUserWorkItem ˃ PLINQ ˃ BackgroundWorker component » It’s hard to debug ˃ Add trace / logging to your code » Make sure your classes are “ThreadSafe” ˃ Lock keyword ˃ Interlocked class » http://www.bluebytesoftware.com/blog/ 5 25 Things I've Learned about C# - Phil Denoncourt
  • 6. » Added in 3.0. Implemented as a generic class ˃ Allows you to consider value types that are nullable » Add ? to end of type ˃ Int? ˃ DateTime? ˃ String is already a reference type, thus already nullable » Null Coalesce operator ˃ Substitutes a value if the object is null ˃ Really low in operator precedence. Often need parens. » http://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx 6 25 Things I've Learned about C# - Phil Denoncourt
  • 7. » Exceptions hold a lot of information » Throwing them is computationally expensive ˃ Avoid using exceptions as logic flow » Stack trace line numbers are available if PDBs are present with the binaries » There is a difference between ˃ throw ˃ throw ex; » http://msdn.microsoft.com/en- us/library/5b2yeyab(v=VS.100).aspx 7 25 Things I've Learned about C# - Phil Denoncourt
  • 8. » checked ˃ By default, overflow checking is disabled in C# + Depending on compiler options ˃ Placing statements in checked block enables checking ˃ There is also an unchecked keyword ˃ http://msdn.microsoft.com/en-us/library/74b4xzyw(v=VS.100).aspx » volatile ˃ Keyword that indicates field could be updated by multiple threads + Disables compiler optimizations that assume single threaded access ˃ Places a “lock” statement around access to the field ˃ http://msdn.microsoft.com/en-us/library/x13ttww7(v=VS.100).aspx 8 25 Things I've Learned about C# - Phil Denoncourt
  • 9. » Allows you to add new methods to existing classes ˃ Even sealed classes » Can operate on public members ˃ But not private members » Good way to add “missing” functionality to class ˃ Good way to make something unmaintainable » Internally – implemented as a static method passing in the current instance. » http://extensionmethod.net/ 9 25 Things I've Learned about C# - Phil Denoncourt
  • 10. » Generic template that defers initialization until used » System.Lazy<T> » Object will be initialized when the value member is accessed, or ToString() is called. » http://weblogs.asp.net/gunnarpeipman/archive/2009/05/19/net-framework-4-0-using-system-lazy-lt-t-gt.aspx 10 25 Things I've Learned about C# - Phil Denoncourt
  • 11. » Lambda operator => » Anonymous function ˃ Contains code » Returns a delegate » Used extensively in Linq » http://msdn.microsoft.com/en- us/library/bb311046.aspx 11 25 Things I've Learned about C# - Phil Denoncourt
  • 12. » Eliminates a lot of repetitive coding » Implemented as extension methods in System.Linq.dll » Must reference the assembly, and add a using statement: ˃ using System.Linq; » Different providers allow access to different types of data by exposing IQueryable interface ˃ Linq to Objects ˃ Linq to SQL ˃ Linq to Entities ˃ Linq to Xml » http://msdn.microsoft.com/en-us/netframework/aa904594.aspx 12 25 Things I've Learned about C# - Phil Denoncourt
  • 13. » Normally static fields exist once per AppDomain » [ThreadStatic] static fields exist once per Thread » Static constructors and initializers still only execute once. ˃ So you have to make sure the object is not null before using it » http://blogs.msdn.com/b/jfoscoding/archive/2006/07/18/670497. aspx 13 25 Things I've Learned about C# - Phil Denoncourt
  • 14. » Allows you to move a class from one assembly to another without breaking callers » [assembly:TypeForwardedTo(typeof(classThatWasMoved)] ˃ Place this statement in the original assembly, which must reference the new assembly. » Used for refactoring types into different assemblies, and not have to rebuild the caller assembly. ˃ Namespace and name can’t change » Can also redirect entire assembly in .config file ˃ assemblyBinding section » http://msdn.microsoft.com/en-us/library/ms404275.aspx 14 25 Things I've Learned about C# - Phil Denoncourt
  • 15. » Don’t need to be based on int ˃ Can be byte, sbyte, short, ushort, int, uint, long, or ulong. » If you use the FlagsAttribute, you can perform bitwise operations ˃ Meaning that you can store more than one state in an enum variable. » http://dotnetperls.com/enum-flags 15 25 Things I've Learned about C# - Phil Denoncourt
  • 16. » -In addition to allowing shortcuts to namespaces » Automatically disposes objects when scope is outside of the using statement. » Object doesn’t need to be instantiated in the using statement ˃ But should » More than one object can be tracked by a using statement ˃ But they must be of the same type » http://msdn.microsoft.com/en-us/library/yh598w02.aspx 16 25 Things I've Learned about C# - Phil Denoncourt
  • 17. » Allows you to examine metadata about compiled code. » Has a reputation for being slow ˃ I haven’t found that to be very true » Allows access to private methods / fields of a class » You can also get the actual IL of the method for reverse engineering ˃ Which is what Reflector does » http://msdn.microsoft.com/en-us/library/f7ykdhsy(v=VS.100).aspx 17 25 Things I've Learned about C# - Phil Denoncourt
  • 18. » Can call other constructor methods ˃ Add :this to call a constructor in the current object ˃ Add :base to call a constructor in the base object » http://msdn.microsoft.com/en-us/library/ms173115.aspx 18 25 Things I've Learned about C# - Phil Denoncourt
  • 19. » Allows you to write code against an abstract type ˃ Type Parameter » When generic is used, a type is specified. ˃ Reduces the amount of boxing » Generics can be applied to ˃ Classes ˃ Delegates ˃ Methods ˃ Interfaces » Instead of comparing to null, compare to default(t) » http://msdn.microsoft.com/en- us/library/512aeb7t(v=VS.100).aspx 19 25 Things I've Learned about C# - Phil Denoncourt
  • 20. » Allows you to constrain what types can be used with a generic » Can constrain ˃ Classes that implement an interface ˃ Classes must have a common base class ˃ Parameterless constructor ˃ That the type is a class ˃ That the type is a struct » Constraints enforced by the compiler » http://msdn.microsoft.com/en-us/library/d5x73970.aspx 20 25 Things I've Learned about C# - Phil Denoncourt
  • 21. » Very easy since .NET 2.0 ˃ No more worrying about holding onto disposable objects » File class – static methods for ˃ Copying ˃ Renaming ˃ Deleting ˃ Checking existing ˃ Reading /writing data to a file ˃ Encrypt/Decrypt a file ˃ http://msdn.microsoft.com/en-us/library/system.io.file.aspx » Path class – static methods for ˃ Assembling a filename ˃ Changing extensions ˃ Getting a truly temporary filename ˃ http://msdn.microsoft.com/en-us/library/system.io.path.aspx 21 25 Things I've Learned about C# - Phil Denoncourt
  • 22. » Mostly done for you » .NET 4.0 supports 354 different cultures » Allows you to properly ˃ Format numbers ˃ Format currency ˃ Format date/times ˃ Compare strings » By default, the culture of the current thread is used when formatting/comparing » Globalization != Localization » http://en.wikibooks.org/wiki/.NET_Development_Foundation/Glo balization 22 25 Things I've Learned about C# - Phil Denoncourt
  • 23. » You can write code that writes code » Emits C# or VB.Net » Or can build an assembly using a compiler » Can build the assembly in memory ˃ Doesn’t get written to disk. » http://www.15seconds.com/issue/020917.htm 23 25 Things I've Learned about C# - Phil Denoncourt
  • 24. » GZipStream class only compresses one file » System.IO.Packaging ˃ Add reference to “WindowsBase” » Add each file as part of the package » It will add a [Content_Types].xml file to every zip file ˃ Part of the open packaging specification » http://madprops.org/blog/zip-your-streams-with-system-io- packaging/ 24 25 Things I've Learned about C# - Phil Denoncourt
  • 25. » Goto in switch statement » >> multiplies by powers of 2, << divides ˃ Real fast » as operator ˃ Faster than cast, doesn’t throw exception » @ string constant qualifier ˃ Ignores escapes » StringBuilder concatenates strings faster ˃ For only for large amounts of data 25 25 Things I've Learned about C# - Phil Denoncourt
  • 26. » Code Access Security » Strong names » Lackluster support for Xml Documentation » Lack of development in certain libraries ˃ Linq to SQL ˃ ASP.NET 26 25 Things I've Learned about C# - Phil Denoncourt