Readit News logoReadit News
rojoca commented on Ask HN: I love to be alone. But this loneliness is killing me    · Posted by u/endofreach
kenowi · 3 years ago
Find a nice Brazilian Jiu-Jitsu school nearby. BJJ will challenge your intellect and you will have friends all over the globe. No need to be sporty, this will come for free over time. Ken (IT nerd doing BJJ for 20+ years)
rojoca · 3 years ago
I would second this. A team sport is also a good option. There are always clubs/teams that take beginners.
rojoca commented on The case for bad coffee (2015)   seriouseats.com/the-case-... · Posted by u/srathi
rojoca · 3 years ago
You can enjoy all kinds of disgusting and / or ridiculous things when you have some adjacent emotional connection. It’s one of the best things about life, keeping in mind it can work the opposite way too.
rojoca commented on Django, HTMX and Alpine.js: Modern websites, JavaScript optional   saaspegasus.com/guides/mo... · Posted by u/czue
polyrand · 4 years ago
After reading some HTMX criticism, there's one point people seem to miss. Making HTML your application interface does *not* prevent you from having a JSON (or something else) API. If anything, it probably forces you to split your functions better. e.g:

  def get_user_data(user_id: int) -> Dict (JSON-looking data):
      ...

  def render_user_view(user_id: int) -> HTML:
      user_data = get_user_data(user_id)
      render_template("user_detail_view.html", context=user_data)
If you need the user data in a JSON API, nothing prevents you from exposing `get_user_data` as a JSON endpoint. You can also use WebViews in a mobile app.

People tend to overestimate the "interactivity" needs of their apps and underestimate what they can achieve by just swapping HTML. HTMX also lets you swap "Out of Band" [0]. This makes it easy to model more complex interactions (like "reactions"), for example, updating a counter somewhere else in the app when a form is submitted. Reactive frameworks can also become a Rube Goldberg machine if an app is not properly designed from the beginning. Then you start fighting rendering loops, build dependencies, components' side effects, etc.

Personally speaking, HTML-driven apps are not just about easy vs. hard development, it's also about your users [1]. Maybe a big React app runs fine on 8 CPU cores and 32 GB of RAM, but very often, your users just want to read some content, maybe submit a few forms, and leave. They may not want to download 2 MB of JS so that the page can render boxes with text, even more if your browser can already do that if you give it some HTML.

[0] https://htmx.org/attributes/hx-swap-oob/ [1] https://shkspr.mobi/blog/2021/01/the-unreasonable-effectiven...

rojoca · 4 years ago
Haven't used django for a year or 2 but used to use django-rest-framework's negotiation to get both json and html responses (was using inertiajs not htmx) and it worked pretty well. You can use decorators on the api methods to set things like templates. Here's an example:

  @inertia("User/List")
  @api_view(["GET"])
  def get_users(request,  **kwargs):
    // ...
    return Response(data={"users": users})
This can return JSON or HTML with the data injected.

rojoca commented on Is there such a thing as good taste?   paulgraham.com/goodtaste.... · Posted by u/tosh
rojoca · 4 years ago
Ira Glass has a practical take on the idea of exposing good taste (e.g. trying to paint like Bellini): https://youtu.be/X2wLP0izeJE where he talks about how your good taste informs you that the work you are doing doesn’t yet match your ambition, and that this can be both motivating and discouraging
rojoca commented on Unity is buying Peter Jackson’s Weta Digital for $1.6B   techcrunch.com/2021/11/09... · Posted by u/myth_drannon
TxProgrammer · 4 years ago
Unity doesn't have to be an Unreal competitor -plenty of Unity folks in the Indie market (but I guess that's not where the money is) but I suppose you are right-for me, its easier to work with Unity than Unreal as a developer and I hope Unity can catch up technology wise.. not sure how acquiring WETA helps them in that.. its a cool Visual FX studio not a technology company..
rojoca · 4 years ago
In the unity announcement they go over some of the tools weta have created: https://blog.unity.com/news/welcome-weta-digital
rojoca commented on TC39 Pipeline Operator – Hack vs. F#   benlesh.com/posts/tc39-pi... · Posted by u/jashkenas
jasperry · 4 years ago
I had never seen Hack's pipeline before, which uses an explicit marker ^ to indicate which argument the piped object goes to. This seems like a really cool idea--you can wire functions together any way you want without having to create lambdas. Do any other languages use anything like this?
rojoca · 4 years ago
Clojure has the as-> threading macro (probably borrowed from another lisp) where you can specify the placeholder:

  (as-> [:foo :bar] v
    (map name v)
    (first v)
    (.substring v 1))

