Monday, February 24, 2020

Suzy Cube Update: March 23, 2018

#SuzyCube #gamedev #indiedev #madewithunity @NoodlecakeGames 
A very late and very short update...
Read more »

Sunday, February 23, 2020

Tech Book Face Off: CoffeeScript Vs. Simplifying JavaScript

I really like this setup for a Tech Book Face Off because it's implicitly asking the question of what can be done to improve the quagmire that is the JavaScript language. Should we try to simplify things and pare down what we use in the language to make it more manageable, or should we ditch it and switch to a language with better syntax that transpiles into JavaScript? For the latter option, I picked one of the few books on the CoffeeScript language, aptly named CoffeeScript: Accelerated JavaScript Development by Trevor Burnham. Then, for sticking with JavaScript, I went with a recently published book by Joe Morgan titled Simplifying JavaScript: Writing Modern JavaScript with ES5, ES6, and Beyond. It should be interesting to see what can be done to make JavaScript more palatable.

CoffeeScript front coverVS.Simplifying JavaScript front cover

CoffeeScript


This book was written a few years ago now, in early 2015, but CoffeeScript is still alive and kicking, especially for Ruby on Rails developers as the default front-end language of choice. CoffeeScript is integrated into Rails' asset pipeline, so it gets automatically transpiled to JavaScript and minified as part of the production release process. If you're already comfortable with JavaScript, and even more so if you know Ruby, then CoffeeScript is a breeze to learn.

The ease with which this language can be picked up is exemplified by the book, since it's one of the shortest books I've ever read on a programming language. Over half of the book has more to do with examples, applications, and other stuff tangential to CoffeeScript, rather than the language proper. The book itself is just short of 100 pages while the content on syntax and usage of the language is condensed into the first half of the book.

As all books like this do, the first chapter starts out with how to install the language and configure the environment. It's pretty straightforward stuff. Then, we get into all of the syntax changes that CoffeeScript brings to JavaScript, which essentially defines the language since all of the features are the same as JavaScript's. Chapter 2 shows how function and variable declarations are different, and much shorter. Chapter 3 demonstrates some nice syntactical sugar for arrays in the form of ranges, and iteration can be done more flexibly with for comprehensions. Chapter 4 gets into the syntax features for defining classes and doing inheritance concisely.

Most of the syntax will look quite familiar to Rubyists, including class instance variables denoted with an '@' prefix, the string interpolation notation, unless conditionals, and array ranges. Here's an example from the book showing a number of the syntax features:

class Tribble
constructor: -> # class constructor definition
@isAlive = true # instance variable definition
Tribble.count += 1 # class variable access

breed: -> new Tribble if @isAlive
die: ->
return unless @isAlive
Tribble.count -= 1
@isAlive = false

@count: 0 # class variable (property)
@makeTrouble: -> console.log ('Trouble!' for i in [1..@count]).join(' ')
This code would be about twice as many lines in JavaScript, so the compression is pretty great and the code is much cleaner and easier to understand. Burnham proclaims these virtues of CoffeeScript early on in the book:
Shorter code is easier to read, easier to write, and, perhaps most critically, easier to change. Gigantic heaps of code tend to lumber along, as any significant modifications require a Herculean effort. But bite-sized pieces of code can be revamped in a few swift keystrokes, encouraging a more agile, iterative development style.
Maybe that's stated a bit more strongly than is warranted, but it's still hard to argue with the improved simplicity and cleanliness of CoffeeScript making developers' lives more pleasant.

The last three chapters of the book delve into different frameworks and packages in the JavaScript universe that can be used with CoffeeScript, and the vehicle for exploring these things is a (heavily) stripped  down version of the Trello app. Chapter 5 goes through how to create the front-end portion of the app with jQuery and Backbone.js. Chapter 6 adds a backend server for the app with Node and Express. Chapter 7 explores how to test the app with Intern. All of the code for the front-end, backend, and tests is written in CoffeeScript, and the transpiling is setup to be managed with Grunt. It's nice to see multiple different examples of how to use CoffeeScript anywhere that JavaScript would normally be used, just to get an idea of how to transition to CoffeeScript in multiple ways.

Throughout the book, Burnham presents everything in a straightforward, no-frills manner. Everything is clear and logical, and his concise descriptions are part of the reason the book is so short. He assumes you already know JavaScript—which is much appreciated—and he doesn't go into extended explanations of JavaScripts features. It's just the facts on how CoffeeScript is different and what the syntax is for the features it compresses. It's awfully hard for me not to recommend this book simply because it's so short and to the point. It only took a few hours to read through, and now I know a better way to code JavaScript. There's not much more I can ask of a programming language book.

