T
Toby Ho
tobyho.com · Personal blog · on HN since 2011
Toby Ho writes programming tutorials, mostly about JavaScript prototypes, functional programming, generators, and static analysis.
What HN saysHN commenters cite his post on how safe different programming languages are in language safety debates, and link his JavaScript constructors article.
18HN people shared it
6linked it in comments
22stories submitted
104story points
9 years agolast shared
2011people per year2026
Most-shared posts
- 1How safe is your programming3 people · first shared 2016
- 2Javascript Constructors and Prototypes2 people · 52 points · first shared 2013 · 51 comments on HN
- 3Functional Programming by Example (JavaScript)2 people · 5 points · first shared 2015 · discussion on HN
- 4Polymorphism That Just Works2 people · 3 points · first shared 2015 · discussion on HN
- 5What Is This Thing Called Generators?2 people · 3 points · first shared 2013 · discussion on HN
- 6Fun with Esprima and Static Analysis1 people · 16 points · first shared 2013 · 1 comments on HN
- 7Javascript OO Without Constructors1 people · 7 points · first shared 2012 · 1 comments on HN
- 8Promise-based co-routines in Node.js1 people · 2 points · first shared 2016 · discussion on HN
- 9Avoiding Javascript this-hell1 people · 2 points · first shared 2011 · discussion on HN
- 103 Ways to Discourage Copy-n-Pasting Code in Teaching1 people · 2 points · first shared 2012 · discussion on HN
- 11My js1k Entry: Making Music with the Audio Data API1 people · 2 points · first shared 2012 · discussion on HN
- 12Null Object for Lists1 people · 2 points · first shared 2015 · discussion on HN
- 13Better TDD Workflow via Exclusive Tests in Jasmine and Mocha1 people · 1 points · first shared 2012 · discussion on HN
- 14Testem 0.1.0 Released and Screencasts1 people · 1 points · first shared 2012 · discussion on HN
- 15Javascript Source Rewriting and Assertions1 people · 1 points · first shared 2014 · discussion on HN
What HN people wrote when they linked it
wingi · 2017-07-20
what are your criteria to be a "safe programming language"?
- type safety
- memory management
- compile time help
Here are some options:
- http://tobyho.com/2008/03/30/how-safe-is-your-programming/
- http://vita.mil-embedded.com/articles/when-programming-language-techno…
wyager · 2016-11-11
That's not what people mean when they refer to the "safety" of a language.
https://en.wikipedia.org/wiki/Memory_safety
https://en.wikipedia.org/wiki/Type_safety
http://tobyho.com/2008/03/30/how-safe-is-your-programming/
The fact that people consider "security releases" for compilers/runtimes to be normal and acceptable is actually extremely alarming to me, but it's different from language safety.
IshKebab · 2016-04-21
Pretty much anything!! Java, C#, Rust, Go, OCaml, Lisp, ... even C++ would be a much better choice.
Check this out: http://tobyho.com/2008/03/30/how-safe-is-your-programming/
There also used to be a website that ranked programming languages according to various parameters (which is faster, which is safer) by asking visitors pairwise comparisons (Which is faster - Matlab or C?). I was going to link it but can't find it unfortunately. Anyway I'm pretty sure C would come second-last in the safety ranking, right above assembly.
andybak · 2014-06-28
In some ways Python is more liberal but in different areas - Metaclasses, 'magic' methods (hooking into __getattr__ allows some very clever behaviour), operator overloading, control of the abstract syntax tree and doing crazy stuff with imports. Try doing some of that in javascript.
You want prototypical inheritance? Here you go: http://tobyho.com/2009/05/23/prototype-inheritence-in/
Monkeypathing? Nothing forbids it other than a sea of raised eyebrows if there was a cleaner way to achieve the same thing.
The only limitation Python has with first-level functions is that they can't be anonymous. I know a lot of people chafe at this but I've never seen any javascript code that wouldn't be improved by removing a couple of levels of nested anonymous functions ;-)
chris_wot · 2013-01-29
You're forcing class based inheritance onto a language that specialises in prototypical inheritance... however, try http://tobyho.com/2010/11/22/javascript-constructors-and/
netghost · 2012-07-20
In case anyone's curious I came across this post about using Backbone for rich command line app:
http://tobyho.com/2012/07/19/backbone-charm-text-based-ui
Pretty neat, I would never have thought of using it outside the browser.