HNHacker News
TopNewBestAskShowJobs

smizell

112 karma · joined September 12, 2013

submissionscomments
smizell··on Ask HN: How do remote workers separate work and personal life contexts at home?
I've had successes and failures working four years remotely, so that's my disclaimer. But the key for me has been to have a dedicated space with a dedicated computer for work. If it's easy to work on the couch you'll do it, so try to never work outside your area (if you can). Only work in your work area.

Also, protect your personal time. Do simple things, like mark out your lunch time on your calendar and don't let meetings creep into it—you'll be surprised how much this can help. Stop work at a time like 5pm and propose alternate times when people schedule things after it. People are usually open to moving meetings and may have not considered your stop time. Time zones make this harder as it's hard to keep track of when lunch is for people. Meetings during personal times should be exceptions.

Try to keep work things off your phone, though that's easier said than done with things like Slack or email. They make it too easy to work without feeling like you're working. I'm failing here currently :)

These above are all things you can do as an individual. But I think the success will also depend on your team. If you are the only remote person, it will be harder than if everyone is distributed. You'll need to ask people to write more and act like everyone is remote because you'll miss out. I've found that if you're the only remote person, it helps if your team works from home a day or two a week so they have to work remotely.

To summarize, set clear boundaries and expectations with yourself and your team with how and when you work and try to move your team to be remote-first.

smizell··on Test Coverage is a Lie
Author here, great link—thanks! Do you know of any coverage tools that implement this?
smizell··on JSON isn't a good configuration language
The difference is that I am not proposing a Turing complete config language, but rather proposing to build configurations with plain old JavaScript (or whatever language you want). I think a good read about this thinking is by Martin Fowler on Language Oriented Programming [0], specially the section about internal DSLs.

Another interesting read is around the configuration complexity clock [1], in that over time we move from hard coding things to building configurations to coming full circle and hard coding things again. I like to think internal DSLs closes that loop well.

[0] https://www.martinfowler.com/articles/languageWorkbench.html

[1] http://mikehadlow.blogspot.com/2012/05/configuration-complex...

smizell··on JSON isn't a good configuration language
I wrote a little library for building DSLs in JavaScript [0] because of this very issue—JSON is not good for this kind of stuff. I want to be able to create small DSLs to solve problems rather than squeezing the language into a JSON format. I want the full power of a language AND the ability to serialize the semantics to send over the wire. Maybe we'll move toward that one day.

[0] https://github.com/smizell/treebranch

smizell··on Mark – A simple and unified notation for both object and markup data
I made my own little language called Geneva [0] for similar ideas but it acts as code and can be parsed as JSON. I also came up with a spec for doing this for HTML [1] (but no code to do this yet).

[0] https://github.com/smizell/geneva

[1] https://github.com/smizell/janeml

smizell··on Designing state machines
You might find it useful to spend some time looking into the hypermedia constraint of REST itself (i.e. hypermedia as the engine of application state). The point of REST is to represent state machines by including hypermedia links in the responses of the API. Those links describe the state transitions a client may invoke in a given state.

Instead then of mapping CRUD operations to HTTP, you would map your application semantics to HTTP methods via link relations. Link relations let you go as far past CRUD as you would like to go depending on your domain and allow you to describe your states and state machine.

I always think a good way to think about a hypermedia state machine is in the context of HTML. Consider a todo app example. You might enter the application and get an empty list of todo items. If you have permissions to add a todo, you might have a "create todo" HTML form. Once you use that form, that todo has a new form called "mark complete." Once invoked, that todo has new transitions called "mark incomplete" or "archive." Once archived, you might see a new form for "unarchive." All of this captures the state machine and transitions in the REST API itself using domain-specific semantics.

Of course, there are other ways of solving this problem, but REST with hypermedia is a great way to work with state machines. There are lots of hypermedia JSON formats out there if you're interested in exploring (e.g. HAL, Siren, Collection+JSON, etc.).

smizell··on How to Version an API
True. I would consider a continuous stream like that to not be helpful change management. But if you have to have continuous breaking changes like that, you would want clean cuts. My point is, find ways to evolve your API without breaking things.
smizell··on How to Version an API
Name it whatever you want. Point is, you don't have to plan for such a drastic change when a separate domain/subdomain will solve it for you.
smizell··on How to Version an API
I think you are right here. It takes two to tango, and if the clients are tightly coupled to the API, the best intentions for evolving slowly will fail. :)
smizell··on How to Version an API
That's true. However, I think this falls under YAGNI [0]. If you happen to get to a point where you have to change your an entire API rather than evolve what you have, you should consider it a new, separate API rather than instruct all client developers to plan for it up front. Plan for evolvability and handling changing requirements up front.

[0] https://martinfowler.com/bliki/Yagni.html

smizell··on How to Version an API
I personally like to think about managing change well rather than versioning an entire API. In this, API designers provide instructions on how APIs will evolve over time, how features will be deprecated, and how this process will be communicated to API consumers. Change management also includes recommendations for client developers on how to evolve along with the API and build clients that don't fail when something as small as a JSON property is absent or added. You don't necessarily need version numbers to do this.

