JavaScript Object and Array Explorers

If you’re starting out with object and array manipulations in JavaScript these handy tools by Sarah Drasner might come in handy. The reason they work so well is that it’s one page, and it’s driven by natural language.

JavaScript Object Explorer →
JavaScript Array Explorer →

Do not however that the yielded code mutate the original arrays/objects (thus aren’t immutable) … I feel a PR coming up 😉

15 Ways to Write Self-documenting JavaScript

javascript-logo-banner

A few handy pointers to keeping your code readable:

Some programmers include comments as part of self-documenting code. In this article, we’ll only focus on code. Comments are important, but they’re a large topic to be covered separately.

We can split the techniques for self-documenting code into three broad categories:

  • structural, where the structure of code or directories is used to clarify the purpose
  • naming related, such as function or variable naming
  • syntax related, where we make use of (or avoid using) features of the language to clarify code.

Many of these are simple on paper. The challenge comes from knowing when to use what technique. I’ll show you some practical examples as we tackle each one.

15 Ways to Write Self-documenting JavaScript →

Slate – Beautiful static documentation for your API

slate-api-documentation

Slate helps you create beautiful API documentation. Think of it as an intelligent, responsive documentation template for your API.

Slate – Beautiful static documentation for your API →
Tutorial: Writing API Documentation with Slate →

Related: Swagger, a dynamic documentation generator

Swagger

swagger-hero

Speaking of APIs and documentation in the previous post:

Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services.

Describe your API in a JSON file like this, and Swagger will turn it into that. Alternatively you can provide your project with Swagger Annotations and then run it through a parser (such as Swagger-PHP) to let it automatically generate the docs.

Swagger →
Swagger-PHP →

Related: Simple REST API Explorer, my attempt to quickly allow one to consume a RESTful/Hypermedia API.