If you want to tackle 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.
@UC9o5XrlWjXFOZayVA5JCXcg3 ай бұрын
Don't forget records! Gosh I love records.
@scosminv3 ай бұрын
@@UC9o5XrlWjXFOZayVA5JCXcg and record structs :)
@Novacification3 ай бұрын
If anything C# is becoming bloated. Classes, structs, ref structs, readonly structs, readonly fields, init fields, records, tuples, in/out/ref parameters, the list goes on (except const variables in methods for some reason because that would get "messy"). It's difficult to figure out exactly what impact the various keywords and data types will have, and almost impossible to figure out what the optimal combination is for a given non-simple scenario. With shorthand and various ways of achieving the same outcome we're almost at the point where one dev can write code that another will barely recognize.
@scosminv3 ай бұрын
@@Novacification Some constructs should be used in encapsulated code. Others which bring more expressiveness, should be used in usual code.
@Novacification3 ай бұрын
@@scosminv that is super vague and seems highly opinion based.
@paulsanchez5030 Жыл бұрын
I feel professionally validated hahahahaha, dude I use so much C# in my current job, I like it now.
@alissoncandatem1896 Жыл бұрын
true
@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 Жыл бұрын
@@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 Жыл бұрын
Still hate it. I like knowing when my memory will be freed.
@OcarinaOfVali Жыл бұрын
@@airman122469so you hate any language with a garbage collector.
@serdookr Жыл бұрын
love c#, feels like a more high-level c++ (EUGH) done right + linq my beloved
@YourMom-rg5jk Жыл бұрын
it feels like java but like not total dog shit
@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 Жыл бұрын
There is an ongoing proposal and source generator lib to help you with discriminated union.
@davidbottiau5408 Жыл бұрын
@@sps014 ah yes, I can see how using Source Generators simplify this.
@q1joe Жыл бұрын
You can use a to string attribute to get a string value that’s custom
@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.
@1992jamo4 ай бұрын
@@sps014 Discriminated unions just feel like interfaces but you're shifting the problem elsewhere.
@reddragon2358 Жыл бұрын
Let's go C#
@Bourn77 Жыл бұрын
It already did
@anthonysteinerv Жыл бұрын
U live under a rock? That happened like 5 years ago.
@justabrowser4744Ай бұрын
@@anthonysteinerv U live under a rock? That happened like 23 years ago.
@sacredgeometry Жыл бұрын
Best language you have featured so far
@CallousCoder Жыл бұрын
🙄It’s a cancer! It’s a Microsoft tumor eating away on your resources. Byte code, Garbage Collecting shit show.
@reddragon2358 Жыл бұрын
@@CallousCoder Nah, it is good
@CallousCoder Жыл бұрын
@@reddragon2358 agree to disagree 😉
@reddragon2358 Жыл бұрын
@@CallousCoder ;)
@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 Жыл бұрын
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 Жыл бұрын
@@SimonBuchanNz ah, true. Dang it. Should've looked at the docs first. Anyway extension methods are beautiful! :)
@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 Жыл бұрын
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 Жыл бұрын
@@anon-fz2bo please read up on extension methods... they are not instance methods at all.
@justgame5508 Жыл бұрын
Linq is great btw, easily my favourite feature of C#
@YourMom-rg5jk Жыл бұрын
it really is the only memorable C# feature
@FilipCordas Жыл бұрын
@@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.
@z0nx5 ай бұрын
@@FilipCordas But then again all good things from c# came from f#, how ironic
@JRischill3 ай бұрын
@@z0nx what's your point? they're both from the same ecosystem
@z0nx3 ай бұрын
@@JRischill There is no point. Its a dumb comment and I'm a specialist at that.
@quachhengtony7651 Жыл бұрын
benchmark the lexers in every languages, then we'll see who's laughing
@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
@istovall2624 Жыл бұрын
C# is best all hail c# Edit. Its pronounced c tic tac toe btw.
@shyshka_ Жыл бұрын
c hashtag
@tylerlaprade64211 ай бұрын
C Octothorpe
@jeffbulljr Жыл бұрын
C# is amazing! Do more video with it! :D (C# dev for 8 years, lately in games)
@DrewryPope Жыл бұрын
C# is good now
@spacewad8745 Жыл бұрын
69 likes 0 dislikes. balanced as all things should be
@1992jamo4 ай бұрын
The C# at 3:00 is so ancient looking. So much indentation and whitespace not required.
@emptycode1782Ай бұрын
You mind explaining ? I write C# and literally all the time i have many indentation
@quachhengtony7651 Жыл бұрын
built-in compile to binary out of 10
@md.redwanhossain62889 ай бұрын
OutputType exe means its an executable, not window's .exe. This is a horrible and confusing naming.
@polic72andDrD3ath8 ай бұрын
C# eh? gonna have to give it a button-down / Logitech Wave
@balasubramanianvaidyalinga487 Жыл бұрын
IEnumerable allows for iteration, IQueryable allows for LINQ although it’s easy to mod it with AsQueryable.
@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.
@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..
@perelium-x3 ай бұрын
C# is BASED
@anon-fz2bo Жыл бұрын
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.
@clingyking2774 Жыл бұрын
What colorscheme is he using?
@АлексейСтах-з3н Жыл бұрын
F# tho, I'm new here, have you reviewed it?
@fenkraken Жыл бұрын
F# would've been so much better, but that's if you are wiling to use Micros*ft language.
@fenkraken Жыл бұрын
Then again, Prime uses Typescript all the time, so...
@thijsyo Жыл бұрын
I rate this video a strong khakis/9-5
@TheVimeagen Жыл бұрын
pretty good
@asadbeksindarov683311 ай бұрын
I would recommend checking out F# too
@z0nx5 ай бұрын
The language that microsoft wants dead? Yeah,.. No.
@asadbeksindarov68335 ай бұрын
There is big community around F# and from your perspective I am assuming you've not coded in F#. Community drives everything in F# world just like any other open source languages
@andarba2148 Жыл бұрын
Where is C?
@SimGunther Жыл бұрын
They literally posted a vid on it here an hour ago
@bobanmilisavljevic420Ай бұрын
You asked for it. C deez nuts 😂
@gimmedatcake4785 Жыл бұрын
To me this video felt a bit Guid.Empty
@cariyaputta Жыл бұрын
Why don't M$ just get rid of XML already?
@davidbottiau5408 Жыл бұрын
Still better than YAML. But everyone has their opinions. :)
@Ayssi-purple Жыл бұрын
@@davidbottiau5408 Not a high bar to clear...
@SimonBuchanNz Жыл бұрын
YAML is the least bad format if a human has to interact with it, change my mind.
@ShadoFXPerino Жыл бұрын
XML is the best
@shreyasjejurkar1233 Жыл бұрын
FYI React syntax is also XML
@NullboyCode Жыл бұрын
Theprimeagen doesnt have C# lsp 😮, very noob
@spudhead169 Жыл бұрын
Lol, it's quite clear these guys could use some programming lessons.
@alihammadshah Жыл бұрын
What's that vim feature that shows the current scope ie the current Class and method or if block etc while scrolling.
@shylex7660 Жыл бұрын
nvim-treesitter-context
@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 Жыл бұрын
Like virtually almost any language?
@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 Жыл бұрын
Because it's not a ridiculous language that uses new lines so much easier to read and understand.
@1992jamo4 ай бұрын
Because lines can continue without them? If you have a really long linq/fluent expression, you don't have to inline them.
@ZeykaFX Жыл бұрын
Corporate# 🤢
@scosminv Жыл бұрын
C# actulally wanted to be a more concise C++. The # is the ++ overlapped :D.
@Crcs-1997 Жыл бұрын
Atrocious language
@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 Жыл бұрын
@@raylopez99Agreed
@anthonysteinerv Жыл бұрын
Skill issue.
@cubbucca Жыл бұрын
as a C# dev I rate this Men's Corduroy Pants out of GUID.default