This is about JavaScript, clutter, purity, and thoughts on what should be in the language that comes after, assuming that we all live that long. ConFoo: confoo.ca
Пікірлер: 171
@kapral185 жыл бұрын
"The web is cluttered and full of errors" - Melisandre Crockford
@sieve57 жыл бұрын
From the standpoint of a senior in computer science in university, EVERYTHING THIS MAN IS SAYING MAKES SENSE!
@MichaelQuad7 жыл бұрын
no
@rodrigodrk17 жыл бұрын
Thank you for subtitles!!
@tormentoxx7 жыл бұрын
What a wonderful talk.
@evroza7 жыл бұрын
Awesome talk
@juancpgo6 жыл бұрын
I think names with spaces might make the code less readable, because a name will be spread out across the syntax instead of compacted. I think a name is a lexical token, so it makes sense that we should read it as a single chunk-that way we're making sense of the code in terms of its syntax. (Unless we're really talking about a totally new way of programming in which what I'm considering would become irrelevant.)
@MichaelQuad7 жыл бұрын
new language may reuse "use strict" to define more options. for example "use strict, es6, blockscope", it is simple and dont create "holywar" for imperative VS functional style. when you see "use strict" you have to comply to this or just choose alternative project. let the functionality battle the style, because the style battle alone will never end.
@KevinMcGinty7 жыл бұрын
All we really need is a new JS framework :D
@JBoku7 жыл бұрын
:D
@EnCey27 жыл бұрын
Ugh, all your frameworks are clearly inferior. I'll make a new one that does everything right and makes the others obsolete.
@chrisgodberartist7 жыл бұрын
There is only so much time to spend in this mortal realm. DAMN YOU!
@MichaelQuad7 жыл бұрын
do you have any ideas? let's build a ui-library with new tools
@valvlog46657 жыл бұрын
More JS frameworks are all we need to fix it. Suggestions welcome. #1 Splatto #2 Wodo (World of data objects) #3 ZeusOs #4 Kirk (the final framework)
@vdoland32165 жыл бұрын
wow everything he said make sense!! - lopoking forward to the next whatever language - clojure lol
@quintencabo Жыл бұрын
Also you could make the null object thing with a proxy right?
@fardelian2 жыл бұрын
I have scheduled meetings to decide whether a parameter should be in the headers, the URL, the query string, or the request body. Please send help!
@Sindoku Жыл бұрын
I love the Pied Piper shirt!
@MarkEntingh7 жыл бұрын
We should get rid of the double-quote because I rarely use single-quotes inside javascript strings, but I definitely use double-quotes for things like HTML attribute values & other programming-related things. I always use single-quotes to wrap around my strings for various reasons.
@DriveandThrive2 жыл бұрын
Not a good idea. Single and doubles are sometimes interchangeable but they can signify differences as well in certain situations.
@younghoseo17826 жыл бұрын
I'm not so sure if this guy was talking about tab key or the tab used in programmimg, but I always use tab key whenever I write an essay. It's used for indentation
@rolfnoduk6 жыл бұрын
Youngho Seo the tab character, specifically ascii
@fennecbesixdouze1794 Жыл бұрын
Names with spaces would not be good. Imagine a language where you have nicely expressive syntax using things like "... if ... else ..." ternary operators or Python-like boolean conjunctions etc. If you have spaces available for names you could easily want to write out exactly that expression for your name. Now suppose later you use that same expression. The algorithm he proposed will use that as an identifier because you've assigned to that name. For example: ``` from my functions import fun1, fun2, fun3, do something to from my favorite constants import a1, a2, a3, a4 x = fun1(a1) y = fun2(a2) x or y = x or y do something to(x or y) fun3(x or y) x = fun1(a3) y = fun2(a4) fun3(x or y) ``` The final use of "x or y" will be interpreted as the name in the block above rather than as the or of the new x and y. The main problem is that if you say the compiler gets to figure out what the longest string that makes sense as an identifier is, it introduces really bad non-locality issues. I have to keep in my head the entire source code so I can remember all the possible identifiers at any point in the program to be sure that some syntactic expression I'm writing wasn't used as an identifier previously. Good programming languages need good locality. I want a language where I can look at a single line of code: `x or y` and I can be certain what it is: x is an identifier, y is an identifier, and this is the result of using the or operator between x and y. I might not know what x or y are, but I know what this line of code is doing. If identifiers can have spaces, then I will no longer be able to figure out what this line of code is in isolation.
@raul.mihaila7 жыл бұрын
Actually it is possible to create a Null object in ES6 such that if you try to access a property you get the Null object itself: const Null = new Proxy( Object.freeze(Object.create(null)), { get() { return Null; } } ); Null.x.g.w === Null;
@madarivi7 жыл бұрын
Oke but what does this returned null now return when you access it :)?
@raul.mihaila7 жыл бұрын
I'm afraid I don't understand your question. Have some code to show?
@trummelbach60656 жыл бұрын
+Marius van Eck It does not return null. It returns the const Null.
@chrisgodberartist7 жыл бұрын
HAHAHA that Silicone Valley scene was the funniest thing of all time haha!
@bruslag2 жыл бұрын
Tab is very important to systems with Hebrew, Couse yoo can mix sentences which have both Hebrew and English words
@IronCandyNotes6 жыл бұрын
1 tab = 4 spaces (tab-to-space enabled) First law of pythoning
@theshermantanker70433 жыл бұрын
You can also used brackets in python I think, it compiles to the same thing (Python compiles to opcode for the interpreter)
@IronCandyNotes3 жыл бұрын
@@theshermantanker7043 You can use semicolons too and write most stuff on a single line but you better have an exit plan for when people find out
@MarcusHammarberg5 жыл бұрын
That guy on the poster... I think it got me about 20 times during the prezi... "Oh, two presenters now?" No... not this time either
@DarrinCullop4 жыл бұрын
It's not a poster. He's helping hold him up. He'd fall right over if that guy wasn't there.
@DriveandThrive2 жыл бұрын
Tabs are a gift from god. Whoever invented it should be mentioned alongside Edison and the Wright Brothers
@quintencabo Жыл бұрын
Tab reduces file size though
@chetansanghani62847 жыл бұрын
Is that a pied piper shirt?
@solid84036 жыл бұрын
yup
@newyorker66694 жыл бұрын
It’s awesome lol I’m glad more of us programmers can get a kick out of that show lmao
@SamuelKarani4 жыл бұрын
anyone else like the idea of pre/post contracts for functions?
@wilsongaturu1345 жыл бұрын
17:36 I thought Object.assign returns a new object and doesn't mutate the original object?
@paschalobba40014 жыл бұрын
It doesn't deep copy.
@b43xoit10 ай бұрын
It takes two arrrrrrrrrrrghuments and mutates the object pointed to by one of them.
@coolworx4 жыл бұрын
Post = Add a new document Put = Replace an existing document Patch = Edit an existing document.
@b43xoit10 ай бұрын
JS has not only `null` and `undefined` but furthermore `false` and `NaN`. Lisp just had NIL.
@captmcneil7 жыл бұрын
I always thought single quotes in JS made sense because you write the occasional html or xml, and you don't have to escape the attribute double quotes in them. I can't remember last time I had to escape an apostrophe. Pick one and go with it. When in doubt, do what the libraries you use do (well, except for the crappy ones like bootstrap). I don't really care about tabs vs spaces or curly bracket positioning either, I just want everyone in a company to be forced to do it the same way.
@davedoublee-indiegamedev8633 Жыл бұрын
Nowaways just use backticks for JS.
@911madza5 жыл бұрын
the title should be "how long will it take for WA to take over?"
@45mitul7 жыл бұрын
Is there a transcript I can read?
@thecoug367 жыл бұрын
kzbin.infotimedtext?v=NPB34lDZj3E&lang=en
@thecoug367 жыл бұрын
There's also a "Transcript" link under "More" on the desktop site
@45mitul7 жыл бұрын
Thank you!
@IWD40I3 жыл бұрын
Tokimeku desu ka?
@RADIOSCATRACHASUTAN6 жыл бұрын
I dunno, singles quotes looks better en javascript code, double serves better in htm markup.
@yiwanzhou89277 жыл бұрын
He wear "Pied Piper" T-shirt :)
@brunolm77 жыл бұрын
I don't like the proposed syntax and the names with spaces thing. I like the way JavaScript is moving. I do agree with other things like spaces over tabs, pure functions, ...
@ryan.winchester7 жыл бұрын
this is why i like functional languages. i liked most things he said except for the names with spaces. underscore all the way 😆
@jernejsila7 жыл бұрын
Pied Piper T-Shirt! :D
@chrisgodberartist7 жыл бұрын
Tabs!!! (Falls down stairs)
@DriveandThrive2 жыл бұрын
Space 4x space 4x space 4x...an apocalypse indeed
@danh56374 жыл бұрын
Web assembly. I don’t know why people in JS don’t see what’s going to finish them.
@KerryOConnor14 жыл бұрын
I dont think the demographics of worldwide js devs and future C family web devs overlap very much though ppl use js largely because it's easy, not because it's powerful
@ToddPressleyy3 жыл бұрын
Wat? If you feel so strongly, please elaborate... Taken straight from webassembly.org: "Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications." The important bit being "compilation *target*" as opposed to "Javascript (or any other language, for that matter) replacement." Also, "people in JS" is, what, like 99.9% of people entering/operating within our field? Not defending javascript, just skeptical of (yet curious about) your point.
@theshermantanker70433 жыл бұрын
Not sure why PHP isn't used on front ends either, the Zend Engine isn't difficult to embed and now even has a JIT Compiler
@vedmarth5 жыл бұрын
Idea about variables with spaces is terrible, the code will be not readable, for machine it's ok, but when you read a sentence variable then function call, then some comparison, that will be a joke: some slaves list[what slave is today + maybe some other slave].get me some beer().then(maybe a beer => beer checker.is this a beer(maybe a beer) ? personally me.drink beer and enjoy(maybe a beer) : personally me.shout on the slave(some slaves list[what slave is today + maybe some other slave]))
@Unitazy7 жыл бұрын
LOL @ T-shirt
@saysthetedd6 жыл бұрын
So for the first 20 mins he basically just describes Elm?
@markomacek9207 жыл бұрын
Apple better not remove Tab key after Escape... anyway, standard tab size = 8 (I use spaces).
@FezVrasta37 жыл бұрын
You meant 2*
@chimmihc12987 жыл бұрын
I think you actually meant 3
@knottheoffice7 жыл бұрын
Hey didn't say get rid of tab key, he said get rid of tab character. Tab key would still do whatever you configured your editor to do with it.
@smarthouse-learnprogrammin43097 жыл бұрын
Removing clutter - is the most important way to improve your coding style. And yes, JavaScript is not this easy to clean up. Ruby - is what we all need to look up to.
@theshermantanker70433 жыл бұрын
Rust too EDIT: Ruby is the only modern language today still using an interpreter without an Intermediate Representation
@DriveandThrive2 жыл бұрын
Null and undefined are not the same. My turn to be pedantic. They provide specific information that a generic bottom value wouldn't and it is helpful information so I must disagree
@DenisKanchev7 жыл бұрын
Perl 6
@MarkEntingh7 жыл бұрын
That photo of the guy with the tight pants in that poster behind the speaker is extremely annoying & distracting & offensive haha
@wookidoo6 жыл бұрын
Feels like I'm wearing nothing at all, nothing at all, nothing at all...
@raashidkhan12 жыл бұрын
@anupam kher’s doppelgänger
@hybrisCole7 жыл бұрын
rust
@llIllIlI4 жыл бұрын
// V.A.R. var varEquals = 'View Angular React';
@133289ify7 жыл бұрын
WTF what if I want include " to my string!
@ryan.winchester7 жыл бұрын
@45:28 re: distribution -- ever hear of erlang or elixir?
@bcassol7 жыл бұрын
erlang is king. Go takes a different approach and is nice too.
@robertzeurunkl84015 жыл бұрын
I don't believe in getting rid of things just because they are not "pure". Date() is a useful function. It's not *meant* to be "pure". I don't care if it is pure. I want the date, not "purity". Same with several others of these objects/functions.
@diegocfq2 жыл бұрын
Did you watch the whole thing? Because it seems you didn't get the joke (not even when he mentioned: get rid of users)
@vdoland32165 жыл бұрын
perhap clojurescript
@rja4217 жыл бұрын
I am going to form the Tabilan to root out these space key worshippers.
@TheNewton5 жыл бұрын
Tabs are just wannabe spaces, allahu aspacekeybar
@bavariantrawler5 жыл бұрын
Boo on getting rid of tabs.
@bloodandbonezzz5 жыл бұрын
If only Go Lang had a DOM manipulation, it would have been the perfect replacement for javascript.
@JoseNavas6 жыл бұрын
minute 27:44 haha
@alexweej7 жыл бұрын
whoops, ligatures :)
@subvind4 жыл бұрын
The Channel JavaScript Apocalypse
@tanotoscano75797 жыл бұрын
Clojure stack is a viable option in the post javascript apocalypse, it covers most of the points discussed in the talk
@vinapocalypse4 жыл бұрын
I think this video is interesting but suffers from "Whoever does not understand LISP, is doomed to reinvent it" which not Greenspun 10th rule of programming but it could a corollary to it
@MarghoobSuleman6 жыл бұрын
Why are we discussing this?
@amatiasq7 жыл бұрын
As always Chrockford drops some good ideas and tries to mix his personal opinions inside.
@tormentoxx7 жыл бұрын
He justified his "personal opinions", so it's not just saying "this should be this way just because I like it". That's how it works.
@andurilan7 жыл бұрын
BS. The core of most of his justification in all his videos, not this just this one is, "because". Go back and look and all of his talks. He is almost always on the wrong side of history when it comes to ECS/JS. Classes in ES6/7 show this, Async/wait proposals show this, and I could go on and on.
@onlybrad84346 жыл бұрын
actually 0^0 = 1. So saying 0^n = 0 is not true
@onlybrad84346 жыл бұрын
dafuk are you smoking ?
@SimonBuchanNz4 жыл бұрын
A bit late a reply, but actually no: 0**0 is undefined, like 0/0. 0**n = 0, but n**0 = 1 and you can get to literally any other number you want too.
@DriveandThrive2 жыл бұрын
Let vs var sure but again having both serves a purpose in niche situations where you might want the global scope. Just leave everything alone. Coders are used to being pedantic but don't let that harm the tools we use.
@davedoublee-indiegamedev8633 Жыл бұрын
Nah, var was a mistake. We should just never use var; there's never a situation in which you want to use var and can't do it somehow else.
@cdiddy42427 жыл бұрын
Totally disagree about getting rid of tab. Tab reduces key strokes thus more efficient thus bringing me more delight. Aka meets the criteria and the debate rages till the end of time.
@MichaelQuad7 жыл бұрын
it doesnt matter, really. text editor handles number of key presses
@onlyafriend6 жыл бұрын
tab is alt method, use webstorm you wont need use key strokes
@szymontoda31556 жыл бұрын
map tab to 4 spaces so 1 action one keypress. But navigating thru 4 spaces with arrow keys is different story. Just use .editorconfig...
@JeremyAndersonBoise6 жыл бұрын
Chris Salvi not the tab key, the tab character. Totally different things.
@llothar687 жыл бұрын
The only solution is to push webassembly to Apple and MS and make other languages available in the browser. I would love to get a frontrow seat on the Javascript apocalypse
@fer86bd4 жыл бұрын
Please make a conference in getting rid on non international unit sistem units. They are never 10based, they never even fit between each other in integers! jajajajajajajaja
@artgreg22964 жыл бұрын
wasm wasi rust
@tomaskraus474 жыл бұрын
The TAB key on keyboard is very useful. The TAB character in a character set is pure evil...
@winfjacobs6 жыл бұрын
Douglas Crockford is the Louis CK of software development.
@tormentoxx7 жыл бұрын
Why the fuck would you downvote this talk? I don't understand people.
@soozler6 жыл бұрын
I like watching his talks, but he is kind of an ass.
@DominicVictoria4 жыл бұрын
Me ~ Languages aren't the problem. It's people that uses it. It goes in couple of ways. If it's the proper language for the job and you're having a hard time fixing its code. It's the people that wrote it. If the language is inappropriate for the use, it's the people who used it. Edit- If the language sucks... it's just the language's fault. Jk, it's the f people who wrote it.
@IanBussAudio3 жыл бұрын
unamused.gif
@robertzeurunkl84015 жыл бұрын
I used to respect Doug. But now I hate him. LONG LIVE TABS!!!!! But, seriously, I don't want to you to hit return, and then 4 space bars, or 8 or 12 spaces to get the next indent right on every single line.
@InfiniteRain_4 жыл бұрын
Do you program in MS notepad? All the modern code editors have a functionality that would insert 4 spaces when you press a tab. Shift+Tab will remove 4 spaces. This is such a non-argument, Jesus Christ.
@chrisgodberartist7 жыл бұрын
Goodnight off to go watch Programming is Terrible :/
@rowdyghatkar4 жыл бұрын
I never knew that Anupam Kher is an expert in JS...
@konung56 жыл бұрын
So use Elm basically ... You are welcome. I just saved you 45 minutes of your life
@derekfrost89916 жыл бұрын
I use zenlisp for personal use, it's a pure dialect of scheme. No-one would use that in production, but what about a functional scheme with a ref, like in sml? Until that happens I agree, Elm is the best I've seen, tho I'm not very good at it.. :)
@mrbigberd5 жыл бұрын
More like SML than Elm. General purpose side effects and optional, structured mutation means SML can scale both lower and higher than Elm and can adopt additional paradigms easier if needed.
@ilovecomputers7 жыл бұрын
Let me play devil's advocate and repeat what another tab supporter told me: "a tab is only one character, so less wasted bytes in the code, and it can be rendered however anyone likes. People who like the wide open spaces use 8, others like the compactness of 2." Also, if we're going with the logic of what we _can't_ live without, then we should get rid of double quote instead of single quote because a double quote is made up of multiple single quotes in the same way a tab is made up of multiple spaces.
@MateMagyarM7 жыл бұрын
You can't get rid of spaces, that's the problem, and for quotes, in English, single ones are not ideal. The idea is to just keep one. In 2017 everyone should use autoformatting, and it the fact which character is used for indentation should be transparent to the programmer. I also mostly work on a code base that uses tabs, but when you say you can change the tab size, you are kidding yourself, especially in a large codebase , with a lot of people, indentation is often extended with spaces, which completely brakes if you set tab sizes anything other then 4.
@starflow902107 жыл бұрын
cuz we're still in the 80's and have to care about bytesize of code and minifiers weren't invented
@EnCey27 жыл бұрын
Darn, if only our IDEs had parsers that understood language syntax and could render a single space as being 2, 4 or 8 wide depending on user preference, so that it effectively behaves like a tab when used in certain language-specific positions of a program.
@chrisgodberartist7 жыл бұрын
Javascript Christ who cares. Write it clean and efficient. That's my aim, this kind of "Anal retentive" approach to coding sure kills it for guys like me who've always tried to approach it from a creative angle. At the end of the day who actually gives a fuck about this? My approach has always been break the motherfucker till it does something interesting.
@andurilan7 жыл бұрын
Clearly at least 50% of people. :) Your clean code is another coders nightmare when your 6ft deep.
@justfly19847 жыл бұрын
I vote for 2 spaces instead of tab!
@kavishdahekar7 жыл бұрын
4 spaces FTW.
@cdiddy42427 жыл бұрын
or you can realize every modern text editor can configure a tab to be two spaces...
@chrisgodberartist7 жыл бұрын
Two Keyboards, two arms. Multi-task.
@chrisgodberartist7 жыл бұрын
Tabs.
@Sindoku Жыл бұрын
Disagree. Tabs do spark joy!
@michaellee35026 жыл бұрын
The obvious next best step is Typescript!
@alexk67455 жыл бұрын
I think we should get rid of Javascript and replace it with F#. BTW, this is already possible to avoid Javascript and use Blazor. I would not say that I hate Javascript, but no spark of joy. With F# completely different story
@Dragiux7 жыл бұрын
how about getting rid of javascript instead
@DavidWMiller7 жыл бұрын
Instead of what'? That's the point. This couldn't be a revision of javascript, too many backwards incompatibilities. It would be a revised new language based on js without the issues.
@superb72087 жыл бұрын
The language he's proposing is hardly based on javascript. Most of the suggestions had nothing to do with javascript at all.
@BoTuLoX7 жыл бұрын
There's already this language. It's called Elm. It solves JavaScript. And it solves React. And Redux. All at once in a simple language.
@pablobarriaurenda78087 жыл бұрын
why would you do that?
@MichaelQuad7 жыл бұрын
does it solves "separation of concerns"?
@133289ify7 жыл бұрын
Whatever! This guy is a troll. At least he's right about null
@ReinPetersen6 жыл бұрын
Douglas, POST PUT and PATCH are not clutter - they have important distinctions that should not be tossed away.
@133289ify7 жыл бұрын
This guy misses the whole point of Tab.
@kolyxix5 жыл бұрын
I say we get rid off those pathetic frameworks and keep react and nodejs. If you can accomplish cool UI in react why tha hell do you need Anguluar js or vue js, backbone.js, ember.js, electron.js. And offcourse there are so-called tooling like wepback, npm, gulp, and babel. Just stick with to react, node, npm, and babel. keep it simple, make FONT END FUN AGAIN. All these flavor of the month front-end frame work is destroying front-end.