Railway Oriented Programming in JavaScript by Dominik Saran

  Рет қаралды 635

Engineering Community

Engineering Community

Күн бұрын

Ever wondered why error handling in JavaScript applications is so cumbersome and verbose? Could we do better? Could just we forget about all that try-catch stuff, ‘undefined’ is not an object and failed promises (pun intended), and at the same time have our app just work? Well, perhaps we could. Enter railway-oriented programming. It’s not a new paradigm or anything - it’s just a clever way to organize our code to be able to focus on the actual problem (the business logic), instead of endless error handling - and still have those errors handled nicely.
Agenda:
The Problem
The solution v.1.0 (without ROP)
The solution v.2.0 (with ROP)
Live example (PESEL number validation)
Questions

Пікірлер: 3
@kshitijpatil2019
@kshitijpatil2019 Жыл бұрын
Don't you think we may face event loop related issues if we use promise this way? Like promise callbacks are scheduled to micro queue, so we might run into some race conditions while we were actually expecting things to be executed sequentially
@0xc0ffee_
@0xc0ffee_ Жыл бұрын
Could you explain why that is? If you await those promises your code becomes essentially synchronous
@coder_one
@coder_one Жыл бұрын
@@0xc0ffee_ javascript loops are synchronous. Using them with asynchronous code can lead to problems
WebXR 101 by Daniel Vega Ceja
40:42
Engineering Community
Рет қаралды 201
Contract testing in .NET with Pact.io by Anton Honcharenko
56:26
Engineering Community
Рет қаралды 443
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 121 МЛН
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 6 МЛН
Sigma Girl Pizza #funny #memes #comedy
00:14
CRAZY GREAPA
Рет қаралды 2,5 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 52 МЛН
Design patterns in JavaScript & TypeScript by Job Yoshua Zea
47:20
Engineering Community
Рет қаралды 110
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 63 М.
Overview of next-gen Java Frameworks for Microservices by Mykhailo Kratiuk
1:10:00
Little-Known AI Tools Giving Academics an Unfair Advantage
9:58
Andy Stapleton
Рет қаралды 11 М.
Why AWS CDK is like a wormy apple by Robert Piecyk
1:30:05
Engineering Community
Рет қаралды 80
CMake Fundamentals: From Basics to Beyond by Denys Bykov
43:39
Engineering Community
Рет қаралды 86
Michio Kaku: “We've FINALLY Found What's Inside a Black Hole!”
16:54
Chronicles of Space
Рет қаралды 4,4 М.
Simplify Data Management with GCP Dataform by Oleksandr Kalko
35:16
Engineering Community
Рет қаралды 145
Compiler - How It Works by Dmytro Hubatenko
56:06
Engineering Community
Рет қаралды 143
Performance: Preparation matters by Oleksandr Yudin
24:48
Engineering Community
Рет қаралды 56
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 121 МЛН