This Is A Game Changer

preview_player
Показать описание
### Twitch
Everything is built live on twitch
### Editor

Join this channel to get access to perks:

### Links

#coding #neovim #typescript #programming #vim #softwareengineering #codinglife #webdesign #webdevelopment #webdev #javascript #rustlang #rust #twitch #twitchstreamer #programmerhumor #codinghumor #software #softwareengineer #softwaredeveloper #softwaredevelopment
Рекомендации по теме
Комментарии
Автор

For those that are confused about this:

this has nothing to do with typing it has to do with INVARIANTS. imagine you have a private function that requires some _state_ of the world to exist. it _MUST NOT BE CALLED EVER_ without that. So if it breaks from its _REQUIREMENT_ crash the program with the state that lead up to this and that way you can fix your program based on the state that lead to the issue

ThePrimeagen
Автор

After 20 years of being corrupted by JavaScript's nonexistent typing habits, man comes back to the land of the sane.

Altrue
Автор

Negative space what? You just validated input my dude

totally_not_a_troll
Автор

What I don’t understand is how you were programming without this mindset.

Shlooomth
Автор

Didn't we call this defensive programming?

FizzlNet
Автор

Javascript developers try not to completely fuck everything up challenge: impossible

ubuntu_fan
Автор

That sounds like strong typing with extra steps

rushas
Автор

I have been programming for 3 years and sometimes felt like I am not good enough. But seeing this with someone who did it 20 years really helped, thank you!

mlogli
Автор

So... you added validation cases?
Is it 'negative space programming' or just a fundamental concept of robustness?

freffrey
Автор

20 years?? Just imagine what else this guy hasnt figured out yet

swooty
Автор

You can also start to use type which would enforce the invariant in their constructor instead of making the same assertion in multiple places.

dmitriykuragin
Автор

This is how I learnt to do it since the mid 90s writing C++ code. Pre and post condition assertions (at the beginning and end of a function) provide a very strong way to ensure programmes are bullet proof. Their history is long - I picked it up learning Eiffel and Ada back in my defence days. Something else that we used to say "loosen the pre conditions and tighten the post conditions". This makes your programme far more accepting at better handling inputs and conservative for generating outputs. It's also the principle of network protocol implementations as recommended by the IETF.

dazraf
Автор

In university we called this design by contract. You just assert your pre/post conditions and your invariants.

JeroenMW
Автор

Ahh programming, where you’re the detective and you’re the criminal and you plant evidence to make it easy to get yourself caught by yourself

thecompanioncube
Автор

this is also called "defensive programming"

rodrigob
Автор

There is an odd irony here about high-level programmers learning that type ambiguity is not always a good thing which is incredibly funny to me.
Because they usually rave on about the opposite.

dredge
Автор

Parse, don't validate. Value objects can be used to enforce contracts in compilation time. Once a value object is created, it remains valid.

ibrahimkoz
Автор

why the fuck am i here, ive never touched a line of code in my life

timfred_o
Автор

20 years without asserts means you've never worked in a software company. Glad you had a chance to learn something big this far into your career - you get to relive that excitement of the early days when learnt new things every day and rewired your brain :)

pranavswaroop
Автор

Discovering this just now is insane... this is the only way to do type safety in vanilla Js...

WiseWeeabo