The Better Parts. Douglas Crockford. JS Fest 2018

  Рет қаралды 24,509

Fest Group

Fest Group

4 жыл бұрын

The talk from JS Fest conference in Kyiv, Ukraine.
This talk is about using programming languages more effectively and using that experience to create and select better programming languages. There are bad practices in software development that are so old and well established that it is difficult to recognize the problems they cause. There will be a short review of the new good parts in ES6. JSON will also be mentioned.
Presentation: www.slideshare.net/JSFestUA/j...
Fb: / jsfestua
Website: jsfest.com.ua/
Upcoming JS Conference:
JS Fest 2020 - 30-31st of October, Kyiv, Ukraine
Details and tickets: bit.ly/2EoHvQo

Пікірлер: 41
@leroySteroy
@leroySteroy 5 жыл бұрын
"He experienced several crashes during his career and survived almost all of them"... no reaction.
@AiwwwA
@AiwwwA 2 жыл бұрын
Very nice insates, and good takeaways for me. Thank you :)
@shrimpoffthebarbie
@shrimpoffthebarbie Жыл бұрын
They can of course return objects. You just put a => ({a}) . Oh Doug. I bet you use them now don't you?
@nickmoore5105
@nickmoore5105 4 жыл бұрын
Great talk, but that code font is making my eyes hurt
@vickmackey24
@vickmackey24 2 жыл бұрын
22:40 Interesting idea (although he forgot the global /g flag in his replacement). I guess he's in favor of using \s instead of literal spaces in all of his regular expressions. Not sure if I'd bother to clutter up my code this way, though, given that I typically write and test my regexes once and rarely need to significantly modify them again.
@eotfofiw2748
@eotfofiw2748 2 жыл бұрын
What font is being used here? I'm curious what it looks like when you're using capital L and lowercase L
@YASYTU
@YASYTU 2 жыл бұрын
"I hate sand, by the way" Darth Crockford confirmed?
@mkohivlog8988
@mkohivlog8988 8 ай бұрын
Success is exchange of knowledge and ideas to learn from each other and applying together. Organisation is not a school classroom where goal is individual to achieve. It is obvious if we think of ourselves and declare what is best but take a tour outside the window and imagine they are infinite stars who I think would understand what language thier words should have gone through until they join us and I think we are not yet in advance proportion to meet their numbers. I believe in learning what I lack no matte what. Writing, shaping, applying and computing should be rethink to understand in each deeply and collective and cooperative work need nothing else but communication to see what we or the organization want.
@shrimpoffthebarbie
@shrimpoffthebarbie Жыл бұрын
I'm on side with everything. But fat arrows I LOVE
@EricDubeA
@EricDubeA 3 ай бұрын
right? For me it was obvious that his example *wouldn't* work, although I'll admit I expected it would output `Uncaught SyntaxError: Unexpected token ':'` because honestly somehow, after years of writing javascript code professionally on teams with other people, I have never seen anybody use a labelled statement in javascript (and I'm a little surprised non-loop statements are allowed to be labelled despite there being absolutely no way to use that label).
@isaactuuri6488
@isaactuuri6488 Жыл бұрын
47:00 could this be said as advanced casting?
@isaactuuri6488
@isaactuuri6488 Жыл бұрын
22:20 Regex, good info..
@olamundo463
@olamundo463 3 жыл бұрын
Nice talk but heavy crowd..
@tobias-edwards
@tobias-edwards 2 жыл бұрын
Interesting insights, as opinonated as ever gotta love him. I'll continue to prefer arrow functions, I think TypeScript is helpful if used sparingly but I'm not too convinced either, I do like how GraphQL enforces types on API schema though. The 'Next Language' could just be around the corner, but probably not. Elm looks promising, I'll take a look at that next week
@tnsaturday
@tnsaturday 7 ай бұрын
Elm is dead, 3 years gone still 0.19.something
@mattmarkus4868
@mattmarkus4868 3 жыл бұрын
19:20 _and fortunately there is a clean subset of module syntax and I recommend using just that_ ... What is he referring to? Where is this subset?
@ropewalkingelephant
@ropewalkingelephant 3 жыл бұрын
He means only using default and not named exports
@alessandrob.g.4524
@alessandrob.g.4524 2 жыл бұрын
@@ropewalkingelephant Actually I think he means exporting one thing, regardless of it being a default or named export.
@a8lg6p
@a8lg6p 2 жыл бұрын
I completely agree with him on class... I'd rather the language just not have it. (A) I consider hierarchical inheritance harmful in the first place, and (B) it's fake, as he explains... It's just there to make Java devs feel more comfortable, but it's a trap, because it's just syntax sugar for something (prototypal inheritance) that is fundamentally different from what most people will expect when they see the class syntax. And it's not necessary. But on don't use XYZ feature... Maybe I'm one of those hotshots who thinks I'm too smart and it will bite me eventually, but... I know all the falsy values off the top of my head, for example, because I'm a JS developer. I know when coercion happens, and only use it if I'm sure it'll do what I want it to do. If I'm not sure, I'll Google it. When I do 'if (foo)', the condition won't happen if foo 0 or "" etc. If that's a problem under the circumstances, I write what I want instead. If you want a one-line arrow function to return an object, you have to wrap the object literal in parentheses. Otherwise, the curly braces delimit a code block, and unless there's a return statement in it, your arrow function returns 'undefined'. Regardless of whether or not that's how it should work, that's how it DOES work, and if you want to be a competent JS developer, that's something you just have to know. Sorry. But not sorry. Every language is the result of choices that may be debatable, and sometimes seem arbitrary and inconsistent. As irritating as that may to some of with OCD or "on the spectrum" tendencies, that's just the way it is. Even moreso with JS than other languages perhaps. Yes it might be nice if some design choices were made differently. But there's no programming language who's workings are just obvious, where you don't need to study its idiosyncrasies to be able to write good code with it.
@Brocklesna8
@Brocklesna8 4 жыл бұрын
"when java guys get confused, thats trouble" :)
@kebbotnet4170
@kebbotnet4170 3 жыл бұрын
I'm a fat arrow lover, but I kind of agree with Doug EXCEPT I think we should keep fat arrow functions but limit them to be single-line definitions ONLY, and also remove this weird exception where single-parameter funcs don't require parentheses. reduce ambiguity and room for confusion.
@a8lg6p
@a8lg6p 2 жыл бұрын
I'd rather just drop the "function" keyword myself. I think it's redundant to have two ways to define a function... So as far as I'm concerned, arrow function is simply THE way to define a function. If it's up to me. Which goes along nicely with how, like Douglas, I never use "this" unless I'm forced to because I'm using Angular or something (which, sadly, I am). Don't use 'this', and there isn't any reason you ever need 'function' to create a function. Don't think you can make a constructor function with fat arrow syntax either, but again, like he suggests: Don't make constructor functions or use the "new" keyword unless a 3rd party library forces you to. Problem solved.
@mrbigberd
@mrbigberd 2 жыл бұрын
This isn't currently possible because arrow functions don't instantiate variables/objects for `this` or `arguments.
@jsonkody
@jsonkody 2 жыл бұрын
Jar Jar is strongest sith in universe :D Good choice ;)
@yankotliarov9239
@yankotliarov9239 Ай бұрын
Basically boils down to "write JS functional and not OOP" which is ok if you can, but its really unfair to say you can do anything functional. There are strong cases for OOP and good programmer should always consider both approaches when solving problem.
@skryonline5825
@skryonline5825 3 жыл бұрын
People using "class" will go to their graves never knowing how miserable they were =)
@daelous88
@daelous88 2 жыл бұрын
But javascript now have private class.
@27sosite73
@27sosite73 6 ай бұрын
@@daelous88
@Sindoku
@Sindoku Жыл бұрын
It seems he got arrow functions and typescript wrong. He also sort of got weak map wrong. If it was as good as he says, wouldn’t more people be using it? I hardly see anyone using them. It frees up memory like he said, but devices have so much memory that it doesn’t typically matter. He sort of got proxies wrong too. Proxies make certain versions of Vue JS possible. However, everything else it seems he got right, which is very impressive given that I have 4 years of futuristic knowledge to compare against his thoughts. On a funny note, he definitely got classes, symbols, generators and iterators right, and thank God for that because so far, I haven’t seen any popular packages that rely on these for core functionality.
@mrbigberd
@mrbigberd 10 ай бұрын
He's right about weak map, but even experienced JS devs don't actually know what it does or how it works. He's also right about Typescript. It is deliberately and intentionally unsound. It has a way to type everything -- even stuff you shouldn't be doing. Finally, it does exactly zero to encourage making code faster. A good type system would do all of these (for example, StandardML has a much more simple type system, but it is sound AND more powerful).
@PaulSpades
@PaulSpades 9 ай бұрын
No, no. Crockford is completely right about typescript and the problems it causes. Strict type systems only make sense in static languages, JS is scheme in sheep's clothing - as dynamic as it gets (lambda, recursion, heap allocated structures). Almost all errors and bugs in JS programs happen on state changes at runtime, a compile time check catches absolutely none of these, the interpreter checks the program while running. Maybe you get some benefit from the type information stepping trough the debugger, but I haven't found any real value in using typescript over plain clean JS.
@tnsaturday
@tnsaturday 7 ай бұрын
​@@PaulSpadeson point. It's not not having types that causes most of the bugs, it's mutability of the data.
@davedoublee-indiegamedev8633
@davedoublee-indiegamedev8633 3 ай бұрын
There is a lot of good advice here. However, I think he is going too deep into the "don't use it" approach. The reason arrow functions have an arrow is because of .map, it's where we use it the most. He is probably also in the minority against TS -- people use it and like it for good reason.
@daelous88
@daelous88 2 жыл бұрын
Javascript fit 😂😂
@shrimpoffthebarbie
@shrimpoffthebarbie Жыл бұрын
I don't know about that constructor thing.. Pretty ugly Doug. I think it's better to test than to start offering "safety" into your code explicitly.
@rrd_webmania
@rrd_webmania 2 ай бұрын
Danger Driven Development 😂
@a8lg6p
@a8lg6p 2 жыл бұрын
Crockford is definitely worth listening to, whether you agree with him or not, but... Come on. The guy writes "wun" instead of "one" and tries to argue that it's "objectively" better somehow. Gimme a break. I freely admit that my preferences are, at least in part, aesthetic and subjective. I don't think there's any way around that. He tries to argue that his opinions aren't just a matter of opinion... But he says the most important thing is reducing bugs. Fair enough. So if he can provide empirical evidence that each "wun" of his suggestions reduces the rate of bug creation, I'll have to concede that he is objectively correct. But I don't think he can do that.
@dan-kn3dm
@dan-kn3dm 6 ай бұрын
Not using `this` seems to me quite extreme. Sure, if you do FP you probably don't need it, but that's not for everyone and for every project. Not liking fat arrow fn just because of its looks is not a great argument. And if you are not a die hard FP fan, `class` is actually a very useful construct. So I am not sure a lot of the stuff that Douglas presented is anything more than his personal preference.
@PaulSebastianM
@PaulSebastianM 10 ай бұрын
the only thing I don't agree with is the anti-types stance 😢
@brackcarmony6385
@brackcarmony6385 2 жыл бұрын
This guy is insanely frustrating in his straw manning of people who like features that he doesn't find useful -_-
The Power of the Paradigm. Douglas Crockford. JS Fest 2018
1:03:26
code::dive 2017 - Douglas Crockford - The better parts
1:16:14
code::dive conference
Рет қаралды 18 М.
And what’s your age? 🥰 @karina-kola
00:12
Andrey Grechka
Рет қаралды 6 МЛН
The Next Programming Language - Douglas Crockford - code::dive 2022
52:34
code::dive conference
Рет қаралды 45 М.
Crockford on JavaScript - Act III: Function the Ultimate
1:13:29
YUI Library
Рет қаралды 180 М.
Douglas Crockford: The JSON Saga
49:26
YUI Library
Рет қаралды 71 М.
The Post JavaScript Apocalypse - Douglas Crockford
46:40
ConFoo Developer Conference
Рет қаралды 70 М.
The Next Programming Language by Douglas Crockford
31:49
Wey Wey Web
Рет қаралды 13 М.
Big Tech AI Is A Lie
16:56
Tina Huang
Рет қаралды 46 М.