rojoca commented on Super Follows   help.twitter.com/en/using... · Posted by u/mkeeter
rojoca · 4 years ago
Great, now the timeline is going to be full of "just tweeted X to my super follows, super follow me here: ...". Sounds like more ads.

I guess in fairness you probably don't want to follow people who tweet like this but these kinds of tweets will still be hard to avoid. I'd rather just pay twitter $x/yr for no ads.

rojoca commented on Immutability is not enough (2016)   codewords.recurse.com/iss... · Posted by u/jt2190
Aaargh20318 · 4 years ago
While making the state immutable made it more visible what code was affecting the state, the end result is still multiple pieces of code directly affecting what is essentially a global state. Sure, a copy is passed from one function to the next, but there is still one 'current' state and everything is messing with it directly.

The real problem here is not the mutability of the state, it is the ownership of it. Who is responsible for keeping the state internally consistent ? In this code the answer is: no one.

To solve his problem, there needs to be a clear owner of the state, and that code should be the only code directly affecting the state and and be responsible for keeping the state internally consistent.

Wether this 'owner' is a collection of functions that operate on a global state in a language like C, or on a state passed in and returned, or an object in an OO language, or whatever. Doesn't really matter.

For example. Moving the character and collision detection should not be two separate function that affect the state but that can be called separately (or in the wrong order) and keep the system in an incorrect state. Only the code responsible for modifying the state should do so, and it should guarantee to leave it in a correct state on returning. Moving without collision detection can leave the system in an incorrect state and thus should not even be a function that exists.

When designing a system this is always something I keep in the back of my head: who is responsible for what ? Once you have that clear, things become much easier.

rojoca · 4 years ago
This is what state machines/charts are for. They prevent you from entering invalid states, and take responsibility for all changes in state.
rojoca commented on Tailwind CSS JIT – The Next Generation of Tailwind CSS   github.com/tailwindlabs/t... · Posted by u/albingroen
pwdisswordfish8 · 5 years ago
> Ever needed some ultra-specific value that wasn't part of your design system, like top: -113px for a quirky background image? Since styles are generated on demand, you can just generate a utility for this as needed using square bracket notation like top-[-113px].

Congratulations, you have reinvented the style="" attribute.

rojoca · 5 years ago
You can’t do sm:hover:top-[-113px] in a style attribute
rojoca commented on A tech antitrust problem no one is talking about: US broadband providers   arstechnica.com/tech-poli... · Posted by u/elsewhen
andromeduck · 5 years ago
I think telecom is like power, the only way it can be split is by creating horizontal markets, emphasis on plural, and preferably along some natural lines to the fictional overhead such as generation/distribution in the case of electrical markets.

For communications I think the way to do it might be to create 3-4 levels of responsibilities and say that no single player can operate in more than a few levels at once and must offer their services via live public auction or standard public wholesale pricing.

For wireless the way I'd split is is: 1. Location/site management, aka who owns/manages the poles. 2. Operating the actual Networking/Peering equipment, networking to the site with permission of #1. 3. Consumer/retail such as MVNO; direct-use in the case of large businesses, or value-add aggregation/resale for intermediates.

For wired the way I'd split is is: 1. Global networking/peering. 2. Regional networking/peering. 2. Last-mile equipment/rights, servicing. 3. Consumer/retail, value-add etc.

The goal here being to reduce the barrier to entry for small players via horizontalization which increases competition but not draw too many hard lines so that players have some flexibility in organization and so that players in one level have the opportunity of punching through to an adjacent or skip level if it is being overpriced.

rojoca · 5 years ago
In NZ we have 2 levels, wholesale and retail providers. By law you cannot be both. The price paid by retail providers to wholesale providers is currently set by the commerce commission because the infrastructure being built and managed by the wholesale providers was heavily subsidised by the govt. The (4) wholesale providers are effectively regional monopolies but importantly cannot set their prices, and the retail providers compete on value-add services and price for which there is fairly healthy competition.

u/rojoca

KarmaCake day123March 30, 2011View Original