# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 8
# self = https://watcher.sour.is/conv/mhlemha

func isEven(n int) (bool, error) {
  if n <= 0 {
    return false, fmt.Errorf("error: n must be > 0")
  }
  return n % 2 == 0, nil
}


why this quite reminds me of node.js' is-even/is-odd
@novaburst Nope. In Javascript (the latest version) it's a fucking ugly ass looking function like this:

t
let isEven = n % 2 == 0;


How readable is that?! 🤦‍♂️ wtf is => anyway?! 🤦‍♂️
@novaburst Nope. In Javascript (the latest version) it's a fucking ugly ass looking function like this:

t
let isEven = n % 2 == 0;


How readable is that?! 🤦‍♂️ wtf is => anyway?! 🤦‍♂️
There's a famous quote (not by me) but I'll make it my own anyway 😂

> Source code is meant to be written and read by humans.
> Programs are meant to be executed by machines.

Fucking use a language that has good readability FFS 😂
There's a famous quote (not by me) but I'll make it my own anyway 😂

> Source code is meant to be written and read by humans.
> Programs are meant to be executed by machines.

Fucking use a language that has good readability FFS 😂
@novaburst Why exclude negative numbers and the zero from the even check? It's defined for all integers. @prologic Hmm, where's the arrow operator here? I can't see it in your code? And what part of that code is ugly? I don't get it.
@lyse Oh ! 🤦‍♂️ Somehow it got stripped out 😆 See what a bad idea arrow functions are 😂
@lyse Oh ! 🤦‍♂️ Somehow it got stripped out 😆 See what a bad idea arrow functions are 😂