Simplifying JavaScript


Every language has those more advanced books that assume you already know the language and instead of covering the basics and syntax, it provides advice on how to write idiomatically in the language. I've read these books for C++, Ruby, and JavaScript and found them to be surprisingly enjoyable to read. That was not the case with this book, but before I get too far into criticisms, I should summarize what this book does well.

Simplifying JavaScript is organized into ten chapters with each chapter broken into a set of tips that total 51 tips in all. These tips each explain one new feature of the JavaScript language from the new ES5, ES6, and ES2017 specifications. Some features, like the spread operator take multiple tips to fully cover. Then, the last chapter covers some features of the JavaScript development environment, like npm, that are not part of the language and have been around a bit longer than these newer specifications.

Most of the new features significantly improve and simplify the language, and they include things like:
  • new variable declaration keywords const and let
  • string template literals, which look much like Ruby's string interpolation
  • the spread operator ... for converting arrays to lists and converting lists of parameters to arrays
  • the Map object
  • the Set object
  • new loop iterators such as map(), filter(), and reduce()
  • default parameters
  • object destructuring
  • unnamed arrow functions
  • partially applied functions and currying
  • classes
  • promises and async/await
The arrow functions, spread operator, loop iterators, and destructuring go a long way in making modern JavaScript much more pleasant to program in. All of these features—and likely more in the newest language specs—make CoffeeScript nearly irrelevant, and likely not worth the effort of going through the step of compiling to JavaScript. The language has really matured in the last few years!

Morgan does a nice job introducing and justifying the new features at times:
We spend so much time thinking and teaching complex concepts, but something as simple as variable declaration will affect your life and the lives of other developers in a much more significant way.
This is so true. The code we're reading and writing every day has hundreds of variable declarations and usages, and being able to indicate intent in those declarations makes code much cleaner and more understandable. Getting better at the fundamentals of the language and having these new declarations available so that the most common code is clear and purposeful will more significantly improve code than all of the complicated, esoteric features that only get used once in a blue moon.

These exciting new features and simple explanations were the good parts, so why did I end up not liking this book much? Mostly, it was because of how long-winded the explanations were. Each tip dragged on for what felt like twice as long as it needed to, and the book could have easily been half as long. CoffeeScript showed how to present language features in a clear, concise way. This book took the opposite approach. Then, to make matters worse, it was written in the second person with the author always referring directly to the reader with you this and you that. Normally I don't mind a few references to you, the reader, every now and then, but this was constant so it became constantly aggravating.

Beyond the writing style, some of the justifications for various features didn't hold much water. For example, when trying to rationalize the new variable declarations, Morgan presented an example of code where the variables are declared at the top, and then there are a hundred lines of code before those variables are used again. Then he says, "Ignore the fact that a block of code shouldn't be 100 lines long; you have a large amount of code where lots of changes are occurring." I don't know about you, but I wouldn't declare a variable and then not use it for a hundred lines. I would declare it right before use. He shouldn't have to contrive a bad example like that to justify the new const and let declarations. The improved ability to relate intent in the code should be reason enough.

In another example for why one must be careful when testing for truthy values in a conditional, he shows some code that would fail because a value of 0 is falsey:
const sections = ['shipping'];

