~20 years of designing and building large scale distributed systems.
Father, programmer, coffee lover ☕ beer enthusiast 🍻
#programming
#backend
#cloud
☁️
About me: I designed and implemented backend systems that serve traffic to 100+ million daily users across the US and Canada. Previously a full-stack developer (web, desktop, and some mobile), I’ve transitioned to focus solely on backend work. My extensive experience, often
Several people suggested to try Axum
So far they show the same results in terms of requests per second.
Rust: 45k
C#: 45k
JS: 5k
I added the source code here:
#csharp
and
#rust
probably show better results compared to the previous
#rust
with produces similar to
#dotnet
results but requires way more code and macro "magic".
C#: 34k
Rust: 34k
JS: 4k
The actual numbers fluctuate from run to run, C# and Rust keep showing very similar numbers. JS's highest I've seen was 4.4k.
I mixed
#csharp
experience in VSCode without Dev Kit is just as good as "the fullest" experience of TS or Golang in VSCode. It just means that C# experience in VS Pro or Rider is better than JS/TS or Go.
VS Community is also free and the same license is applied to C# Dev Kit.
There's this question of why the majority of startups don't use C# to build their software (an amazing language).
To use C# to its fullest, you need to buy Visual Studio licenses (Pro/Enterprise), per developer: $$$
To use TypeScript or Go to its fullest: you don't need this.
bflat is a concoction of Roslyn - the "official" C# compiler that produces .NET executables - and NativeAOT (née CoreRT) - the ahead of time compiler for .NET based on CoreCLR. Thanks to this, you get access to the latest C# features using the high
Pattern matching in
#dotnet
is very powerful, to demonstrate this, I will compare how a relatively complex switch/match statement differs between
#csharp
and
#fsharp
(F# example is ⬇️). Although, F#'s DUs look much better than C#'s inheritance, I personally prefer C#'s pattern
#rust
with produces similar to
#dotnet
results but requires way more code and macro "magic".
C#: 34k
Rust: 34k
JS: 4k
The actual numbers fluctuate from run to run, C# and Rust keep showing very similar numbers. JS's highest I've seen was 4.4k.
I mixed
@maxx_don
@CordasFilip
JSON test with a made up example that gets a fairly complex object, parses it, and generates a new JSON body to send back.
34k vs 4.4k
JS also cheats here. C# does full parsing of the incoming JSON object and performs casting and validation. E.g. if you submit a non-existing
A simple LTS
#dotnet
(up) vs
#nodejs
(bot) on Ubuntu benchmark. I didn't do any optimizations. Just a brand new project with the most basic code in both stacks.
40k vs 6k
I honestly expected the gap would be more significant, but almost 7 times difference is good too. Need to
It's not as crazy as Descent 3 but there are still some fun parts in this source code. This time I used my own tool to cross-reference bad words from against the MS-DOS repo.
Here is the full list my tool found:
* 6 2/12/97 5:35p Jason
* fixed yet another dumb syntax error...will I ever learn?
*
* 5 2/12/97 5:34p Jason
* fixed dumb syntax error
All of us are a little bit Jason sometimes.
@davidnix_
@jasonvmiller
Firing in the US is a huge headache for the companies. Legal (!), budget (especially with sign-on bonuses, medical/pension accounts on day 1, and training), wasted time.
okay, I didn't need to lookup the algorithm, but it took longer that I was hoping it would to lookup Rust syntax. And I'm still not sure this is the best way to do it in Rust. Turns out
#Rust
prefers iterative approach over recursion.
P.S. is there a better way to draw trees?
#csharp
experience in VSCode without Dev Kit is just as good as "the fullest" experience of TS or Golang in VSCode. It just means that C# experience in VS Pro or Rider is better than JS/TS or Go.
VS Community is also free and the same license is applied to C# Dev Kit.
@DanielW_Kiwi
If you need relations (you know, the R in RDBMS) and you have a lot of them - you have to use an RDBMS, hence SQL. Strong consistency is also much simpler with an RDBMS.
Hasen seems to be a fan of a key-value storage (prob as a single file) that is given directly to the client.
#fsharp
version
I definitely like the data modeling in F# more - discriminated unions for the win. I'm wondering if there is a better way of doing it though? I'd like to learn what other techniques devs use and see if my code could be further improved.
In case anyone wanted to know what
#dotnet
's Garbage Collector looks like. It's a 52922 lines · 1.81 MB file. They probably made it a single file as a compile time optimization strategy.
Why gRPC or REST may be preferred over GraphQL on your project.
- Gql is slower no matter how you slice it.
- Gql consumes more resources.
- Gql is very dangerous when open to the public anonymously, it's always best to keep gql endpoints behind some kind of auth.
-
@vestnikstabilno
@Erline1612
@mapiu2016
Я не совсем в теме, но со стороны выглядит как претензии к тем, кто накидывался на презентацию фильма Навальный, а не на сам фильм украинской команды, его участников или тех кто на сцене.
"The closest solutions to our proposal are Orleans and Akka. These frameworks also use abstractions to decouple the application and runtime. Ray is another actor based framework but is focused on ML applications. None of these systems support atomic rollouts, which is a necessary
If your services do sync communication via an async method, you're doing it wrong.
If you have more than 2 microservices in a sync call chain, you're probably doing it wrong.
If it takes longer than 10ms for a service-to-service communication, you're probably doing it wrong.
@DanielW_Kiwi
As someone who had to deal with multiple backend systems written in JS/TS - I disagree. Those companies burned a lot of cash to support their creations and I heard multiple developers saying "why didn't we choose a normal language?" while chasing infinite bugs.
I worked on a large set of microservices written in Go 2 years ago. It was a terrible mess. The payment endpoint took 5 minutes (!) to respond. Some other endpoints could take a few seconds to execute too. After messing with it for a month the client made a decision to gradually
@ThePrimeagen
Go architects who invent nuclear weapon architectures that no one would understand except them (valid for other languages too, but especially valid for exotic nerd languages like Go, Rust )
@erjdev
@ThePrimeagen
When I was a jr our lead asked for our functions to fit onto the screen "if possible". This advice served me well for 15 years. Our functions are typically 40-100 LOC. They can be longer when splitting them doesn't make sense.
@jerrynixon
@dotnet
All of those (except 4) would be difficult for a junior to understand. I'd vote 1 but convert the local function to a classic method and pass the params to it explicitly. I'd also unify the way the exceptions are thrown - either use extensions for both or the explicit "new".
My very first serious project in the beginning of my career was 20k LOC (lines of code) in a single file, in a single class. I wrote the whole thing by myself.
I learned C++ with OOP in college. I could create base and actual classes for things like animal, cat, dog. I could
@davidnix_
@joaoaguiam
We used to offer our candidates to either do a coding challenge or bring their own project and walk us through it. They get the instructions at least one week ahead of the interview so they have time to prepare.
I had 2 candidates that brought their own projects. They were
My Framework 16 is finally here!
The shipment was very fast - only 2 days. Everything arrived in a great condition. I love how it looks so far and I think I'm going to buy a few more modules for it soon :)
More details in the thread.
@FrameworkPuter
#Linux
#hardware
@terrajobst
"Although the tz database does not support time on other planets, it is documented here in the hopes that support will be added eventually."
Eventually, we will have to worry about what planet the device is on.
@maxx_don
@CordasFilip
JSON test with a made up example that gets a fairly complex object, parses it, and generates a new JSON body to send back.
34k vs 4.4k
JS also cheats here. C# does full parsing of the incoming JSON object and performs casting and validation. E.g. if you submit a non-existing
@DevLeaderCa
If we create a DB from scratch I usually default to EF. Migrations (DB versioning) are a must.
If it's an old project with a large existing DB then it's much faster to plug Dapper.
If my app is not the owner of the DB (bad but common practice) then Dapper it is.
@codemullins
Dotnet does not actually consume as much RAM as people on the Internet claim. It reserves a good chunk of RAM for spikes. Some of it is configurable and some RAM consumption goes down when AOT compiled.
Here is a demo of how it handles spikes:
@Hasen_Judi
>I've seen plenty of messed up (poorly architected) systems ...
Same, but I'm not making any assumptions about your or anyone else's work until I actually see it.
You are accusing other people in doing poor job. It's your job to provide proofs and not
Math explained, as simple as possible.
Every concept is explained step by step, from elementary to advanced. No fancy tricks and mathematical magic. Intuition and motivation first, technical explanations second.
@housecor
If you need to explain those things to a group of developers then the whole group should be let go. Those are not developers - those are students.
Battlenet app: use your browser to log in.
Browser: shit happened, go back to your app.
Battlenet app: go back to the browser.
Browser: ...
I cannot log into my own account...
#uxfail
@Perksey
I agree that it's not fair and that's why I put the word magic in quotes. C#/F# can do metaprogramming and source generation too. If I was more familiar with Rust/Rocket I would probably not even think to call it "magic". I have never got lost with anything DI related in
@magnum_d1ngus
@p1xelHer0
on the control boards we would signal to, would stand along side the C dev while we defined and tested signaling patterns.
.NETs network stack makes handling multi-threaded network signaling from 2000+ individual units easier to manage, lots of thought into the fact that the
#Golang
has evolved quite a bit since 2014, so it's not as simple anymore as it used to be (generics are a thing now). But it still has a lot less features compared to other popular languages.
@Hasen_Judi
What do "any of this" and 99% consist of? How is my message an indicator of people over calling anything?
Could you provide an example of a "real well architected" system from financial/healthcare/telecom industries that serves traffic to millions of users daily?
People tend to think that
#backend
is about producing API endpoints, but that's only 5% of the actual backend work.
BE (backend) is about
- concurrency
- security
- observability
- scalability
- DR (disaster recovery)
- databases
- data integrity
- performance
A month ago I went to pickup my kid's prescription. They asked me for their DOB. I smiled, because of course, I remember it as well as I remember my own name. And yet, I just kept smiling, unable to say a word. My mind was rushing, trying to retrieve that valuable piece of
@AgileJebrim
@Hasen_Judi
A real app does a lot more than a helloworld SQL query. It can work with multiple data sources and other services + perform some heavy CPU computations. Each IO operation can delay the response by a few hundred ms.
@cfbao
There are probably hundreds of thousands of devs with the same belief out there...
It even has intellisense with auto-complete, refactoring, jumping to definitions, finding references.
okay, I didn't need to lookup the algorithm, but it took longer that I was hoping it would to lookup Rust syntax. And I'm still not sure this is the best way to do it in Rust. Turns out
#Rust
prefers iterative approach over recursion.
P.S. is there a better way to draw trees?
@WasteCleaner
Maintainable code and good performance. "Clean code" is a very subjective thing. Maintainable code can be measured with metrics, but not every team is willing to develop those metrics.
@thedevdad_
@ThePrimeagen
95% of the time copilot suggests not what I need. I either have to type faster to prevent it getting in my way or constantly hitting Esc. I'm not turning it off because it helps with the other 5% pretty well.
Classic swap is still more performant with value types. It's interesting that XOR is basically the same as Tuple. The actual perf will depend on how those vars are used.
For reference types it doesn't really matter (performance wise) which method you use.
#csharp
#dotnet
I guess it's time to downgrade my payment for this service. It was nice to be able to write long messages, see less ads, undo/edit messages. Thanks
@X
P.S. I didn't violate any of the things listed in this screenshot or in the rules.
@WillEBunting
@tsoding
I worked for several Fortune 500 companies. Python may exist somewhere within the org beyond AI/ML, but it's not the main stack. I personally rewrote two Python-based backends with something more appropriate for backend.
@damienguard
If you're able to pay annual salary + benefits to 250+ developers you can definitely afford licenses, be it VS or much cheaper Rider.
Keep in mind that some devs will intentionally use things like neovim or plain VSCode which are completely free. I even know devs that buy Rider
@Korn1699
@ThePrimeagen
You don't need a license to use C#, F#, dotnet SDK, dotnet runtimes or Kestrel (web server).
You need a license to use VS and Rider when you get more than $1 million in profit. InteliJ, PyCharm, PhpStorm, WebStorm, GoLand also require a license.
#csharp
experience in VSCode without Dev Kit is just as good as "the fullest" experience of TS or Golang in VSCode. It just means that C# experience in VS Pro or Rider is better than JS/TS or Go.
VS Community is also free and the same license is applied to C# Dev Kit.
@ezdubs_bot
@db_regret
@tsoding
This particular joke is close to impossible to translate properly, hence it sounds stupid in English, but it's a very good bot!
@FelixSchlang
@elonmusk
@TSStarfish
I agree that copyright sucks in general because it's misused and abused, especially on YT. But why would you re-stream an already available stream?..
@john_e_bones
@MartinDotNet
Not for Microsoft as a whole, but for some of their products, which are simply good. You can love C# and MSSQL and at the same time love Arch Linux, PostgreSQL or
@TigerBeetleDB
, Neovim, OCaml. People spread too much hate for no reason.
@rodtrent
It's not a fair comparison. One is a scripting language and another one is an actual shell, like bash or zsh. While you can script anything you want with pwsh, they solve different sets of problems.
In 1959 the cost of a new house was less than 2x average income. Today the average income in the US is $60k and the cost of a new house is $250k in a typical state/city and 650k in a more in demand area.
Side note: apparently, we have a party in the terminal.
I think Visual Studio answered its own question...
Tbh, I never found those errors useful. It's faster to just restart the IDE than digging into the errors it generated.
MacOS is the only one that they have precompiled binaries for. But it was pretty easy to build it for Windows. It took 12 minutes to do a debug build and 16 minutes for a release build.
Zed IDE
@zeddotdev
, which is known for being a high-performance, multiplayer code editor, is hiring the author of
@roc_lang
,
@rtfeldman
. The interview was comprehensive and engaging, covering a range of topics from technical aspects to fun
"The closest solutions to our proposal are Orleans and Akka. These frameworks also use abstractions to decouple the application and runtime. Ray is another actor based framework but is focused on ML applications. None of these systems support atomic rollouts, which is a necessary