Code Review: C# + Some Banter

  Рет қаралды 36,942

TheVimeagen

TheVimeagen

Жыл бұрын

LIVE ON TWITCH: / theprimeagen
Check out Teej!:
/ @teej_dv
/ teej_dv
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact

Пікірлер: 92
@markusmachel397
@markusmachel397 Жыл бұрын
Prime´s hate for c# got Garbage Collected
@scosminv
@scosminv Жыл бұрын
If you want to tacle performance with C# you can perform pretty low level optimizations with ease. C# has structs, ref structs, Span, ArrayPool, StructLayout (to control the physical layout of your data in memory) and many others.
@paulsanchez5030
@paulsanchez5030 Жыл бұрын
I feel professionally validated hahahahaha, dude I use so much C# in my current job, I like it now.
@alissoncandatem1896
@alissoncandatem1896 Жыл бұрын
true
@publicalias8172
@publicalias8172 Жыл бұрын
It gets wayyy more hate than is necessary.. we get it, it's basically Java# who cares? The important thing is; it's not Java lol
@davidbottiau5408
@davidbottiau5408 Жыл бұрын
@@publicalias8172 it's so far better than Java. I don't know how this thing still proliferate.. I mean, I know why but still..
@airman122469
@airman122469 Жыл бұрын
Still hate it. I like knowing when my memory will be freed.
@OcarinaOfVali
@OcarinaOfVali Жыл бұрын
​@@airman122469so you hate any language with a garbage collector.
@serdookr
@serdookr Жыл бұрын
love c#, feels like a more high-level c++ (EUGH) done right + linq my beloved
@YourMom-rg5jk
@YourMom-rg5jk 11 ай бұрын
it feels like java but like not total dog shit
@justgame5508
@justgame5508 Жыл бұрын
Linq is great btw, easily my favourite feature of C#
@YourMom-rg5jk
@YourMom-rg5jk 11 ай бұрын
it really is the only memorable C# feature
@FilipCordas
@FilipCordas 9 ай бұрын
@@YourMom-rg5jk async came from c#, Observables are a c# invention. Async enumerables are a c# invention. Events as much as people hate on them are awesome in c#. using statement is from c#. extern import is an underused feature.
@cheebadigga4092
@cheebadigga4092 Жыл бұрын
Edit: Got corrected via comment, IsDigit is not an extension method, it's just a static method. But still extension methods are beautiful! In C# you can have "extension methods", basically attaching methods to types. Signatures being: public static ReturnType SomeMethod(this SomeType someInstance) - for char, this looks something like this: public static bool IsDigit(this char c). This has the advantage that the types themselves - especially primitive types like char, int, etc - are just that, types. They don't have any methods themselves. The runtime can attach these extension methods, either the ones provided by Microsoft (like IsDigit), or you can write your own. I think that's really beautiful about the language. It borrows this idea from Python, where you can simply add a method to a class just by writing "myobject.mymethod = SomeMethodHere", but without the downsides like overwriting methods that class already has. If your C# extension method would overwrite an instance method, then, at least the compiler will warn you or throw an error. Not sure which one happens but it for sure does not just let you do it like Python would.
@SimonBuchanNz
@SimonBuchanNz Жыл бұрын
I have no idea why people were saying this in chat, let alone here where you have time to think about it. char.IsDigit() has nothing to do with extension methods, it's just a plain static method on the char type. That's why there's a type on the left, and the actual character value is passed in as a parameter.
@cheebadigga4092
@cheebadigga4092 Жыл бұрын
@@SimonBuchanNz ah, true. Dang it. Should've looked at the docs first. Anyway extension methods are beautiful! :)
@scosminv
@scosminv Жыл бұрын
you can easily create an extension method in a static class that you bring in scope with a using statement like this: public static bool IsDigit(this char c) => Char.IsDigit(c); Now you can invoke it like this: bool isDigit = c.IsDigit(); so no reason to debate here :)
@anon-fz2bo
@anon-fz2bo 11 ай бұрын
i dont even code in C# and i knew that isDigit is a static method. its not hard to differentiate between instance and static methods. please dont call instance methods extension methods either its far simpler to refer to a method that takes in self or this as an instance method since you create an instance of the class then invoke the method on that instance.
@cheebadigga4092
@cheebadigga4092 11 ай бұрын
@@anon-fz2bo please read up on extension methods... they are not instance methods at all.
@sacredgeometry
@sacredgeometry Жыл бұрын
Best language you have featured so far
@CallousCoder
@CallousCoder Жыл бұрын
🙄It’s a cancer! It’s a Microsoft tumor eating away on your resources. Byte code, Garbage Collecting shit show.
@reddragon2358
@reddragon2358 Жыл бұрын
​@@CallousCoder Nah, it is good
@CallousCoder
@CallousCoder Жыл бұрын
@@reddragon2358 agree to disagree 😉
@reddragon2358
@reddragon2358 Жыл бұрын
@@CallousCoder ;)
@quachhengtony7651
@quachhengtony7651 Жыл бұрын
benchmark the lexers in every languages, then we'll see who's laughing
@reddragon2358
@reddragon2358 Жыл бұрын
Let's go C#
@Bourn77
@Bourn77 Жыл бұрын
It already did
@anthonysteinerv
@anthonysteinerv 11 ай бұрын
U live under a rock? That happened like 5 years ago.
@davidbottiau5408
@davidbottiau5408 Жыл бұрын
Unfortunately, you cannot put data into enums (other than a numeric value). That's pretty much the main impediment with C# and if you need to do something like that, you have to write class with static properties. It's clearly not cleaner than Rust enums but it works.
@sps014
@sps014 Жыл бұрын
There is an ongoing proposal and source generator lib to help you with discriminated union.
@davidbottiau5408
@davidbottiau5408 Жыл бұрын
@@sps014 ah yes, I can see how using Source Generators simplify this.
@q1joe
@q1joe Жыл бұрын
You can use a to string attribute to get a string value that’s custom
@MrOnePieceRuffy
@MrOnePieceRuffy Жыл бұрын
and THANKS GOD this is the case. There can't be other data in an enum. If you can save other data than that, you program with real cancer for Computers.
@donutdude246YT
@donutdude246YT 6 ай бұрын
C# is amazing! Do more video with it! :D (C# dev for 8 years, lately in games)
@metaltyphoon
@metaltyphoon Жыл бұрын
I’m going to have to push my PR, that code does too much string creating for no reason. I actually benchmarked mine against this and it used half less memory and it was 20% faster
@DrewryPope
@DrewryPope Жыл бұрын
C# is good now
@istovall2624
@istovall2624 Жыл бұрын
C# is best all hail c# Edit. Its pronounced c tic tac toe btw.
@shyshka_
@shyshka_ 11 ай бұрын
c hashtag
@tylerlaprade642
@tylerlaprade642 4 ай бұрын
C Octothorpe
@godelcio
@godelcio Ай бұрын
Good video. Meanwhile, yes, the .net .sln files are ugly but In the current Visual Studio beta, there is the possibility to save a way better and cleaner solution file, saving it as the extension .slnx . It will be a lot better for building tooling around it, we can expect it for the next VS release.
@clingyking2774
@clingyking2774 Жыл бұрын
What colorscheme is he using?
@polic72andDrD3ath
@polic72andDrD3ath Ай бұрын
C# eh? gonna have to give it a button-down / Logitech Wave
@quachhengtony7651
@quachhengtony7651 Жыл бұрын
built-in compile to binary out of 10
@spacewad8745
@spacewad8745 Жыл бұрын
69 likes 0 dislikes. balanced as all things should be
@balasubramanianvaidyalinga487
@balasubramanianvaidyalinga487 Жыл бұрын
IEnumerable allows for iteration, IQueryable allows for LINQ although it’s easy to mod it with AsQueryable.
@dineingergaro7589
@dineingergaro7589 Жыл бұрын
LINQ is, in the default dotnet, implemented with IEnumerable. And as far I know they wrote another implementation for IQueryable in the Entity Framework.
@md.redwanhossain6288
@md.redwanhossain6288 Ай бұрын
OutputType exe means its an executable, not window's .exe. This is a horrible and confusing naming.
@anon-fz2bo
@anon-fz2bo 11 ай бұрын
the code in the thumbnail makes no sense. if position == 0 then any string invoked in Lexer.ParseTokens("1aB") would start an infinite loop + other things.
@user-cr3dn9vt6h
@user-cr3dn9vt6h 9 ай бұрын
F# tho, I'm new here, have you reviewed it?
@asadbeksindarov6833
@asadbeksindarov6833 4 ай бұрын
I would recommend checking out F# too
@andarba2148
@andarba2148 Жыл бұрын
Where is C?
@SimGunther
@SimGunther Жыл бұрын
They literally posted a vid on it here an hour ago
@thijsyo
@thijsyo Жыл бұрын
I rate this video a strong khakis/9-5
@TheVimeagen
@TheVimeagen Жыл бұрын
pretty good
@WillEhrendreich
@WillEhrendreich Жыл бұрын
2:30 they would have that expressiveness .. If they just used fsharp with Discriminated Unions... Like in Ocaml. OK.. I'll try to keep my fsharp fan-boying to one comment..
@fenkraken
@fenkraken Жыл бұрын
F# would've been so much better, but that's if you are wiling to use Micros*ft language.
@fenkraken
@fenkraken Жыл бұрын
Then again, Prime uses Typescript all the time, so...
@gimmedatcake4785
@gimmedatcake4785 Жыл бұрын
To me this video felt a bit Guid.Empty
@spudhead169
@spudhead169 10 ай бұрын
Lol, it's quite clear these guys could use some programming lessons.
@cariyaputta
@cariyaputta Жыл бұрын
Why don't M$ just get rid of XML already?
@davidbottiau5408
@davidbottiau5408 Жыл бұрын
Still better than YAML. But everyone has their opinions. :)
@alexisauriac7941
@alexisauriac7941 Жыл бұрын
@@davidbottiau5408 Not a high bar to clear...
@SimonBuchanNz
@SimonBuchanNz Жыл бұрын
YAML is the least bad format if a human has to interact with it, change my mind.
@ShadoFXPerino
@ShadoFXPerino Жыл бұрын
XML is the best
@shreyasjejurkar1233
@shreyasjejurkar1233 Жыл бұрын
FYI React syntax is also XML
@NullboyCode
@NullboyCode Жыл бұрын
Theprimeagen doesnt have C# lsp 😮, very noob
@ZeykaFX
@ZeykaFX Жыл бұрын
Corporate# 🤢
@scosminv
@scosminv Жыл бұрын
C# actulally wanted to be a more concise C++. The # is the ++ overlapped :D.
@Ryuujin1024
@Ryuujin1024 Жыл бұрын
I will never understand why C# kept the ; at the end of lines. Copying Java a bit too hard on that one. Just im a spoilt Kotlin fanboy so...
@OcarinaOfVali
@OcarinaOfVali Жыл бұрын
Like virtually almost any language?
@scosminv
@scosminv Жыл бұрын
it's a statement - based language. It accepts expressions in limited situations. It would be nice if it would adopt Rust's approach with ; for statement, no ; for expressions. It would make return keyword an option... to return value x from a function you would either use: ... return x; } or: ... x } currently only first option is available.
@FilipCordas
@FilipCordas 9 ай бұрын
Because it's not a ridiculous language that uses new lines so much easier to read and understand.
@Crcs-1997
@Crcs-1997 Жыл бұрын
Atrocious language
@raylopez99
@raylopez99 Жыл бұрын
Great language, MSFT's version of Java, GC, works very well with WFC, super fast (`3-4x of C/Rust), what's not to like? And you help my favorite corporation, that made my family even richer, MSFT baby. Not that MSFT makes money off of C# (or even selling OSes anymore, I think less than one-third their revenue comes from Windows licenses these days).
@reddragon2358
@reddragon2358 Жыл бұрын
​@@raylopez99Agreed
@anthonysteinerv
@anthonysteinerv 11 ай бұрын
Skill issue.
@alihammadshah
@alihammadshah Жыл бұрын
What's that vim feature that shows the current scope ie the current Class and method or if block etc while scrolling.
@shylex7660
@shylex7660 Жыл бұрын
nvim-treesitter-context
@socialkruption
@socialkruption Жыл бұрын
php #1
@cubbucca
@cubbucca Жыл бұрын
as a C# dev I rate this Men's Corduroy Pants out of GUID.default
@TheVimeagen
@TheVimeagen Жыл бұрын
great rating
Code Review: CPP
12:29
TheVimeagen
Рет қаралды 49 М.
Code Review: C
10:14
TheVimeagen
Рет қаралды 34 М.
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 6 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 13 МЛН
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 48 МЛН
Luck Decides My Future Again 🍀🍀🍀 #katebrush #shorts
00:19
Kate Brush
Рет қаралды 8 МЛН
Programming War Crimes | Prime Reacts
10:36
ThePrimeTime
Рет қаралды 334 М.
Code Review: Crystal
7:34
TheVimeagen
Рет қаралды 11 М.
ThePrimeagen Hacks My Productivity
3:30
Scott Macchia
Рет қаралды 39 М.
I Tried C#
4:32
conaticus
Рет қаралды 229 М.
Highly offensive Jonathan Blow clips to boost your productivity
4:37
Accidentally created ASM++ | Prime Reacts
15:09
ThePrimeTime
Рет қаралды 57 М.
Code Review: Ocaml
35:52
TheVimeagen
Рет қаралды 30 М.
How to ACTUALLY switch from VS Code to Neovim
5:09
Joshua Morony
Рет қаралды 182 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 51 МЛН
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Не шарю!
Рет қаралды 1,3 МЛН