The Post JavaScript Apocalypse - Douglas Crockford

  Рет қаралды 116,005

NDC Conferences

NDC Conferences

Күн бұрын

This talk speculates about the next language after JavaScript, and what to do in the mean time about some of the new features in ES6.
There will be an emphasis on simplicity and quality. The web is cluttered and full of errors. The talk will also touches on why you should subscribe to HBO.
NDC Conferences
ndc-london.com
ndcconferences.com

Пікірлер: 524
@Sudhang
@Sudhang 5 жыл бұрын
If I ever have to read code where someone used "if" as a variable, I'll get violent
@miningape
@miningape 4 жыл бұрын
Hahaha, i did this once while developing a compiler
@jeyemGFX
@jeyemGFX 4 жыл бұрын
Looking at you, dd!
@erwinkonopka7071
@erwinkonopka7071 4 жыл бұрын
OH BOY! Good thing that you never had to code in MUMPS.
@damienivan8946
@damienivan8946 4 жыл бұрын
Sorry, I couldn't read your comment. I wasn't sure what the value of the 'if' variable was.
@wallyhackenslacker
@wallyhackenslacker 2 жыл бұрын
How about the C language "this is my last day on the job" surprise commit special? #define if(X) #define for(X) #define while(X)
@MrSaemichlaus
@MrSaemichlaus 4 жыл бұрын
The dec64 number type idea is symbolic for how we're nowadays able to throw more memory space at a problem to make it easier and more predictable. Great stuff Douglas!
@uemusicman
@uemusicman 2 жыл бұрын
I'm a big fan of using arbitrary precision numbers for user-facing purposes and only giving access to things like Int32, double, etc. if the developer specifically asks for them for a particular purpose. While I would prefer BigDecimals to dec64, I still thought that was a good idea on his part.
@angryvix
@angryvix 6 жыл бұрын
"names with spaces" Ok, i'm calling the police
@vpetevotov
@vpetevotov 6 жыл бұрын
Juan Story 😂
@shaunpatrick8345
@shaunpatrick8345 6 жыл бұрын
thePolice
@dialatedmcd
@dialatedmcd 5 жыл бұрын
erm... the_police
@FindecanorNotGmail
@FindecanorNotGmail 5 жыл бұрын
You forgot ()
@dialatedmcd
@dialatedmcd 5 жыл бұрын
are the police a function?
@montrazvan89
@montrazvan89 4 жыл бұрын
the main takeaway for me after listening to the whole presentation, and also looking through the comments bellow, is that there are different opinions about current and future programming languages. I personally still consider programming practices more important than a language itself.
@montrazvan89
@montrazvan89 4 жыл бұрын
also, someone who praises a HBO TV show is not my kind of technical speaker
@mustafaazyoksul1372
@mustafaazyoksul1372 2 жыл бұрын
A good PL sets you up for good practices.
@MrTridac
@MrTridac 2 жыл бұрын
@@mustafaazyoksul1372 That's not a good attitude. Good practices should be your own personal ambition. No matter what language you work with.
@mustafaazyoksul1372
@mustafaazyoksul1372 2 жыл бұрын
@@MrTridac You are right. It is also true that when a PL is designed right, it enables the developer to employ these practices more easily. For example, in Kotlin the classes are selaed by default. This increases the clarity inside the code and makes the developer more aware of their programming choices. Even if someone is a great programmer, I bet they cannot say that they make all classes that shouldn't be inherited sealed manually.
@tomcleaveland4325
@tomcleaveland4325 2 жыл бұрын
@@mustafaazyoksul1372 Completely agree, although one should differentiate between good design practice (high coherence/low coupling) vs. good implementation practice which very much depends on the choice of language. As an extreme example consider MUMPS, which is used quite a bit in health care and (I believe) financial services development. The classic version of the language supports only global variables and has no reserved words, so good practice includes EXTREMELY careful variable naming, and documenting names & function in dictionaries. Good practice in C can include always assigning values to variables in standalone statements to avoid the = vs. == error and always adding an extra zero value element to the end of character arrays to minimize buffer overruns/out of bounds errors. And good practice in PHP5 can include using Python instead. :)
@OliverClark-nyc
@OliverClark-nyc 7 жыл бұрын
linguistics + computer science + programming history.... wanted to click away but keep learning/thinking ... nice job... thank you
@eisenivan
@eisenivan 6 жыл бұрын
Is "the web is cluttered and full of errors" a play on "the night is dark and full or terrors"?
@CharmedQuarkSystems
@CharmedQuarkSystems 6 жыл бұрын
The huge advantage of having two types of quotes is that it can, in some cases, get you out of a HUGE amount of quote escaping if you are generating quoted content programmatically. That's a somewhat special case and maybe not sufficient, but I sure find myself doing a lot of that.
@throwback74
@throwback74 5 жыл бұрын
I was thinking the same thing, though I guess you can get around that using tic marks and writing in template literal instead
@SimGunther
@SimGunther 5 жыл бұрын
@@throwback74 +1 on the back quote suggestion
@karaloop9544
@karaloop9544 2 жыл бұрын
Or you do it like Perl and Perl6 where you can use a range of quote characters depending on the text you want to hold in between. |, !, , $, [], {} and some fancy unicode ones... you name it. Plus the distinction between interpolating strings "$var" and non-interpolating '$var' is handy as well.
@fixups6536
@fixups6536 3 жыл бұрын
It's a very interesting talk. It does not matter that some ideas sound a little extreme or not feasible. The simple act of questioning certain concepts, like the universal "no space in a variable name", forces you to see beyond the consensus, and think about what could be. And then you can decide to keep on doing things the way you have always done, or to push for a better future. The funny thing is that I had already thought about allowing spaces in variable names a few years ago, found out that it was actually possible, and mostly decided against it eventually. But the thought process was really interesting and it was worth a try. There are several good ideas in this talk, and the one that strikes me as the most interesting is to allow, in a new programming language, to redefine any keyword. No, I don't want to redefine "if" or "while". I would be OK if it was forbidden to redefine these and a few others. But, as the speaker explains, this has one major advantage (he mentions two, but I don't care much about the other one): Imagine that a first version of the language does not provide a "decimal" type (a type that would be a very good fit to store monetary amounts, C# provides one). Imagine I have written a program in which I happen to have defined a variable that is called "decimal", which is perfectly legal at this point. For example: bool decimal = false; (I'm loosely using a C/C#/Java syntax in my examples) Then a new version of the language is released, but now they have added the "decimal" type in it. Suddenly, my program has become illegal, and won't even compile, because of my "decimal" variable declaration. I'm not alone: around the world, countless programs have been broken by this change. This does not happen if the language keywords can be redefined. My "decimal" variable declaration is still legal, and inside the scope this declaration is valid, "decimal" refers to my variable, not to the new type. A new keyword is introduced in the language, and no program breaks. How comes this is not the norm? In case you are objecting, here are a few thoughts: - "I don't want people to redefine IF!" -> You are right. Let's say it's forbidden to redefine any keyword that exist in the first version of the language, but let's guarantee that it will be allowed to redefine any NEW keyword. - "I don't want people to redefine operators because it's confusing!" -> We are not talking about operators, we are talking about your types, classes, variables and functions names. We are talking about words. - "This does not prevent some poorly design changes in the language to render some programs illegal!" -> You are right. But at least it will be possible to introduce a "decimal" type, instead of having to call it "@decimal" (as the Objective-C designers had to do with new keywords) or to have to use a very unlikely name, like "newdecimaltype". - "There may be parts of the program where decimal doesn't mean what I think" -> It's already the case. You can define a "decimal" variable as an int in one function, and as a float in another one. It's already something we have to deal with anyway, and our editors help by allowing to jump to the definition of any symbol if we need to check. If you can't stand it, you can refactor the program (rename the variable), but the program will not have to wait for you to do it. It will work even if you don't refactor it.
@a4d9
@a4d9 10 ай бұрын
Don't you remember all the bad things that were written about "undefined" being mutable in pre-ES5 JavaScript?
@xcoder1122
@xcoder1122 2 жыл бұрын
The concept of getting anything of null is null does exist, that's how Objective-C works. In Obj-C it is called nil and you can call methods on nil. Calling a method on nil does nothing. And if that method returns a value, it is nil again (unless it is a native C type, in which case it is 0 or 0.0 or false or a struct consisting out of memory with all bytes being zero). And as properties are also methods (you access them with getter/setter methods the compiler generates for you), storing to nil has no effect and reading form nil is nil (or 0, false, etc). And guess what? This has already caused far more bugs than null pointers because if something is nil when it shouldn't, you will not notice it. The debugger won't complain, the app won't crash but it may malfunction and you won't know why. Typical problem: You forgot to initialize a property or instance variable in an initialize, so it becomes nil by default. E.g. you forget to create an array, then you keep adding element to it (so you add elements to nil, nothing happens) and then you ask the array how many elements it has and you always get zero as result. In a C program, adding elements to NULL crashes at once, figuring out the count crashes at once and you will quickly spot the mistake and fix it during testing. Obj-C developers were so glad when Apple when Apple introduced Swift and Swift did not inherit that behavior of Obj-C.
@shaunpatrick8345
@shaunpatrick8345 6 жыл бұрын
Both of those quoted string literals can go, because we have backticks.
@ehsnils
@ehsnils 3 жыл бұрын
Or the German way of quoting?
@skudge
@skudge 5 жыл бұрын
It sounds to me like a lot of features he's suggesting for the "next language" are already resolved with most any Lisp or Scheme dialect.
@AlexEscalante
@AlexEscalante 6 жыл бұрын
Very good ideas. Made me remember Eiffel as a nice but unsuccessful language which inherited the "contract by design" features from Ada.
@CTimmerman
@CTimmerman 6 жыл бұрын
8:20 One way you say? Brainfuck is even more that than Python. Tabs spark my joy as it gets rid of the indentation war (2 spaces, 3 spaces, 4 spaces, 8?!).
@GameFuMaster
@GameFuMaster 4 жыл бұрын
yep. When you have spaces, it's typically 2 spaces vs 4. With tabs, no one ever argues for 2 tabs unless they're an idiot or trolling.
@hrmIwonder
@hrmIwonder 6 жыл бұрын
"The web is cluttered and full of errors." --I love the word play there! great game of thrones pun
@immortalsofar5314
@immortalsofar5314 6 жыл бұрын
What a strange lecture. A bizarre combination of good ideas and such ridiculously out-there ideas that they are indistinguishable from his own parody.
@garetclaborn
@garetclaborn 6 жыл бұрын
it's actually just an experiment in Poe's law, testing how gullible and easily sensationalized coders are. note: very much so.
@brixomatic
@brixomatic 6 жыл бұрын
Pretty much what I thought. Some Ideas I like, some I dislike. Design By Contract is dead for a reason. It's repetitive and the contracts can be complex to the extend of ruining the program (e.g. a contract on a binary search would need to say the array has to be sorted, but testing the contract would make the O(log N) binary search function a O(n) function) and DBC only really makes sense if it's "always on", otherwise they're like using a condom with a big hole in it. Java's assert statements are rarely used for the same reasons, they're "validateable comments" at best. After "overusing" them on purpose for some time, I fell back to just using them as hints for a compiler's null-analysis or reminders. Unit tests and integration tests have won. Naming with spaces makes it hard to read a program, especially if the language allows you express function calls on objects/classes/variables with spaces too (like Scala does it). The idea of if/fi sucks aswell. It's like if/endif, looks like shit, especially for one-liners, and you've got two words to mark the same block. You could do it like HTML and have an "if" start the block and an "/if" to end the block, a "while" to start it and a "/while" to end it instantly recognizable, but then it's tedious typing and clutter the source code, texts for making blocks don't mix well with names for functions. Curly braces do that better. I also don't like the python approach of having your layout dictate your program flow. White space is good for making code look good, but not good for deciding what code to run. We've got autoformatters to enforce company policies on formatting and the possibility to switch it off for those few lines of code where the autoformatter does not create a good result. Problem: Solved. Doesn't need a fix. not availably in a simple text editor, use a proper tool for the job, I'd say. His division by zero stuff I find outrageous. Seymour Cray might have been a genius at getting speed using simple ideas, but the world has not stood still, for most applications nowadays the speed gain you'd get is neglegible for a user, but finding bugs is more important. the simple matter of fact is: No one divides by zero on purpose. And it's easier to track down a division by zero error or gracefully raising attention by showing unexpected "NaN"s, than to guess what's gone wrong, if somewhere an otherwise legal result, like "2" or "0" had gone through the processing pipeline. This is one of the worst bugs to track down, and he directly contradicts his earlier claim about the "-1" as a "no result" for a search result. Raising an Exception might be too hard, no search result is a pretty common use case. In the language Java, that he seems to hate with a passion, the Optional monad, as known from Scala has shown to be a good way to handle this situation. But then he's right on the overflow-problem with integer types. And he's hit the nail on the head with the floating point numbers, they are a real pain in the arse. And he's spot on with the tabs vs spaces debate. And I think he's also not wrong on the "if condition {operation}" syntax, though I don't mind the round braces around the condition.
@sdwone
@sdwone 5 жыл бұрын
Yeah I have to concur!!! I have a huge amount of respect for Mr Crockford but, some of his ideas are just plain NUTS!!! I kinda get the feeling that he's promoting some of his ideas to make it easier for weak or average developers to write code... Coding is, and probably will always be a tricky subject to master... Just like other tough subjects... Such as Mathematics, Physics and Genetics but, dumbing down such subjects just to make it easier for the average person to comprehend is NOT the way to go! Especially when, as our as knowledge on such subject matters grows, so will the complexity. The answer is of course "simple"... We need better educational institutions to better equip the future citizens of tomorrow, which will empower them to tackle the increasing levels of complexities that will inevitably arise as our civilisations evolve. The very survival of our species necessitates that we should be embracing, and taming impeding complexity... Not running away from it or dumbing it down! I'm all for improving computer languages, which will allow us to get more done with lessening effort but, overturning decades of incremental development in such languages, in such a drastic and, in some cases, "alien" way (Seriously? Variable names with spaces?! Seriously?!!!) is simply a step too far! What's next? "Writing" computer programs by verbally dictating them to a machine?! Well, should such a day ever arise then, as Iain Banks depicted in his novels, we should simply let the machines run everything and give up thinking altogether!!!
@GameFuMaster
@GameFuMaster 4 жыл бұрын
@@brixomatic Removing tabs is like saying we should all program in only one language. There's arguments for four spaces vs two spaces. There's no arguments over one tabs or two tabs, because a tab can be however many "spaces" you want to see it as.
@garetclaborn
@garetclaborn 4 жыл бұрын
@@magicpixeltree your response suggest you may be unfamiliar with Poe's law
@davidconnelly
@davidconnelly 6 жыл бұрын
Real intellects are obsessed with language and semantics. This guy is a borderline genius.
@debasishraychawdhuri
@debasishraychawdhuri 3 жыл бұрын
I did that exercise and at some point picked up my past tax returns. "Does these things spark joy?", "No...". But I still kept them.
@FPRobber
@FPRobber 4 жыл бұрын
That example about the old mainframe doing 0/0=2 scared me. I've ran into so many cases where I had a bug in my code which caused a division by zero which I would have never noticed (at least not as quickly) if it had done that. What happened to fail fast?
@scottdrake5159
@scottdrake5159 2 жыл бұрын
Still a great talk after all these years.
@namelastname4077
@namelastname4077 6 жыл бұрын
+1 for not making the mandatory show-of-hands about programming
@tommessig2060
@tommessig2060 6 жыл бұрын
Very inspiring talk, I've got to do more functional programming in C#.
@LisandroLorea
@LisandroLorea 2 жыл бұрын
I've been using gdscript(similar to python) for some years now and I've used javascript and other languages with C-style syntax and at first the lack of parenthesis, braces and semicolons almost gave me anxiety but now that I'm used to it I'd never go back. You don't need "fi" you just need meaningful indentation and that's it. Regarding spaces in identifiers I'd like to see some code examples cause I don't think it'll be more readable and it could lead to errors. You miss a comma and if you're unlucky your array has one fewer element and one wrong element. I think Crockford has good ideas overall but I think we must ask for empiric proof like every other respectable science.
@____uncompetative
@____uncompetative Жыл бұрын
Name with spaces and issues if this includes keywords or anything where namespace collision occurs = 1; QED
@pepper669
@pepper669 6 жыл бұрын
Brilliant, as usuaI. I like my tabs and my single quotes though. Speaking of security, I like the concept of tainted variables in PERL.
@FindecanorNotGmail
@FindecanorNotGmail 5 жыл бұрын
4:26 Would not "Does this _resonate_ with you" be a better translation?
@Disthron
@Disthron 4 жыл бұрын
5:00 Another issue here is that, unlike your own personal space, which is just for you, a programing language is being used by many people and what 'sparks joy' for one person might not do the same for others. This is a common problem when designing things. People from different backgrounds often have different lines of thought on things.
@CafecitoConLeche
@CafecitoConLeche 6 жыл бұрын
If I understand generators correctly, they are the equivalent of the IEnumerable interface combined with the yield keyword in C#. They are not as easily replaceable as discussed because they do much more than simply traversing an array. There is quite some compiler/interpreter magic behind the yield keyword than can't be simply dismissed like this.
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
oh, good. Magic. I hope the next legacy code base that I pick up has a whole bunch of "magic", that will surely increase the number of hours that I get to bill rewriting it in a sane way or indeed even getting it to run at all
@ScarfmonsterWR
@ScarfmonsterWR 2 жыл бұрын
Traversing an array was just a simple example in the presentation. At their core, generators are just stateful functions. Some languages then allow to treat such generator as you would any enumerable type.
@krux02
@krux02 6 жыл бұрын
Java can catch "Throwable", int32 + int32 can be secretly wrong in Java, but that is not the fault of the type system but of Java but of how Java is implemented. Programmers should know about IEEE floating point numbers, they behave the same everywhere, no matter the language and that is good. Also one number type fits everything just is not true, there is a reasone for types with fewer bytes. Other than that good presentation.
@garetclaborn
@garetclaborn 6 жыл бұрын
well of course it can be wrong, every java program is wrong. ;)
@alexchandel
@alexchandel Жыл бұрын
His point is “number” doesn’t have to be an IEEE float. It can be something simpler and better designed. And it’s the fault of the system when result types don’t have intuitive semantics. Look at languages that transparently upgrade the number type when it would overflow.
@gravisan
@gravisan 7 жыл бұрын
The try-catch example is a little contrived, in java you can have a single catch statement with type Exception.
@rodericklina
@rodericklina 6 жыл бұрын
Exactly my thought. What he said is objectively wrong. Several catch statements may be used to do different things for different types of exceptions. It's flow control. But you don't have to do it. There's no difference between that and what JS does. Also, if you want to handle different types of exceptions in different ways in JS, you'll end up doing pretty much the same thing, only uglier. Java actually handles this specific scenario better than JS. Now, you could question how useful is it to have multiple catch statements, but that would be another conversation.
@rodericklina
@rodericklina 6 жыл бұрын
I agree that most of things he talked about are reasonable. However, in this specific case, I believe he's wrong. You can have the same benefits JavaScript presents in Java, with the addition that in Java you can use types as an easy flow control. With almost no effort you can devise an exception handling strategy that will fit all scenarios and completely avoid multiple catch blocks. I don't know why you would do that, since multiple catch blocks are much more readable, in my opinion, but it's possible, if you prefer it like that. He fails also to explain why this is due to a failure on the type system. This has nothing to do with type system. An exception is thrown and handled according to its type, may it be Java or JavaScript. Not all exceptions are of the same type, whether you're using a static or dynamic type language. Java, being statically typed, gives you the option to control the flow in multiple catch blocks; JavaScript doesn't. You still have to control the flow accordingly, however. Also, when he says "JavaScript has a superior type system because it doesn't care", I need to inquiry where does it come from. Did he measure this? How? Where are the results? His opinion doesn't make something real. We need to have a more objective approach in our field, otherwise we'll end up like video games fanboys, discussing which console is better, "just because I like it better". Your, mine or his personal experience is not enough to get to a conclusion. And don't get me wrong: I love JavaScript and it is my preferred language. Only I'm not blind and see that statically typed languages, even with some problems, bring also a lot of advantages. In fact, a lot of JavaScript developers I know, complain and mock statically typed languages but have very little to no experience with them.
@xnoreq
@xnoreq 6 жыл бұрын
What he claims to be a "superior type systems" either was a lame joke, because it's actually the source of many bugs, or he's insane. I also agree with the objections to his try/catch example. To be able to distinguish on the type of the exception thrown is an *optional* _feature._ Given a proper type system, you can go up the exception class hierarchy as high as you want. He also doesn't seem to understand the significance of finally, or how it is different from an ordinary block or function call after a try/catch block.
@xnoreq
@xnoreq 6 жыл бұрын
It actually was a critique of Java. Anyway, Rust is an *awesome* language that actually fixes a lot of actual issues with older languages. (Not just the superficial problems that Cockford whines about.) It has his preferred style of if syntax, lol ... no but seriously: it does away with null/nil and provides an Option type which you need to check if it actually contains a value, it has the let keyword (and no var), it requires no runtime and no garbage collector but still manages memory-safety, it prevent data-races, immutability is the default, ...
@rodericklina
@rodericklina 6 жыл бұрын
DDD, even though the objective of the talk was to propose a standard better lean language (which I'm completely in favor of, and applaud him for) he did criticize Java (and Javascript, for that mater). He specifically criticized the multiple catch blocks on Java, in which he's objectively wrong: Java handles flow of multiple types of exceptions in a cleaner way than JS, and can do exactly what he said is so much superior on JS. In this specific point, not only he criticized Java (he straight up mocked it) but also stated that dynamic typing is a superior choice for a type system without providing any evidence for that. This is not only not professional, it doesn't bring any benefits to our field. This kind of "mocky/joky" criticism should be reserved to our personal conversations, not a public conference. But that's my opinion. I'm not angry at him and I really enjoyed reading his book, and I always watch his talks. However, I believe, being respectful is the minimal thing I could ask from a talker in a public conference. This is just constructive criticism. He should not be careless. About the options, I do agree. Having a lot of options may lead you to smaller, leaner code, but may also introduce a lot of issues. "With power comes responsibility". That's actually maybe the biggest problem in JS: it gives you way too many options. Java restricts you a lot, but that also makes your code safer; it's harder to make mistakes on Java than on JS since the compiler is helping you, in a way. Of course the compiler is restricted to catching only simple mistakes. See the contradiction? In summary, languages are tools. Good design and code barely depends on language; it depends on the designer, the coder. Criticizing languages like that is disrespectful and a total waste of time.
@mittelwelle_531_khz
@mittelwelle_531_khz 9 ай бұрын
37:00 fun fact: what is -int32 ? ie. the negative value of some 31 bit + sign implementation of integral numbers, (as the multiplication examples suggests as otherwise the product of two 32 bit entities would need to have 64 bit, not 63). It would need to have 33 bit IF two's complement is used because otherwise it would not be possible to represent the most extreme negative value turned into a positive one.
@norriseldridge2284
@norriseldridge2284 4 жыл бұрын
Not so sure about that no reserved words idea. IDE styling and intellisense would be an absolutely nightmare. And honestly how often are you trying to create a variable named something incredibly generic like "double" or "if" and yet there aren't several other alternatives you could easily use instead?
@CTimmerman
@CTimmerman 7 жыл бұрын
48:02 and 49:45 - What about eval()?
@walter0bz
@walter0bz 7 жыл бұрын
39.35 the REAL problem is that humans need 16 fingers, so we use hexadecimal naturally; forget this base 10 nonsense!!!!
@ameralsabbagh9427
@ameralsabbagh9427 6 жыл бұрын
10 fingers are reserved for the future civilization, when they will be able to have 10 perfectly distinguishable levels of electricity instead of only 0 and 1. So, be humble about the stupidity level of current human being. I you should have already correctly guessed that, I believe in Creationism!
@garetclaborn
@garetclaborn 6 жыл бұрын
no u dont -.- and ya we can already have multiple voltage values read per bit if we really wanted to, just not the way chips are built. quantum computing does have N values per qubit where N is the total number of qubits in the system. So for 1KB qubit system you could have each qubit resolve from 0-1023 rather than 0 to 1. sort of.
@CTimmerman
@CTimmerman 4 жыл бұрын
Simply count your finger bends and tips 4x4 + 3 per hand.
@luminusone
@luminusone 3 жыл бұрын
Thumbs are not fingers, you are doing it wrong, we are meant to be using base 8!
@jbird4478
@jbird4478 2 жыл бұрын
@@luminusone People were supposed to be using base 6. Try it. Count on one hand, and you can use the other hand for the second digit. It's easy to count up to 55 that way (25 for you decimal creatures). Base 6 has the added advantage that it makes everything easily divisible by both 2 and 3.
@gyohngpersonal
@gyohngpersonal 4 жыл бұрын
Some people prefer Pascal and VHDL over C and Verilog. The former are designed from a theoretical standpoint (to promote writing 'correct' code), and the latter from a practical one (to suit solving practical tasks quickly). Douglas Crockford's approach feels to me a bit too uncomfortably close to the prescriptivist camp / 'Pascal' zone.
@SimGunther
@SimGunther 5 жыл бұрын
37:24 So would int63 * int32 be int63 still or is it a whole new type for each layer of multiplication in the expression? :S
@JimmyWalters1
@JimmyWalters1 4 жыл бұрын
I don't understand why multiplying int32's gives an int63 in the first place. Try reducing the numbers, imagine we have int2 * int3, if could have -2 * -4, we need a type big enough to hold 8, an int5. By the same token, uint2 * uint3 could be 3*7, 21, which fits into a uint5. Surely int32*int32 should be int64? Then int64*int32 should be int96?
@heck_fy
@heck_fy 3 жыл бұрын
@@JimmyWalters1 that's because of sign bit, multipliers each have sign bits, but the product has only single one, so intN * intM => int((N - 1) + (M - 1) + 1) - if ints are signed. if ints are unsigned, then uintN * uintM => uint(N + M)
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
He's got a point, tabs are pointless. Spaces can do anything that you need an inline whitespace character to do, whether it's lining up columns or separating words. Tabs can only line up columns (and not very well). If you need richer whitespace formatting than what a space and a line break can provide, I suggest using Microsoft Word as your IDE. And what is a "carriage return" in the context of a computer, anyway? Where is the carriage? Can't we just use one character for a line break, and have it mean that it's a line break?
@jbird4478
@jbird4478 2 жыл бұрын
Tabs are about as pointless as a multiplication operator is. I mean, who needs 4*x when you can just write x+x+x+x?
@LudvikM
@LudvikM Жыл бұрын
@@jbird4478 Right? Who needs cars when we have horses? :)
@andrewkoster6506
@andrewkoster6506 Жыл бұрын
@@LudvikM Since we're talking about horses and carriages, what is a "carriage return", in the context of a computer?
@LudvikM
@LudvikM Жыл бұрын
@@andrewkoster6506 I don't know, something you can also replace with spaces I'm guessing? But seriously, watch this to know more about that: kzbin.info/www/bejne/lZ69c5RpqNaHqKs
@CharmedQuarkSystems
@CharmedQuarkSystems 6 жыл бұрын
You only need multiple catch statements if you aren't working in the context of an integrated object framework. If you are, then all exceptions derive from a common exception class, and so all can be caught and, where it's convenient, you can use dynamic type checking to decide what you caught. I also disagree about not wanting the parens on the condition of an if, while, etc... It aids readability. And the thing about having a single, floating point number type isn't going to change anything. All you will do is moving the bugs from one place to another.
@alexchandel
@alexchandel Жыл бұрын
It doesn’t aid readability. You can read an English sentence perfectly fine without parentheses after all the c pronouns and conjunctions. Catching a base exception and manually reimplementing the exception case checking is slow, and still a failure of the type system as he mentions
@PaulSebastianM
@PaulSebastianM 4 жыл бұрын
Couldn't have picked a more obscure and weird code font myself even if I'd tried...
@ntohl
@ntohl 4 жыл бұрын
What is this... Hand made? Specifically for this talk?
@IndellableHatesHandles
@IndellableHatesHandles Жыл бұрын
Generally, syntax highlighting fixes reserve words. If I see my variable name light up when I type it, I know to change it.
@____uncompetative
@____uncompetative Жыл бұрын
That doesn't work if you are not around to change it when those in control of the JavaScript standard add a new reserved word which happens to have been used in your code before the change in the semantics. It isn't your fault that your program now doesn't work. Those in control of the standard should version their JavaScript so that when encountering legacy code like you wrote it works fine (it won't be using their new feature anyway as it wasn't part of the language when you wrote your code). Anyone wanting to use all the new features needs to say that they are opt-ing into them with some adoption of a version of JavaScript (which will mean they are saying they respect and avoid all the reserved words of all versions up until that version number, but none after). This means that JavaScript 3 has to include JavaScript 2 and JavaScript.
@IndellableHatesHandles
@IndellableHatesHandles Жыл бұрын
@@____uncompetative Most JS code is obfuscated before it reaches the user anyways.
@____uncompetative
@____uncompetative Жыл бұрын
@@IndellableHatesHandles Good point.
@alexchandel
@alexchandel Жыл бұрын
The point is new keywords can break it.
@busydying
@busydying 6 жыл бұрын
you can't get rid of null because of json
@garetclaborn
@garetclaborn 6 жыл бұрын
and cuz i wont let u good point tho. json ftw
@pepper669
@pepper669 6 жыл бұрын
garet claborn guess who popularized the use json in javascript? surely not you.
@garetclaborn
@garetclaborn 6 жыл бұрын
@pepper669 u seem to have grossly misread this comment, however yuh huh i totes popularized it all on my own. u werent there u dunno and u smell like cheese. u lose the internet. btw since u probably still don't realize how casual speech works, when i say 'cuz i wont let u' that implies that regardless of json, i wont let null be gotten rid of. it is simple for any lone developer to do this. just keep using null. therefor it still exists in live code derp derp derp
@pepper669
@pepper669 6 жыл бұрын
garet claborn get stuffed.
@eloceano3829
@eloceano3829 7 жыл бұрын
Really great video, the sad part is the Javascript scene is going in the oposite direction. Instead of "less is more" (KISS), it seems that the more complex a program is the better, or the more levels of indirection the better, (sum to that we are continuously reinventing the wheel each six monts) Take for example Redux. Local state management is a problem solved by client transactional databases (Pouchdb, Indexdb, even sqlite) but you have to be cool and rewrite all your existing apps to use Redux just because FB uses it. Nothing to do with the before mentioned question but I would also like to recommend one good practice. Always put the date of a blog post at the begining of the title. This way you can know quickly if the post is recent, instead of scanning all the page for it. With so much information each minimun detail can easy the repetitive task of information processing. (Excuse my English eh :)
@noxabellus
@noxabellus 6 жыл бұрын
You have no idea what you're talking about. Even your example proves a fundamental lack of understanding. pouchdb, indexdb, these are only part of the equation. The M in M V C, or the store(s) in a flux type pattern. On top of that, people don't "rewrite all their existing apps to use Redux just because FB uses it" people use Redux because React and Redux make shitloads of sense if you take time to understand the abstractions they provide. It would be impossible to build the application I am working on today without some kind of framework like Redux (I use mobx instead though), and I would be an idiot to write it myself.
@ABFSU1
@ABFSU1 6 жыл бұрын
I'm hoping more and more applications go online, with JS or whatever. I can't tell you how amazing it feels to use vim keybindings online and saving to Google Drive (Anyfile Notepad). I can't tell you how amazing it is to see office suites with online versions (MSO, Google suite). Not having to install all these arbitrary programs on every device you want is a luxury that "kids today" don't understand. On the other side, I get upset at some devs *cough*Google*cough* that make their sites literally unusable without Javascript, since I use Lynx browser all the time.
@garetclaborn
@garetclaborn 6 жыл бұрын
got to say billy, a CS degree is the last thing i expect will produce good code from new hires. a designer turned amateur js code is pretty common but time-for-time of experience, if a once designer has been tinkering and worked on say ~200 hrs of javascript over various projects... this compared to 200 hrs of university javascript project experience..yea i'll take the designer.
@garetclaborn
@garetclaborn 6 жыл бұрын
nah I can't really agree with that, it's well stated but not accurate in real-life. somewhat ignores the actual statement i'm making as well, which is purposely discrediting the value of most CS degrees. you can be a degree-toting developer and still be talented, but the designer in my argument will have a higher probability of being capable of handling inter-related logic than a CS noob, not because they're a designer turned onto javascript, but because they've coded actual projects. a CS major could be perfectly skilled, but you'd have the same situation -- they'd be more skilled had they skipped university in most cases and gone straight to the field. the only ones who benefit from CS programs are those don't have the drive to teach themselves. i'm sure there are a few exceptional programs out there but if you've ever been a developer hiring other developers it's laughable.
@noxabellus
@noxabellus 6 жыл бұрын
From my perspective the problem is that there is big pressure today on teachers and on universities to have passing students, and on top of that, that's all a degree indicates: you passed. However, with someone who has gone from designer to coder in their own way, there is no faking it. The idea that only cs majors produce good code is just something cs majors say to justify their crushing debt
@rtvdenys
@rtvdenys 2 жыл бұрын
"As we have functions, we do not need finally." That is a very bold statement. So how are you doing to implement that try-catch-catch-catch-finally with a function?
@DrazkurHW
@DrazkurHW 2 жыл бұрын
try: // Plan A catch: // Plan B finally()
@rtvdenys
@rtvdenys 2 жыл бұрын
​@@DrazkurHW I am sorry, but this does not tell me anything. Mind being a bit more specific? Here is an example of a code in Java: try { doStuffA(); if (xyz) return; doStuffB(); } catch (ExceptionA e) { doStuffC() if(abs) return; doStuffD() } finally { doStuffE() } Can you do it "with a function"? Precisely how would that look like? Please feel free to demonstrate it in any language. I am familiar with a couple of dozens.
@DrazkurHW
@DrazkurHW 2 жыл бұрын
The idea is that the 'finally' keyword is useless because writing anything inside it is the same as writing it after the entire block
@rtvdenys
@rtvdenys 2 жыл бұрын
​@@DrazkurHW sure. However, that is simply not true. Especially when you have "return" statements in your code. So I repeat, please try re-writing the code I have shown above without "finally". Good luck. You will need it.
@kamaredrache
@kamaredrache 2 жыл бұрын
@@rtvdenys I think the intended solution is just to place the "finally" clause into a function and then call it at the end of each branch of the try-catch statement. So: try { doStuffA(); if (xyz) { doStuffE(); return; } doStuffB(); doStuffE() } catch (ExceptionA e) { doStuffC() if(abs) { doStuffE(); return; } doStuffD(); doStuffE(); } But this doesn't feel very elegant if there are more exit points than clauses as in your example here.
@user-ge2vc3rl1n
@user-ge2vc3rl1n Жыл бұрын
In modern C# you can use try/catch with where the type is an exception base class and the actual error is a superclass of that class. So you can still have only 1 catch for all types and handle the error.
@____uncompetative
@____uncompetative Жыл бұрын
I am struggling to comprehend all of this exception handling fashion that I see in modern languages, but then I have never had a bug in any of my own code, so I haven't needed it.
@alexchandel
@alexchandel Жыл бұрын
In better languages, a function can return a sum type, like DateTime | Err. You don’t need special broken syntax or action at a distance.
@HenrikVendelbo
@HenrikVendelbo Жыл бұрын
The whole thing comes down to the urge to micromanage the source code, which is learned by engineers getting burned by an unforgiving environment that blows up over details.
@funkizer
@funkizer 6 жыл бұрын
Great talk, brought me back to days of running around with huge tape rolls. Only thing I didn't agree with was "names with spaces". That'd make code less readable, can't quickly see if a thing is one thing or several. Also might be because I'm Finnish, we combine all composed words, eg. "washing machine" = "pesukone" (pesu=washing, kone=machine) kzbin.info/www/bejne/b2q9kpajbLimjbM
@CarloRizzante
@CarloRizzante 6 жыл бұрын
Amazing talk!
@Sergejack
@Sergejack 7 жыл бұрын
Clojure handles 0.1 correctly, you have to use ratios 1/10.
@ehsnils
@ehsnils 3 жыл бұрын
Personally I think that JavaScript is an apocalypse by itself. I prefer strong static typing so that I get a strong indication way before I even try to execute the stuff that's built. I have now seen a number of lectures, but Ada is left out in the cold.
@nickbreaton
@nickbreaton 6 жыл бұрын
Does anyone know why Object.assign is not a pure function?
@dlwatib
@dlwatib 6 жыл бұрын
Because it modifies the state of an existing target object instead of returning a new object with the correct properties.
@merijnvanwouden
@merijnvanwouden 6 жыл бұрын
many good suggestions, however I doubt any of this will ever be incorporated into ecmascript, especially the corrections of impurity
@dialatedmcd
@dialatedmcd 5 жыл бұрын
he took those back in the conclusion of that bit.
@kobicohen4546
@kobicohen4546 7 жыл бұрын
Great talk!
@pkcakeout7551
@pkcakeout7551 6 жыл бұрын
37:15: I think int63 is the wrong answer here. Example: int2 * int2 => int4 (not 3!) Binary: b11 * b11 = b0100 (you need the first zero to encode the negative sign, so int4) Decimal: -2 * -2 = 4 So similarly it should hold that int32*int32 requires a int64 to hold all possible results, or am I wrong?
@joshodom9046
@joshodom9046 6 жыл бұрын
You're right
@simonmasters3295
@simonmasters3295 5 жыл бұрын
@@joshodom9046 I'm not gonna disagree, the main point is the developers in the audience, seem to lack the confidence to yell out "int64" or "int65" but rather remaining silent...
@Ahjile
@Ahjile 3 жыл бұрын
You are, in fact, wrong. Which is OK, because it's sort of a trick question he was asking to make his point. That computation does actually result in what must be described as an int63. It is supposed to produce an int64, ideally, but it can't. That's his point. He describes the details of this in several other talks, getting into how computers handle numbers in the real world.
@karaloop9544
@karaloop9544 2 жыл бұрын
Tab does not spark joy? It does for me, every single time I want to autocomplete something. :)
@walter0bz
@walter0bz 6 жыл бұрын
'if (..){}... ' .. actually c++17 has a nice feature that will leverage the condition around the parenthesis, if (init;cond){ .. do stuff.. }
@brianolsen5435
@brianolsen5435 6 жыл бұрын
For variable names, it's good to have something that I can double-click on in my text editor to select the entire variable. under_bar (snake_case) and camelCase work fine with this, "variables with spaces" wouldn't. Sure, you can say that we just need smarter text editors, but until you're willing to code such an editor, you can pry my single word variables from my cold, dead hands.
@dialatedmcd
@dialatedmcd 5 жыл бұрын
I don't think it'd be that hard to program, the highlight stretches out until it meets = or < or > (etc) and it also stops if it hits a reserved word like if. Now if we remove reserved words that will cause some complication lol. I don't think this is a big issue. JavaScript has a lot of redundancy and extra syntax that could be removed.
@jakehenri9608
@jakehenri9608 5 жыл бұрын
Editors are built to work with code, not the other way around. If the web language were replaced, communities would very quickly adapt.
@GeorgeTsiros
@GeorgeTsiros 5 жыл бұрын
"Sure, you can say that we just need smarter text editors," Not only that, we NEED text editors that are SEMANTICALLY AWARE of the language. Even more than that, we need text editors that simply do not allow you to type things like arr[i]] = j; as a silly example.
@JoJoModding
@JoJoModding 4 жыл бұрын
Yeah, writing text editors to conditonally select over a space or not DOES NOT SPARK JOY. So we won't do this.
@AdamSchelenbergCom
@AdamSchelenbergCom 6 жыл бұрын
OMG, I laughed so hard on the tab and spaces thing.
@the_real_vdegenne
@the_real_vdegenne 6 жыл бұрын
well, you can't get rid of the single quotes because in some languages the double quote means the string has to be synthesized and the compiler to search for placeholders (such as "hello I am $name" in php), coding with single quotes is making the execution time faster because it prevents the compiler to run an analyzer onto these strings.
@jamesmcmanus
@jamesmcmanus 5 жыл бұрын
The lone numeric type should be Dec256, and 0/0 should produce a cryptographically secure random value.
@dustincleveland5784
@dustincleveland5784 6 жыл бұрын
Wait, did he just go through five minutes of exposition to explain the concept of "tokimeku", and then immediately say that it's not applicable to programming?
@dialatedmcd
@dialatedmcd 5 жыл бұрын
yeah he was just telling an interesting story? HIS LOGIC SHOULD BE LASER PRECISE - WHY DOES ART EVEN EXIST. WHAT IS NUANCE. WHAT IS CONVERSATION.
@Uristqwerty
@Uristqwerty Жыл бұрын
On tabs versus spaces: What is missing is a way to *set* tab stops. Grab some currently-unused control character, and give it the purpose of pushing its column into the next line's tab-stop queue. Then, it has a distinct purpose: alignment. Wrapping function arguments? One set-tab-stop after the (, each following line consisting of a single tab then for all but the last, another set-tab-stop to carry the alignment forwards. Suddenly, a refactoring that changes the length of the function name, or even a proportional font, will preserve alignment without requiring any diffs to touch the following lines. It would require editor support to understand the character, and for compilers to treat it as ordinary whitespace if the borrowed character isn't already, but it would be a nice quality-of-life improvement overall. How about for actual tabular data embedded within source code? Well, unless you have a way to scan forwards to the longest-cell of a column, you'd have to settle for manually spacing the first row, or writing a table header as a comment, and embedding the stops in it. Still better than today's status quo, though! Especially if any identifiers within the table are refactored to a different length. Lastly, now every code formatter can clearly see when a human is aligning things for readability, and not mangle that particular bit of whitespace (after all, there *are* no padding spaces to adjust!), while still having free rein over the rest of the file.
@xcoder1122
@xcoder1122 2 жыл бұрын
A tab tells me, that the purpose of that "space" in front of something, is an indention. A space is just a space, it tells me nothing except the lack of any printable character in that position. If code is all about transporting intention, a space transports no intention, as it may be an indention level or it may not, it may layouting, it may just look nice, it may have no purpose at all to be there. And if a project uses two spaces as indention and there are three in front of a line, it even creates ambiguity; is that one level of indention with an accidental space or two level of indention with one space missing? And how about different projects using a different number of spaces per indention level? That's even more ambiguity. Ambiguity in programming is *far worse* than clutter! There is no ambiguity with tab. A tab is always one level of indention; case closed. You can configure how large a tab appears on your screen and not the entire team has to adopt because you like wider or more narrow indention. Also what would be easier to give tab a printable character? Many code editors do just that in some kind. Again, they cannot do that for space in general, as space is used for different purposes, and with spaces used for indention, they can only take a vague guess upon open a file which spaces are indention and which ones are not; and quite often they guess wrong. So from a logical perspective, only tab can be the winner in this argument and if the only argument against it is that is looks like space, get a font where it doesn't and stop whining. Oh and "but what if my keyboard has no tab key" is no argument either, as code editor can easily transform your n-spaces in front into a tab for you, not even that should be an issue. There are no real arguments against tabs, only excuses why people refuse to use them.
@____uncompetative
@____uncompetative Жыл бұрын
Wrong
@moistbrownypoints
@moistbrownypoints 6 жыл бұрын
9:15 no they don't. 'there was a guy who gave a talk and was "wrong" ' + "as opposed to being \"right\" "
@agugyin
@agugyin 6 жыл бұрын
Hardware is what my heart is missing in the place of the word "purity"... :D
@sleaf6
@sleaf6 3 жыл бұрын
The point on contracts can be done with assertions paired with conditionals
@alexchandel
@alexchandel Жыл бұрын
“Program explodes if assertion failed” is a horrible alternative to “compiler enforced contract.” That kind of thinking is responsible for millions of user-facing crashes.
@sleaf6
@sleaf6 Жыл бұрын
@@alexchandel fair
@KvaGram
@KvaGram 6 жыл бұрын
As a lojbanist, I react to the use of "fi" at 29:00. It feels out of place. It's probobly not bad, but considering how it is used in lojban, it twists my brain lookin at it.
@nozedic
@nozedic 6 жыл бұрын
REBOL Language (not rebel)
6 жыл бұрын
I think I heard this "stuff" speech in the Life of Brian's market scene :)
@creepychris420
@creepychris420 3 жыл бұрын
'they should teach history here' yeah they fuckin should someone link me that talk
@YouHolli
@YouHolli 6 жыл бұрын
Pretty much the only thing I can agree on with this self-contradicting guy is that floating point math is inherently broken.
@jiu6246
@jiu6246 2 жыл бұрын
having null and undefined is actually useful in some cases. If you doing PATCH then undefined means that variable is not be patched but null means patch the variable to null
@alexchandel
@alexchandel Жыл бұрын
That’s a failure of the type system. You’re basically patching Type | NullType | ⊥, and also he argued null shouldn’t exist
@polycreativity
@polycreativity 2 жыл бұрын
Names with spaces, yes. I started defining a language group I call "Clear" that tackles a lot of these issues. One thing not discussed here is the difference between instructional languages, serialization languages, templates, macros, functional and domain-specific languages like regex. They are all important tools but the crap part is that not a single one of them comes without thorns. There's a MASSIVE tech debt to the entire Internet Protocol + Web/HTML/JS stack. When I have to write low level networking applications I immediately come to realize how much waste there is to stupid things like endianness and legacy parity checking protocols.
@wumi2419
@wumi2419 9 ай бұрын
Stupid thing like endianness is needed if you want to interoperate with Windows IIRC. I also know for certain that it has its own special view of Unicode
@noxabellus
@noxabellus 7 жыл бұрын
lots of great ideas and observations here but variable names with spaces is insane. it would make code so, so much less readable. Overriding reserved words is something only an egomaniac would do, also totally throwing readability out the window. Oh and then there's trying to get rid of the curly for if statements... in favor of FI?? And to mention all of this weird bs and not throw in operator overrides? Super in touch with the real world there Doug!
6 жыл бұрын
You're a fucking fool. stop pretending yoru failure to understand is some kind of critique you mindless thick fuck.
@noxabellus
@noxabellus 6 жыл бұрын
lmfao failure to understand i think someones projecting their own insecurities
@chrimony
@chrimony 6 жыл бұрын
The amusing thing is he says syntax doesn't matter, then spends half his talk on it.
@dialatedmcd
@dialatedmcd 5 жыл бұрын
He says it's like fashion, it's style. I agree with him that it should be reduced down to the minimum required. I like how Ruby reduces syntax, let's go that route.
@platin2148
@platin2148 7 жыл бұрын
Quite nice today we have 3 ways for string quotes: " ' ’ okay one of those is not the same as they other two but why did they do this ? The other two are influenced from C but because JavaScript is not strictly typed we can make string out of both what a good idea.
6 жыл бұрын
No, the opposite.
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
has nothing to do with type safety, it's just syntax, the 3 different kinds of quotes could get compiled into 3 different object/primitive types or they could all be the same type, regardless of how strict or permissive the language's type system is
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
Like Java could have arbitrarily chosen to make any string longer than 10 characters be interpreted as a BigString instead of a String, with no change in the syntax. Nothing about the single type of quotes or the Java type system would make that easier or harder to implement. Programming languages are all just made up anyway.
@jacobsoby3910
@jacobsoby3910 6 жыл бұрын
Flipping over to another application... I thought this was Bob Newhart speaking... I like the observations, but is this talking about Java or JavaScript?
@garetclaborn
@garetclaborn 6 жыл бұрын
it meanders. think the dude has gone senile
@TheFerdi265
@TheFerdi265 4 жыл бұрын
I laughed out loud when he put POST, PUT, and PATCH side by side and mentioned HTTP.
@dewdop
@dewdop 3 жыл бұрын
I didn't understand that at all
@samredmond728
@samredmond728 5 жыл бұрын
Lets remove the Random function because it keeps giving us a different number lol
@dialatedmcd
@dialatedmcd 5 жыл бұрын
lmao. he took that back in the conclusion of that bit though. hilarious tho lol
@DingleFlop
@DingleFlop 4 жыл бұрын
I love the force-respect of indentation idea. A really obscure language called "DreamMaker" does exactly this. Blocks are indented, not braced.
@abchernin
@abchernin 2 жыл бұрын
Python springs to mind, with derivatives like GDScript
@capzombie
@capzombie 6 жыл бұрын
Let single quote alone! ;)
@letMeSayThatInIrish
@letMeSayThatInIrish 6 жыл бұрын
The problem with the 'joy-spark' analogy is that programming languages are like public property. In your own home you can throw out and rearrange things, but you can't rearrange your city in the same way, because other people might disagree with you. There are n things presented in this talk, and n!-1 ways to disagree.
@simonmasters3295
@simonmasters3295 5 жыл бұрын
psmag.com/social-justice/confident-idiots-92793
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
you can rearrange things in your city, or even throw them out if they don't spark joy, it's just harder. For example, you may need several ropes, a bunch of other people, and cooperation from the city cops in order to take down a Confederate statue, but it can absolutely be done
@4cps777
@4cps777 2 жыл бұрын
34:30 Welcome to the reason why I just catch instances of Throwables most of the time.
@superscatboy
@superscatboy Жыл бұрын
I can't bring myself to trust the judgement of anyone that chooses to use that font.
@tenminutetokyo2643
@tenminutetokyo2643 4 жыл бұрын
Where does this crap end. All these devs need to start learning when to say no to stuff.
@Basaltq
@Basaltq 6 жыл бұрын
The argument he used to get rid of tabs is the exact same he used to justify double quotes. Spaces all ready have a function, but tabs are designed for indentation!
@alexchandel
@alexchandel Жыл бұрын
You missed the point. “TAB” is a vestigial character from teletypes. It signaled the mechanical carriage to release until it hit an obstruction. It isn’t “designed for indenting” modern text any more than SPACE. Digital text doesn’t have mechanical tab stops. Code has the opposite: pre-formatted fixed-width text, ill-suited for variable-width “tabs”
@tomatopotato4229
@tomatopotato4229 6 жыл бұрын
Regarding 34:47 public static Integer indexOf(String input, String toLookFor) { int result = input.indexOf(toLookFor); if (result == -1) { return null; } return result; } Here you go.
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
yes, one can rewrite the core library methods to be more consistent and well-designed than they are. You've just done a small part of that. You shouldn't have to do that just to get a consistent and well-designed core library though.
@tomatopotato4229
@tomatopotato4229 4 жыл бұрын
@@andrewkoster6506 I'm not trying to defend the design of the core library of java although I'm sure there are inheritance reasons for this particulate method to look like this. Anyway what I *wanted* to illustrate is that at least this is not a huge deal. It's absolutely possible get the behaviour you want with one very simple function and knowledge of javas type system.
@AndrewTSq
@AndrewTSq Жыл бұрын
when you have full volume on everything, and can hardly hear the man :(
@pgoeds7420
@pgoeds7420 5 жыл бұрын
He really doesn't like tabs - his C code on github has no makefile.
@Vaaaaadim
@Vaaaaadim 4 жыл бұрын
I agree that only " or ' should be used but not both, and that " is the better choice. I'm ambivalent about the thought of javascript moving to be a mainly functional language. I find the thought of using "if" as a variable name to be disgusting. Perhaps there is something to say on not requiring programmers to memorize every single reserved keyword, but at the same time I think that its a fair upfront cost to working with a language, and normally an IDE will highlight it to indicate that it is a keyword. Allowing spaces in variable names seems like a very odd idea. I'm also not a fan of the idea of having if statements end with fi. Floating point math can be weird sometimes sure, but I am not convinced that having a decimal representation would fix the issue. Using a decimal base for floating point math will probably make the math work out correctly for simple examples that just use literals specified in decimal sure, but you can't possibly guarantee that for instance 1/7 in a decimal representation would follow associativity and properties we normally understand should be true but aren't when we have programs do floating point operations. Rounding will have to happen anyways. The only way you can guarantee that such properties you expect to be true are indeed true, is if you were to encode numbers with fractional components to keep track of a numerator and denominator each as arbitrary precision integers.
@janvermaut6271
@janvermaut6271 6 жыл бұрын
Interesting talk on important matters, really. Getting rid of clutter (in our mind) will surely help us think more efficiently and more effectively. About the passage at 28:00: I think it would have been great if someone had introduced the following IF syntax: a : b if a = 0 and its corrolary a : b unless a = 0 You can still add an optional else-clause, but you basically would reduce two keywords to one keyword by putting the condition behind the assignment.
@andik70
@andik70 6 жыл бұрын
8:10 he uses tabs????
@asdqwe4427
@asdqwe4427 6 жыл бұрын
How am I supposed to know what my colleague meant when he/she is using words that otherwise would have been reserved? Readability matters perhaps more than anything else.
@dialatedmcd
@dialatedmcd 5 жыл бұрын
I agree... Also syntax highlighting will highlight a reserved word, if you're new to the language and you use a reserved word, it's revealed to you. So ya just alter it. I mean this isn't in all syntax highlighting but I haven't used one that doesn't do this.
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
From context? "const if = x + 3" has an obvious, unambiguous meaning, even if "if" is a reserved word. It doesn't make the statement significantly harder to parse, for a human or a compiler.
@andrewkoster6506
@andrewkoster6506 4 жыл бұрын
In SQL, reserved words can be used as table names or column names, and it just requires some extra quoting in contexts where there is ambiguity between the name and the reserved word. It's not that crazy and you can either avoid reserved words (same outcome as if you weren't allowed to use them), or use them with the extra syntax (same outcome as if you improvised a more verbose workaround to express a concept that is best identified by the reserved word).
@jbird4478
@jbird4478 2 жыл бұрын
He's saying null is "horribly" wrong because it's type is object. Then he goes on to say people in some cases people should just createa immutable empty *object* called null. Right. So we throw away a perfectly valid keyword as a concept only to have it be recreated by everyone with some boilerplate code const null = Object.freeze(Object.create());
@krazybubbler
@krazybubbler 6 жыл бұрын
hmmm... the monospace font chosen for this presentation made me stay away of it. I might be weird... but...
@vincentcleaver1925
@vincentcleaver1925 2 жыл бұрын
He had me going for minute there
@jbird4478
@jbird4478 2 жыл бұрын
Much of his argument revolves around the idea that choice is bad because it creates arguments and interoperability problems. That's nonsense. I like my tabs. There's no point in arguing over that. If you like spaces, you do you. The only place where that can cause problems is in languages with significant whitespace, but in that case (looking at you Python) the language is the problem, not the tabs. Same thing with the quotes. I program mostly in c, so in that case there is a significant difference, but when there isn't, I just use whichever I prefer and others can do the same.
@RobSwindell
@RobSwindell 2 жыл бұрын
Lost me with "names with spaces". Sounds like *more* opportunity for error/mistake, not less.
@ShanyGolan
@ShanyGolan 7 жыл бұрын
Facinating! This is very important!
@garetclaborn
@garetclaborn 6 жыл бұрын
it is your face, which is important. how about that?
@DanCojocaru2000
@DanCojocaru2000 4 жыл бұрын
"Tab is useless". People using stuff like MS Word: ...
@tomatopotato4229
@tomatopotato4229 4 жыл бұрын
uuhm. 34:20 If you prefer that you can absolutely do that in Java no problem. try { // plan a } catch (Exception e) { //plan b } //clean up Catching the base type Exception will catch all possible Exceptions that derive from it. So either plan a will be executed, or there's any exception and plan b gets executed.
@alexchandel
@alexchandel Жыл бұрын
You missed the point.
@canadianbootz1
@canadianbootz1 6 жыл бұрын
contracts is javascript: www.npmjs.com/package/named-positional-args#even-bettersimpler-with-es6-destructuring-
@paulfalke6227
@paulfalke6227 2 жыл бұрын
"They should teach you guys more history" at 39:20 - very intellectual, old man. I'm sure that I known things you don't know. And, by the way, I do not brag about this (too much).
@wiskasIO
@wiskasIO 2 жыл бұрын
DEC64 number type it's something I invented in an alternate universe...
Refactoring to Immutability - Kevlin Henney
1:03:22
NDC Conferences
Рет қаралды 92 М.
Douglas Crockford: The JavaScript Programming Language
1:49:55
YUI Library
Рет қаралды 488 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 7 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 873 М.
DELETE TOXICITY = 5 LEGENDARY STARR DROPS!
02:20
Brawl Stars
Рет қаралды 14 МЛН
Plain Text - Dylan Beattie - NDC Copenhagen 2022
59:20
NDC Conferences
Рет қаралды 156 М.
Douglas Crockford about problems of JavaScript
55:19
Anywhere Club
Рет қаралды 8 М.
The Post JavaScript Apocalypse - Douglas Crockford
46:40
ConFoo Developer Conference
Рет қаралды 70 М.
Monads and Gonads
49:47
Google TechTalks
Рет қаралды 145 М.
Intro to the Zig Programming Language • Andrew Kelley • GOTO 2022
50:14
Lambda? You Keep Using that Letter - Kevlin Henney
1:00:53
NDC Conferences
Рет қаралды 97 М.
The Better Parts. Douglas Crockford. JS Fest 2018
55:59
Fest Group
Рет қаралды 24 М.
How Deep Neural Networks Work - Full Course for Beginners
3:50:57
freeCodeCamp.org
Рет қаралды 3,5 МЛН
Domain Driven Design: The Good Parts - Jimmy Bogard
58:39
NDC Conferences
Рет қаралды 218 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 4,8 МЛН
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
сюрприз
1:00
Capex0
Рет қаралды 1,2 МЛН
С ноутбуком придется попрощаться
0:18
Up Your Brains
Рет қаралды 426 М.
ВЫ ЧЕ СДЕЛАЛИ С iOS 18?!
22:40
Overtake lab
Рет қаралды 79 М.