Post 141807

@shawn
@kwood haha the more you explain the more I'm mentally running in the other direction. I really like Swift's safety. I'm to inexperienced to see any of this as a plus, it's just frightening to me /@blumenkraft
@shawn
@kwood thanks for the link. The more information the better 😉 /@blumenkraft
@kwood
@shawn Lots of the inner workings and "rules" can come across a little frightening, sure. But behind all those rules and ugly historical warts is a small and sometimes even beautiful little language :) // @blumenkraft
@kwood
@shawn It can be really fun as long as you don't use certain stuff. Avoid "new", "this", "var", use modules as your mental model for creating "class like" structures to get real private variables, and you should be set. :) // @blumenkraft
@kwood
@shawn Oh, and composition over inheritance. Forget about prototypes (unless forced to use another module), use Object.assign() for composing objects with a factory. And suddenly there is not much left to shoot yourself in the foot :) // @blumenkraft
@shawn
@kwood interesting. I've had lots of problems with prototype functions always being undefined. I'll try the Object.assign() method next time. /@blumenkraft
@kwood
@shawn Heres a nice little video about it, must watch: https://m.youtube.com/watch?v=wfMtDGfHWpA
// @blumenkraft
@shawn
@kwood hahaha funfunfunctions! Thanks /@blumenkraft
@kwood
@shawn Yep, really funny guy, works at Spotify. Has lots of interesting content, from basic programming concepts up to programmer ethics and stuff. (Not everything is about JS, so do 't worry, hehe)
// @blumenkraft
@jws
@shawn My favorite is code reviewing mixed Swift and JS projects. The syntax is similar enough when viewed as patch hunks that I mix them up constantly. "Why didn't you do X?" "Oh yeah, wrong language, never mind." @kwood @blumenkraft
@jws
@shawn Quick fast forward: https://ponyfoo.com/articles/es6 @kwood @blumenkraft
@shawn
@jws @kwood What also frustrates me is that there is no set way to do anything. Swift is clear, you want a class, done. There are so many conflicting ways to create objects with JS I'm a bit confused. I want one way, mine is bad 😬 /@blumenkraft
@kwood
@jws +1 for everything on ponyfoo, I' add https://ponyfoo.com/articles/understanding-javascript-async-await just for the sake of completeness (which was technically ES7 / 2016, but an important part of the puzzle…) // @shawn @blumenkraft
@kwood
@shawn Thats understandable, clean language design is great. The "one way" thing can't be done in JS, because 20 years from now the language still needs to render those blinking images in web pages made in the 90s. // @jws @blumenkraft
@kwood
@shawn What makes it even harder when learning today, is that ES6+ is only 2 years old. It takes some time until most documentation and code is replaced with the newer features / best practices. // @jws @blumenkraft
@jws
@kwood I rather doubt you'll see a unitary best practice emerge, with class syntax pulling one way and more functional styles pulling another. @shawn @blumenkraft
@jws
@shawn You use a linter to push you to a set way. Same deal with C++ or Scala: Pick a subset, agree it as a team, and run with it. @kwood @blumenkraft
@kwood
@jws Sure, multiple "schools" are always granted if a language is (too) expressive. But I have hope that at least some of the bad habits from the jQuery and early Node periods will fade away over time. // @shawn @blumenkraft
@jws
@kwood 🤞🏽 @shawn @blumenkraft

Go to the App Directory to explore the network more!