An API version says to me that one day the entire API may introduce a major change that is separate from the current API. If you plan to never introduce a major change like this, you may not need a "/v1" in the URL.

Kudos to the author for putting together a nice article :)

smizell··on Stop the Daily Standup Meeting
For those who do daily standups via a Slack channel, I made a little tool to help me.

https://www.npmjs.com/package/onit

smizell··on New male contraceptive may be submitted for Indian approval this year
lol, the doctor mentioned this! That's hilarious. The timing was definitely a coincidence for me though.
smizell··on New male contraceptive may be submitted for Indian approval this year
Just to note, I'm seven days post-op on this procedure :) And while I did not take any meds, I was happy to be sitting in bed with an ice pack watching March Madness. So there was definitely discomfort.
smizell··on New male contraceptive may be submitted for Indian approval this year
Just to add, I don't want my comments to scare any males considering the option. If you are at the time in life to stop having children, and you have no condition preventing the procedure, it's really the best option and will more than likely not have any issues. It sometimes doesn't even require pain medication.
smizell··on New male contraceptive may be submitted for Indian approval this year
Just to note, vasectomies are no walk in the park, and should be treated as final rather than a simple contraception option (though they can be reversed, just not easily).

While you can go back to day-to-date activities after a few days, there is still extra time to heal fully. Pain can hang around for a long time in some cases—even years. Infection is also a big concern, so take it should be taken very seriously.

With all of that said, a vasectomy is a much better and simpler option than female sterilization for a majority of people and has a high success rate.

smizell··on A Visual Guide to What's New in Swagger 3.0
Total guess, but they may mean request bodies instead of response since GET and DELETE normally don't have request bodies.

However, I'm not sure there is a definitive answer on if that's true from an HTTP perspective. I also couldn't find it in a skimming of the OpenAPI 3.0 spec.

In the end, REST [1] itself does not prescribe either condition and the HTTP 1.1 [2] spec doesn't either.

> A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.

[1] https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc... [2] https://tools.ietf.org/html/rfc7231#section-4.3.1

smizell··on Arguments against JSON-driven development
Coupling your code to the JSON you receive over the web can lead to some interesting problems. If the system on the other end decides to make some change you are not expecting, it can lead to errors.

In JavaScript, a simple thing that helps is to use lodash.get and provide a path to the property you are wanting.

  lodash.get(someObject, 'path.to.a.property')
If the path isn't there, the lodash.get returns undefined. This is much nicer than getting the error "Cannot read property 'to' of undefined" when "path" isn't there.
smizell··on RDL: a lightweight system for adding contracts to Ruby
Very cool. I experimented with something similar in JavaScript.

https://github.com/smizell/snug

For me, it is useful for runtime checking data that may come across the web.

smizell··on Comcast injects JavaScript into webpages to show copyright notices to customers
I had a situation with our local ISP where they injected some banner on each page to let users know they were close to going over their bandwidth usage when they got to like 90%. I reached out to them and said this was essentially a man in the middle attack and that I didn't want messages injected. A week later they messaged me to say it had been removed.
smizell··on Dropbox API v2 launches
It is interesting that you request the /get_account link with a POST method.
smizell··on JavaScript query language to perform complex object searches
I've been working on library that creates a queryable structure for trees like this. I prefer writing normal JS than to having some query language for it.

  var obj = minim.toElement({
    a: 1,
    b: [
      {
        c: 1,
        d: 2,
        e: [ { f: 5 } ],
        f: 6
      }
    ]
  });

  // Results are [5, 6]
  var results = obj.find(function(value, key) {
    return key.equals('f');
  });
See https://github.com/refractproject/minim
smizell··on JavaScript query language to perform complex object searches
Or you could actually use XPath :)

https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/...

smizell··on JavaScript query language to perform complex object searches
It always feels like we keep reinventing Lisp. You could do something like:

  ['contains?', ['list', 1, 2, 3], 1]
Instead of:

  {
    $contain: {
      foo: 1
    }
  }, {
    foo: [ 1, 2, 3 ]
  }
smizell··on Lisp in Your Language
We're also working on a data format that allows for this use of arrays.

https://github.com/refractproject/refract-spec/blob/master/r...

We use it very similarly to how you would with Lisp, where the "element" may be a function of sorts.

smizell··on Lisp in Your Language
I wrote a very similar tool one time:

https://github.com/smizell/geneva

It is Lisp in JSON. I did it for fun, but thought it would a cool way to send instructions across the wire from the server to the client and back. Imagine validation rules that could be ready in any language with really very little parsing instructions.

smizell··on JSON Configurable Personal Site
I work at Apiary and we have a format called MSON for writing data structures in Markdown.

https://github.com/apiaryio/mson/

smizell··on GraphQL Working Draft
Got curious about how the spec is built. Source said:

> Built with spec-md

http://leebyron.com/spec-md/

smizell··on Why Lisp?
Ah, very interesting! Thanks for the link.
smizell··on Why Lisp?
I actually created a hybrid of JSON and Lisp called Geneva [1]. It was a fun weekend experiment. I totally relate to how the author feels

[1] https://github.com/smizell/geneva

Page 1 of 2Next →