Better HN
topnewbestaskshowjobs
Log inSign up

_davidchambers

40 karma · joined Apr 8, 2013 (13y ago) · 13 submissions

Submissions

comment 7mo ago · link · parent

From the readme on GitHub:

> A full-stack TypeScript CMS built on Astro and Cloudflare. EmDash takes the ideas that made WordPress dominant -- extensibility, admin UX, a plugin ecosystem -- and rebuilds them on serverless, type-safe foundations.

Someone should introduce the authors to the lovely em dash character. It's perfect for such sentences!

comment 2y ago · link · parent

SEEKING WORK • Berlin, Germany • Remote or on-site • Software developer

I'm a software developer with 13 years of experience. I love leveraging software to save people time. I have a background in (visual) design and consider design to be crucial to the development of all software (even software with no visible interface).

I have deep knowledge of JavaScript. I have also worked professionally with TypeScript, Python, and Haskell. I enjoy working with HTML and CSS. I know React, and I'm looking for an opportunity to learn htmx.

I have created Sanctuary (https://sanctuary.js.org/) and several other libraries. :)

https://davidchambers.me/cv/

comment 2y ago · link · parent

Location: Berlin, Germany

Remote: Yes

Willing to relocate: Possibly

Technologies: JavaScript, TypeScript, Python, Haskell, Clojure, Bash, SQL, HTML, CSS, React, htmx, functional programming

Résumé/CV: https://davidchambers.me/cv/

Email: dc@davidchambers.me

Author of Sanctuary (https://sanctuary.js.org/) and several other libraries. I love writing parsers and interpreters. I enjoy writing shell scripts more than is healthy (ShellCheck is amazing). I love hyperlinks and discovering web standards.

4.

JSX violates referential transparency(medium.com ↗)

9 points · by _davidchambers · 8y ago · discuss

5.

Seeking refuge from unsafe JavaScript(blog.plaid.com ↗)

11 points · by _davidchambers · 10y ago · 1 comment

comment 11y ago · link · parent

It's a contrived example, certainly.

Your counterexample is informative. I hadn't thought of exceptions in this way. The downside of putting everything in a `try` block, of course, is that we'll potentially catch exceptions arising from a bug in our code which should crash our program.

comment 11y ago · link · parent

These two functions are equivalent:

  const f1 = function(s) {
    let data;
    try {
      data = JSON.parse(s);
    } catch (err) {}

    if (data != null &&
        data.a != null &&
        data.a.b != null &&
        typeof data.a.b.c === 'string') {
      let x = parseFloat(data.a.b.c);
      if (x === x) {
        return x;
      }
    }
    return null;
  };

  const f2 =
  R.pipe(S.parseJson,
         R.chain(S.gets(['a', 'b', 'c'])),
         R.filter(R.is(String)),
         R.chain(S.parseFloat),
         S.fromMaybe(null));
Note that in the first function we have an unsafe expression,

  data.a.b.c
which we must guard with null/undefined checks. Unsafe expressions can easily get out of sync with their corresponding guards.

We can apply functional programming concepts to JavaScript code to obviate the need for null/undefined checks. The fact that we can't have all the benefits of FP in JS shouldn't dissuade us from taking advantage of the ideas which are applicable.

8.

Underscore v170.0.0 released(github.com ↗)

2 points · by _davidchambers · 12y ago · discuss

9.

Show HN: Nucleotides, the building blocks of JavaScript programs(github.com ↗)

2 points · by _davidchambers · 12y ago · discuss

comment 12y ago · link · parent

There's an off-by-one error in this thread's title. ;)

comment 12y ago · link · parent

https://github.com/davidchambers/dotfiles/pull/1

Fix for ugly `npm` output.

12.

Remove visually offensive rectangles from `npm` output(github.com ↗)

1 points · by _davidchambers · 12y ago · discuss

13.

Show HN: Publish npm packages with fewer screwups(github.com ↗)

1 points · by _davidchambers · 12y ago · discuss