function displayShipping(sections) {
if (sections.indexOf('shipping')) {
return true;
} else {
return false;
}
}
Ignoring the fact that I just cringe at code like this that returns a boolean value that should be computed directly instead of selected through an if statement, (don't worry, he corrects that later) there is much more wrong with this code than just the fact that an index of 0 will incorrectly hit the else branch. In fact, that is the only case that hits the else branch. Whenever 'shipping' is missing from sections, indexOf() will return -1, which is truthy! This code is just totally broken, even for an example that's supposed to show a certain kind of bug, which it does almost by accident.

Other explanations were somewhat lacking in clarity. Late in the book, when things start to get complicated with promises, the explanations seem to get much more brief and gloss over how promises actually work mechanically and how the code executes. After having things explained in excruciating detail and in overly simplistic terms, I was surprised at how little explanation was given for promises. A step-by-step walk through of how the code runs when a promise executes would have been quite helpful in understanding that feature better. I figured it out, but through no fault of the book.

Overall, it was a disappointing read, and didn't at all live up to my expectations built up from similar books. The tone of the book was meant more for a beginner while the content was geared toward an intermediate to expert programmer. While learning about the new features of JavaScript was great, and there are plenty of new features to get excited about, there must be a better way to learn about them. At least it was a quick read, and refreshing my memory will be easy by skimming the titles of the tips. I wouldn't recommend Simplifying JavaScript to anyone looking to come up to speed on modern JavaScript. There are better options out there.

Thursday, February 20, 2020

Bulls & Bears Board Game On Kickstarter



Bulls and Bears is a financial board game from 1988. The first version of the game sold over 10,000 copies. I have talked with the designer on a few occasions and I may be helping him to turn the game into something more Euro-style. In the meantime, they are kickstarting a new version of the original game, called Trumponomics vs. Bernienomics (yeah, okay).

It has the usual roll-and-move mechanics, with a few clever additions that make it better than other games of its type.

For one thing, trivia questions are informative about stock market topics, but rather than simply answer them, you react to events by putting your money down or taking actions, after which the result of the event (what went up or down in the world as a result of the event) is revealed, and you gain or lose by it. As such, the mechanics of learning about the stock market are integrated right into the play, which makes for both better learning and a better play experience.

Unlike Monopoly, the game ends and is won when someone reaches $200k, which means less direct competition and a game that doesn't drag on. There is already a Euroish feel in that you are building a kind of economic engine through your investments.

Topics include financial markets, commodities, insurance, housing, mortgage, retirement, and so forth. The designer has a PhD and worked at the world bank for many years. Their website includes online play and guidebooks for educators.

This new edition is a roll and move game, like the original, which is what it is. But if you like non-gamer games, and you actually want to learn real financial information with a game that's actually fun to play, this may be your thing.

Buds, Blooms, And Thorns Review Of Island Hopper By Eagle-Gryphon Games

Buds, Blooms, and Thorns Review of Island Hopper by Eagle-Gryphon Games
DisclaimerSupport me on Patreon!
Vitals:
Title: Island Hopper
Designed by: Scott Almes
Publisher: Eagle Gryphon Games
MSRP: $50
2-6p | 30-45 min | 8+

Introduction:
You and your friends all make a living by selling goods amongst a chain of beautiful tropical islands. Sounds great, right? Well, there's a problem. None of you are successful enough to buy your own seaplane, so you all pitched in and bought one together, which means that each day you all have to use the same plane to make all of the day's deliveries – and some of you aren't going to get paid. To make matters worse, the plane is in such disrepair that the instrumentation is broken, the compass demagnetized, and the windshield is covered in cracks, duct tape, and the remains of a few unfortunate seagulls, so the pilot might as well be flying blind...

Each day in Island Hopper, players auction off the Captain's seat; the player who becomes the Captain is in charge of flying the plane for the day, but cannot make any deliveries of their own. To make their deliveries, the other players bribe the Captain to fly to the islands to which they need to go, thereby earning themselves cash. When it's time for the Captain to fly, the Captain must close his eyes, pick up their goods tokens, and attempt to land them in an island's harbor. A successful landing means that players can fulfill their contracts and the captain collects his bribe — but if the goods splash into the sea, you might find yourself under water...

—description from the publisher

Blooms:
Blooms are the game's highlights and features.  Elements that are exceptional.
  • A silly combination of dexterity and social interaction with a fun bidding mechanic.
  • There are fun, strategic choices to make.
  • The artwork by Kwanchai Moriya is whimsical and the components are top notch.
  • There are lots of moments for laughs, as long as you don't take the game too seriously.
Buds:
Buds are interesting parts of the game I would like to explore more. 
  • This game isn't for everyone, but if you like social interaction and light strategy, give it a shot!
  • Having limited chances to say a single word has pros and cons.  On one hand, it prevents people from just shouting things out randomly, on the other hand, with certain players it results in no one saying anything.  It might be fun to try playing without the direction tokens and let the pilot have to figure out directions from a cacophony of different instructions.
Thorns:
Thorns are a game's shortcomings and any issues I feel are noteworthy.
  • The game is simple enough, but the rulebook could have used a few more runs by a proofreader.  There are a few typos and phrases that seem to be left over from the prototype (referring to coins as cubes, for example), the terms 'round' and 'phase' are used interchangeably, and there are a few details that seem to be missing (like what triggers the end game).
  • We found players hands tend to either rise from the table or drop closer to the table, so some players tend to drop the goods from higher up, resulting in more bounces and less successful landings, while others are almost placing the goods right onto the islands.  2-3 inches is an ideal height, but it's difficult for everyone to be consistent.
  • While the art throughout the game is pretty nice, the coins are super generic.  They're functional, but about as plain as could be.
  • There is a very high amount of luck in the game, particularly for what contracts and passengers are available to draw.
  • Missing from the rules is what the ruling should be (success or not) if a good is on an island and coins.  Not touching the table, but definitely supported by the coins surrounding the island.  We've been playing that the coins become an extension of the island (thus making it even more attractive to try to fly to), but there's no discussion of this in the rules at all.
Final Thoughts:
Island Hopper is the type of game that needs a very specific audience.  It's quite fun if people are willing to be goofy and silly, but it's not going to work well with people that are very analytical or strategic.  There is a bit of strategy, but it's overshadowed by some silly dexterity mechanics that can leave your best laid plans sunk in the water after a bad bounce.  If you go into the game understanding that the joy comes from the experience, regardless of if you win or lose, you'll have a good time.  This isn't a perfect game; there are some fiddly aspects to it, and for as casual as it is, there is a lot going on outside of the primary mechanics.  Whether you feel this enhances the game to move it up a notch from just a casual dexterity game, or just gets in the way of a silly dexterity filler is up to you and the group you play with. 

This is a great game to play with the family, particularly the 8-15 age range.  I think the 12+ age limit is quite a bit higher than necessary - there are no complex mechanics or concepts.  Probably the limiting factor is how far across the table the players can reach since the islands can be spread out a bit.  I think if you like games like Colt Express, Junk Art, or similar light, silly games, Island Hopper might be a good choice for you!

Buds, Blooms, and Thorns Rating:
Bud!  This game definitely has some
great moments.  It's good for several plays
and should appeal to most gamers, especially
if you enjoy other games like this.
Pictures:



As usual you can download the game here. Also don't forget to head over to our forums to provide some feedback to the developers.


Code License: GPLv3
Assets License:
CC BY-NC-SA 3.0

Thursday, February 13, 2020

Brave Browser the Best privacy-focused Browser of 2020



Out of all the privacy-focused products and apps available on the market, Brave has been voted the best. Other winners of Product Hunt's Golden Kitty awards showed that there was a huge interest in privacy-enhancing products and apps such as chats, maps, and other collaboration tools.

An extremely productive year for Brave

Last year has been a pivotal one for the crypto industry, but few companies managed to see the kind of success Brave did. Almost every day of the year has been packed witch action, as the company managed to officially launch its browser, get its Basic Attention Token out, and onboard hundreds of thousands of verified publishers on its rewards platform.

Luckily, the effort Brave has been putting into its product hasn't gone unnoticed.

The company's revolutionary browser has been voted the best privacy-focused product of 2019, for which it received a Golden Kitty award. The awards, hosted by Product Hunt, were given to the most popular products across 23 different product categories.

Ryan Hoover, the founder of Product Hunt said:

"Our annual Golden Kitty awards celebrate all the great products that makers have launched throughout the year"

Brave's win is important for the company—with this year seeing the most user votes ever, it's a clear indicator of the browser's rapidly rising popularity.

Privacy and blockchain are the strongest forces in tech right now

If reaching 10 million monthly active users in December was Brave's crown achievement, then the Product Hunt award was the cherry on top.

The recognition Brave got from Product Hunt users shows that a market for privacy-focused apps is thriving. All of the apps and products that got a Golden Kitty award from Product Hunt users focused heavily on data protection. Everything from automatic investment apps and remote collaboration tools to smart home products emphasized their privacy.

AI and machine learning rose as another note-worthy trend, but blockchain seemed to be the most dominating force in app development. Blockchain-based messaging apps and maps were hugely popular with Product Hunt users, who seem to value innovation and security.

For those users, Brave is a perfect platform. The company's research and development team has recently debuted its privacy-preserving distributed VPN, which could potentially bring even more security to the user than its already existing Tor extension.

Brave's effort to revolutionize the advertising industry has also been recognized by some of the biggest names in publishing—major publications such as The Washington Post, The Guardian, NDTV, NPR, and Qz have all joined the platform. Some of the highest-ranking websites in the world, including Wikipedia, WikiHow, Vimeo, Internet Archive, and DuckDuckGo, are also among Brave's 390,000 verified publishers.

Earn Basic Attention Token (BAT) with Brave Web Browser

Try Brave Browser

Get $5 in free BAT to donate to the websites of your choice.