- Singletons are globals and should be treated the same as every other global (that is, used sparingly and with care).
Worse is that singletons enfurece a single instance which is almost always unnecessary. It’s trivial to only create as many instances as you need.
- I hate that singleton is first.
Singletons are just globals with extra steps, and have all the same problems globals have, just people (especially juniors) think they somehow are better.
In reality they’re worse because they conflate global access with enforced single instance. You almost never need to enforce a single instance. If you only want one of something, then create only one. Don’t enforce it unless it’s critical that there’s only one. Loggers are often given as an example of a “good” singleton and yet we often need multiple loggers for things like audit logs, or separating log types.
Instead of singletons, use dependency injection, use context objects, use service locators, or… just use globals and accept that they come with downsides instead of hiding behind the false sense of code quality that is a singleton.
- Once upon a time I tried to write such a decorator too in python 2.x and the byteplay bytecode disassembler library. I was trying to do the conversion at the bytecode level instead of transforming the AST. I believe I got as far as detecting simple self recursive functions, but never actually managed to implement the actual transformation.
- Just rename it to "JS" (jay-ess) and forget about having the letters stand for anything.
- Location: Ireland
Remote: Preferred
Willing to relocate: No
Technologies: Typescript (preferred), but experience in many others: Clojure, Clojurescript, Python, Java, C++, PHP, Postgres (preferred), MySQL/MariaDB, Redis, Terraform/opentofu, ansible, jenkins, docker, Telegram Mini Apps
Also interested in using, but no professional experience: Gleam, Elixir, Rust
LinkedIn: https://www.linkedin.com/in/irldan/
Email: hn [at] kersten.me
Hi, I'm Dan. I have a little over 17 years of professional experience, 25 years if you count as a hobbyist. I've worked in a large range of areas from telecoms, non-critical aerospace, embedded systems, analytics, blockchain, finance, and much in between. Mostly backend, but also frontend and full-stack. I have been cofounder of multiple startups, have led small teams and worked both as part of larger teams and solo. I have a strong love for technology and am passionate about software development, building things, and learning new things. Lately I have been tinkering with integrating AI into my hobby projects via the Vercel AI SDK, including my own experiments for agentic coding tools. I'm always happy to chat about technology or work.
- I used to tell it to always start every message with a specific emoji. Of the emoji wasn’t present, I knew the rules were ignored.
But it’s bro reliable enough. It can send the emoji or address you correctly while still ignoring more important rules.
Now I find that it’s best to have a short and tight rules file that references other files where necessary. And to refresh context often. The longer the context window gets, the more likely it is to forget rules and instructions.
- And Gleam
- I don’t want more conversational, I want more to the point. Less telling me how great my question is, less about being friendly, instead I want more cold, hard, accurate, direct, and factual results.
It’s a machine and a tool, not a person and definitely not my friend.
- I don’t want to talk to my documentation. I just want the facts searchable and easily readable.
- My mom likes stinging nettle soup, she used to make it occasionally when I was a child. I didn’t like it back then, no idea if I would like it now.
- It’s a flag. On its own, it doesn’t mean that the content was synthesized by AI, but if there are a number of these flags together, then chances are high.
No singular red flag means much in isolation, but it’s a signal that when combined with others can give a pretty good prediction.
- Just now I opened a medium site and before I could even start reading I was hit with a popup to download the mobile app, some other popup that I ignored (cookies I guess), and within a second or two, a full screen modal asking me to subscribe. Often I also get a pay wall. All within seconds of opening the site. If that’s not hostile, I don’t know what is.
Needless to say, I closed the tab. No content is worth dealing with that over.
Sure plenty of other sites do it too but “other people do it” doesn’t mean it’s not hostile nor does it excuse the behavior. Medium is and has always been one of my most hated sites because a lot of tech people post there, a lot of medium links are submitted to HN, yet it’s a horrible place for the reader.
- I’m obviously not seriously pushing to abolish time zones, just stating my personal opinion.
However, if it were somehow up to me, I’d would prefer a single global metric time.
- Sunrise varies greatly. In my country, it’s anywhere as early as 5am and as late as 10am (9am with DST)
That’s quite a range to sync to. At least syncing to noon, you don’t get much shifting throughout the year since sunset and sunrise shift roughly equally.
- It’s already late though. If you work in an office, you don’t see either the sunrise or sunset: it’s dark when I get to work and dark when I leave.
- Except even locally time is different for different people. People work nights, mornings, afternoons. Some shops open at 6am, others at 9am. Some people get up at 5, others and noon.
You still learn that x time is your time to do y, and people will quickly adapt to whatever number x happens to have.
We only associate 9am with anything because we learned to. We could just as easily learn a different number, and people with different work schedules do just that.
- I never found those arguments for keeping time zones particularly compelling. Everyone has their own schedule, trying to standardise time to sync people up is silly, you sync by talking to them and asking them what times they are available. The number on the clock doesn’t actually matter.
But DST affects us exactly because people tried to standardise on time AND then shift that meaning twice a year. If we ditched timezones, then businesses could say ok we will work from 1700 until until 0100 or whatever, based on time relative to sunrise, it it would be consistent all year round.
The thing is, regardless of timezones, you have to ask people what times they work or are available or whatever. Also consider that timezones are arbitrary and made up anyway: china physically spans the space of 3 timezones yet the entire country uses one timezone.
- > because that's the correct one
No it’s not. We assigned the meaning of time, we can assign it one hour shifted. Or better yet, just ditch timezones altogether.
Summer time is much better where I am, winter days wouldn’t get dark quite so stupid early.
I stopped using it because it was a bit too niche, I realised I’d likely never get to use it in any serious context, and instead I learned a slightly less niche but still niche Clojure.
I don’t regret the switch at all and have learned a lot from Clojure, and used it extensively for over a decade. Lately I’ve moved away from it though. Mostly to typescript, a little rust, and Gleam, which is an absolute joy to use.
I still have a soft spot for Factor and am happy to se wits still worked on. It was one of the most interesting languages I at one point played with.