1.64k likes | 1.66k Views
C# E volution. Mariusz Bojkowski. Mariusz Bojkowski. Passionate programmer Focused on C# / .NET Has a blog: https://CSharp.Today Twitter: @ CSharp Today Facebook: https://fb.me/CSharp.Today. Agenda. Cool Conception The C# Name C# Feature s The new C# 8.0. COOL Conception.
E N D
C# Evolution • Mariusz Bojkowski
Mariusz Bojkowski • Passionate programmer • Focused on C# / .NET • Has a blog: https://CSharp.Today • Twitter: @CSharpToday • Facebook: https://fb.me/CSharp.Today
Agenda • CoolConception • The C# Name • C# Features • The new C# 8.0
https://1.fwcdn.pl/an/49468/2015/67365.12.jpg Picture source: https://cdn1.img.sputniknews.com/images/105081/72/1050817252.jpg
1996 Dolly the Sheepwas born https://timedotcom.files.wordpress.com/2016/06/dolly.jpeg
Common Language Runtime 1996 Developed as incubation project by COM+ team
Common Language Runtime 1996 Developed as incubation project by COM+ team Called COR
WhatdoesCOR stand for? HINTSDeveloped by COM+ teamCOM means Component Object Model
1998 Google was founded https://www.qs.com/4-things-your-university-brand-learn-from-googles-new-logo/
CLR team started 1998 CLR was written in SMC
Simple Managed C = SMC
1999 Star Wars: Episode I https://upload.wikimedia.org/wikipedia/en/4/40/Star_Wars_Phantom_Menace_poster.jpg
Team to build new language 1999 Anders Hejlsberg co-designed • Turbo Pascal • Delphi • C# • TypeScript
What was the code name?
What was the code name? HINTIt was very cool code name
What was the code name? COOL
C-like Object Oriented Language = COOL
2000 https://i.iplsc.com/windows-me/0004KX25O7X73W9L-C122-F4.jpg
2000 Polish instant messenger https://gadu-gadu.pl/
COOL renamed to C# 2000 .NET announced .NET ported to C# ASP.NET ported to C#
2002 was founded https://www.spacex.com/
2018 2002 was founded https://www.spacex.com/
Visual Studio .NET released 2002 C# 1.0 .NET Framework ASP.NET
When C# name was used for the first time? HINTs ? 2000 – Cool renamed C# 1999 – Created team to build COOL / C# 1998 – Created team to build CLR 1996 – First work on CLR
1988 When C# name was used for the first time? Picture source: https://www.urbanghostsmedia.com/wp-content/uploads/2015/06/delorean-time-machine-2.jpg
MS used C# name for the first time 1988 Variant of C language Designed for incremental builds The project wasn’t finished
C# name origin Inspired by musical notation A note should be a semitone higher C♯
C# name origin Inspired by musical notation A note should be a semitone higher
C# name origin Like C++ is a next version of C The same C♯ is a next version of C++
C# name origin Musical sharp (♯) was simplified to number sharp (#) C♯ → C#
Partial types partialclassPartialClassExample { void Method1() { } } partialclassPartialClassExample { voidSomeOtherMethod() { } }
Partial methods • partialclassPartialMethods • { • partialvoidDoWork(); • } • partialclassPartialMethods • { • partialvoidDoWork() • { • // Do something • } • }
Methods, events, handlers publiceventEventHandlerMyEvent; voidEventExample() { MyEvent += newEventHandler(EventExample_MyEvent); } publicvoidFireMyEvent() { EventHandlermyEvent = MyEvent; if (myEvent != null) { myEvent(this, EventArgs.Empty); } }
Method group conversions voidEventExample() { MyEvent += newEventHandler(EventExample_MyEvent); }
Method group conversions voidEventExample() { MyEvent += newEventHandler(EventExample_MyEvent); } voidEventExample() { MyEvent += EventExample_MyEvent; }
Anonymous methods • voidEventExample() • { • // Use anonymous methods • MyEvent += delegate (objectsender, EventArgsargs) • { • // Do somework • }; • }
Lambda expressions • voidEventExample() • { • // Use lambda expressions • MyEvent += (sender, args) => • { • // Do somework • }; • }
Extension methods • publicstaticvoidMyMethod(thisstring s) { } • staticvoidExample() • { • "value".MyMethod(); • }
Expression trees • Expression<Func<int, int, int>> sumExpression = • (a, b) => a + b; • int sum2 = sumExpression.Compile()(1, 2);
Query expressions • varadults = • from person indb.People • whereperson.Age > 18 • selectnew { person.FirstName, person.LastName };
local functions • voidMyMethod(int value) • { • LocalFunction(); • voidLocal() { }// Can access ‘value’ • }