"He experienced several crashes during his career and survived almost all of them"... no reaction.
@isaactuuri6488 Жыл бұрын
22:20 Regex, good info..
@shrimpoffthebarbie2 жыл бұрын
They can of course return objects. You just put a => ({a}) . Oh Doug. I bet you use them now don't you?
@nickmoore51055 жыл бұрын
Great talk, but that code font is making my eyes hurt
@shrimpoffthebarbie2 жыл бұрын
I'm on side with everything. But fat arrows I LOVE
11 ай бұрын
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).
@YASYTU3 жыл бұрын
"I hate sand, by the way" Darth Crockford confirmed?
@isaactuuri6488 Жыл бұрын
47:00 could this be said as advanced casting?
@AiwwwA3 жыл бұрын
Very nice insates, and good takeaways for me. Thank you :)
@mattmarkus48684 жыл бұрын
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?
@ropewalkingelephant4 жыл бұрын
He means only using default and not named exports
@alessandrob.g.45243 жыл бұрын
@@ropewalkingelephant Actually I think he means exporting one thing, regardless of it being a default or named export.
@mkohivlog8988 Жыл бұрын
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.
@vickmackey243 жыл бұрын
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.
@olamundo4634 жыл бұрын
Nice talk but heavy crowd..
@Brocklesna84 жыл бұрын
"when java guys get confused, thats trouble" :)
@eotfofiw27483 жыл бұрын
What font is being used here? I'm curious what it looks like when you're using capital L and lowercase L
@a8lg6p3 жыл бұрын
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.
@yankotliarov923910 ай бұрын
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.
@tobias-edwards2 жыл бұрын
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 Жыл бұрын
Elm is dead, 3 years gone still 0.19.something
@kebbotnet41704 жыл бұрын
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.
@a8lg6p3 жыл бұрын
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.
@mrbigberd2 жыл бұрын
This isn't currently possible because arrow functions don't instantiate variables/objects for `this` or `arguments.
@jsonkody3 жыл бұрын
Jar Jar is strongest sith in universe :D Good choice ;)
@Sindoku2 жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@PaulSpadeson point. It's not not having types that causes most of the bugs, it's mutability of the data.
@skryonline58254 жыл бұрын
People using "class" will go to their graves never knowing how miserable they were =)
@daelous883 жыл бұрын
But javascript now have private class.
@27sosite73 Жыл бұрын
@@daelous88
@davedoublee-indiegamedev863311 ай бұрын
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.
@a8lg6p3 жыл бұрын
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 Жыл бұрын
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.
@daelous883 жыл бұрын
Javascript fit 😂😂
@shrimpoffthebarbie2 жыл бұрын
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.
@brackcarmony63853 жыл бұрын
This guy is insanely frustrating in his straw manning of people who like features that he doesn't find useful -_-
@rrd_webmania10 ай бұрын
Danger Driven Development 😂
@PaulSebastianM Жыл бұрын
the only thing I don't agree with is the anti-types stance 😢