Hacker Newsnew | past | comments | ask | show | jobs | submit | froderick's commentslogin

As an exclusive Firefox user, with really great ad blocking features, I didn’t notice that Chrome got worse on this front. I’m sorry to hear that. Perhaps it’s time for a change. Best of luck.


I already have functors, effectively, by writing sql queries in clojure with honeysql. The clojure data structures make behavior composition from reusable sql snippets easy, and the testing of sql snippets is just based on literals as the article describes. Works really well.


I’ve done the same with SQLAlchemy in Python and SQLKata in C#.

Sadly the whole idea of composable query builders seems to have fallen out of fashion.


If composable query builders have fallen out of fashion, that's news to me. I've used SQLAlchemy in Python fairly heavily over the years, it's gotta be one of the best out there, I plan to continue using it for many more years. And I've recently gotten my feet wet with Ecto in Elixir, I'm quite impressed with it too.


I wrote a bespoke scheme interpreter, then a virtual machine, a bytecode serialization format and a fun standard library. All in C. Totally useless for real work, not unique in any way, but really fun and great for learning. Sometimes useless shit is the best.


I love that kind of stuff!

In college I wrote an assembler, interpreter, and simulator for an 8-bit chip, the 8048. Got a four-credit "A" :-D

Later I read the C code for a Scheme interpreter -- Scheme 9 in Empty Space -- highly recommended! I bought the book. https://t3x.org/s9book/index.html


In my startup experience, the pager never really ends. I’ve got one eye on my alerts inbox, and one eye on John McLane complaining about California. Still, I would rather be doing what I want, the way I want it rather than spending my days paying lip service to who ever might be within earshot. To those that choose the hard path rather than the easy lucrative one, I salute you.


Question: Eat a cat

Answer:

Eat a cat is a game of tag in which a person who has the cat is "it" and must tag another person. For the song by the British rock band the Cure, see Eat the Cat.Eat a Cat Contents Rules Rules

One person has a cat and is "it", while the other players have to run to a specified point, usually a fence or wall, and remain there. The cat must then "eat" another player, by touching them, before the cat can be "eaten" itself. The cat may only touch one person at a time. In some variations, players may have to jump over the cat, rather than touch it. The cat may also have to eat two people in succession, before being able to eat itself. In some variations, the cat may have to "eat" an additional player, by touching them, before it can touch the person it is currently touching.


The surest way to get depressed is to worry about what everybody else is doing, and compare yourself to them.

My recommendation is to fill your mind——every waking moment——with ideas, plans, hopes that inspire you, that you want to chase whether anyone else ever sees or knows or appreciates. Things you’d chase on a desert island or the middle of Manhattan.

Then find people you can share them with, that can magnify what you love.

Occasionally you might find yourself tempted to make value judgements about what happens. Don’t do it. Things aren’t good or bad, wonderful or a waste. They just are. You can’t choose the thoughts that intrude, but you can choose how you respond to them. Practice choosing to respond by being in the moment, and making the moment be about pursuing something you love.

Most people I know are controlled by ideology. Imagined imperatives handed down from ancestors and influencers. Their loves take a back seat or remain undiscovered and they get old with regrets. What I propose is the opposite. Let the philosophies and values of the day burn. They can't offer you anything you can’t offer yourself. Make the things you love eclipse everything else around you. You only live once. This is your chance to be free.

Best of luck.


I think you will find that a great diversity of minds are attracted to this site, and for reasons you may not have considered. Curiosity is a giddy thing, and it is a fundamental part of what draws me here. If you read this site and see only the occasional jerk rather than the experience-driven insights, that is your misfortune. Maybe instagram is your thing. I hear they have a lot of cat pictures.


What makes you think the jerks are only occasional?


I've been reading this site fairly regularly since 2010. Not as long as many, but long enough to feel confident saying that though the cast is always changing, this site remains one of my favorite places to 1. discover things I hadn't considered previously 2. reevaluate my past decisions in a way that makes me thoughtful about future ones

It is partly the articles, but more the comments (and careful modding).

HN stands out as a great place to expand my awareness. There are people here with deep technical experience that care about the outcome of their conversations. The flame-bait and regressive behavior isn't the main thing going on, it is a sideshow. If that ever changes for me, I'm out of here.

The article fodder is not as interesting to me as it used to be, but there are gems, and the comments remain engaging.

Who knows, perhaps I'm one of the jerks? Perhaps I'm the dreamer that dreams the dream and am therefore the jerk expert? Hard for me to say, but I welcome your opinion.


Speaking as a reconstructed jerk, I have worked hard at not being one but sometimes it slips through the net.


We’ve been moving steadily to malli over the last 6 months. I have to say, programmatically composing malli schemas as values (rather than macros) is really powerful. I like being able to define a base set of fields on a map, and then merge in other schemas and different sets of fields that are required in different cases. Nice for modeling apis with reused structures but with varying field requirements.


Same here. Clojure offers a bunch of different invariants than ‘this field is a string’. Things like ‘nobody is modifying this complex data structure out from underneath you’ or ‘this complex value is trivially printable, readable, inspectable, comparable, diffable, etc’. And if you want to know for sure that field will be a string, you can spec it and enforce it where it matters. And ignore it where it doesn’t.


As an avid git worktree user, I use multiple checkouts for the same repo all the time. It avoids a lot of context-switching pain.


> git worktree

Thanks, you successfully blew my mind today when I searched what this was, and learned what it was. I can't believe I've been missing out on this.

I have an application for this command today in a work project that will allow me to leave work early, so thanks for the early weekend!


Can you elaborate on some use-cases? I'm finding it hard to imagine a situation where `git worktree add <path> <commit>; do_operation_in_path <path>; git worktree remove <path` is any different than `git checkout <commit>; do_operation_in_path <path>; git checkout -`


The code base i work on takes a long time to rebuild when crossing certain points in the history, so I have persistent worktrees for the last few versions that we still support. Lets me drop into an older version for a backport without the long wait.


Suppose you have one repo with branches main, v1 and v2 (for example, releases are made from these). The branches are there forever, they are very long running branches.

Some days you work with v1 and some days with v2, and sometimes with main. Sometimes fixes are quick, sometimes not. Sometimes you must switch the working branch while you are in the middle of doing something that is not quite finished.

If you need to change between v1, v2 or main, just change a directory. Done.

So for the above example, setting up this:

  cd repo
  git checkout -b main origin/main
  git worktree add ../v1 origin/v1
  git worktree add ../v2 origin/v2
I.e. having a separate worktree for each long running branch makes working with the branches so much easier.

Edit: formatting


Ah, got it, thanks! That explains why I was confused - I've never worked in a team where long-running branches were the norm.


You're forgetting the stash command in your latter example. God help you if you're doing anything more than switching to one other branch at a time to make one small change and returning.

Also, if you're unlucky enough to be using an IDE that doesn't always handle large codebase changes well (e.g., let's say... Xcode), then you've eliminated that problem too.


It lets you efficiently have multiple checkouts of different branches at once without duplicating the actual git storage. It also lets you leave a worktree where it is while working on another - for instance, you could have editor windows in different branches at the same time, which isn't an option if you only have one checkout and have to stash+checkout to switch branches.


It's indispensible for the case of `git worktree add <path> <long-running-branch>`.


To save others the search: https://git-scm.com/docs/git-worktree


Can you compare this with the alternative of creating a lightweight alternative repo with, say:

  git-clone --reference /existing/local/repo


I discovered this a few weeks ago and it completely changed how I work with repos for the better.


I learned a thing today. I had no idea this even existed but it's awesome.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: