HNHacker News
TopNewBestAskShowJobs

linkdd

2,632 karma · joined June 19, 2019

email: david.jose.delassus@gmail.com

  - https://link-society.com
  - https://krouter.cloud
  - https://flowg.cloud
  - https://linkdd.github.io
  - https://david-delassus.medium.com
submissionscomments
linkdd··on Please put units in names
Yes, thank you for the precisions, this just make my point stronger: int64/float are very ill-suited to represent such values.

And it's especially true for time units.

For example, "how many seconds is one month?" does not make sense, but "how many seconds is january/february/march?" does make sense. The unit "month" does not really exist, each calendar month is its own unit.

And "february" is not even a "stable" unit because sometimes it's 28 days, sometimes it's 29 days. Even a minute can some rare times be 61 seconds.

This is why in physics, we use seconds multiplied by powers of 10 and nothing else.

To my knowledge, there is not a single programming language that differentiate a "scalar" and a "quantity" (scalar, unit, error).

linkdd··on Please put units in names
Do you have a link to this utility?
linkdd··on Please put units in names
What they're suggesting is that `time.Duration` should not be an int64.

  1 second * 1 second = 1 second²
  1 meter * 1 meter = 1 meter²
  1 meter / 1 second = 1 m/s
Those are not user errors, those are physical values. A physical value is two things:

  - a scalar (int64, float, ...)
  - a unit (meter, second, inches, ...)
If the type system of your programming language does not allow you to define units, this should at least be a structure with a scalar and an enum, and functions to cast from one unit to another (if possible).

Working with units is a common thing in science.

linkdd··on Pointers and Memory Management in Python
There is good laziness:

  - Don't Repeat Yourself
  - Don't Reinvent the Wheel
  - ...
And bad laziness:

  - I don't want to do this because I need to be careful
  - I don't need/want to understand what's going on as long as it works
  - ...
The latter is what leads to most issues/bugs.
linkdd··on Pointers and Memory Management in Python
Wait until you see people saying "exceptions are glorified goto".

Basically, every statement of the form "X is broken and harmful" either don't understand X, or have read it somewhere else without giving a second thought.

X exists because it had some use at some point. Y and Z are implemented thanks to X. Now we no longer need to do X by hand. This does not make it broken nor harmful.

linkdd··on Pointers and Memory Management in Python
Yes pointers are hard to get right. No, depicting it as "broken and harmful" is not ok, even with good faith reading.
linkdd··on Pointers and Memory Management in Python
> Do we want to stop worrying about finicky correctness or pointers and worry about building more complex things? Probably yes also.

Which is why I mentioned the safe higher-level interfaces provided by programming languages.

Yet, I think it's important to learn about the lower level technology to better understand the higher level technology.

And definitely stop spitting on lower level technologies.

linkdd··on Pointers and Memory Management in Python
Once compiled to assembly, every data is accessed via pointers. Every data structure is represented with pointers. Almost everything is a pointer.

According to you, all softwares are broken and harmful?

Programming languages can provide a safe interface to pointers (just like Rust do with `Box<>`, `Rc<>`, `Arc<>`, or C++ in some ways with `shared_ptr<>` and `unique_ptr<>`).

Also, "Why not?" here clearly means "I did it for fun" / "Because I can".

linkdd··on Show HN: npm install actual-malware
This should be the default.

On Linux, packages should provide the SELiunx (or whatever) rules they need, and the user should accept them or not install the package (just like permissions on Android/iOS apps).

On Windows, the application could be sandboxed to its folder in `Program Files` and `%APPDATA%`.

Being secure by default should be the norm. When its not, you can tell users "you should do this" all you want, they won't do it.

linkdd··on Show HN: Create your own complete UI color system easy as 1-2-3
Awesome library and a very good README.

I usually suck at choosing colors and rely a lot on https://coolors.co/

Your library will complete my toolset to create some good looking UIs :)

linkdd··on Show HN: Goptional, an Option library for Go I made in half an hour
The main point of the Option type (and Result) is not because it panics when you call `unwrap`.

It's about all the operations you can chain with it:

  - and_then
  - ok_or_else
  - map
  - ...
This allows you to chain computations and "defer" the error handling at the end, without requiring exceptions/goto-jumps.

Your implementation, and the 10 others I've seen since the release, has strictly no advantage over using `interface{}` with a `nil` check.

Go 1.18 cannot have an Option type or a Result type because its generics are painfully too restrictive:

  - no switch on a generic type
  - method must have no type parameter
  - union types cannot be used for anything else than a type constraint
  - probably other things I did not notice yet
Clearly, the language designers don't want you to use functional abstractions like this, for some reason.
linkdd··on Show HN: HyperSudoku – Multiplayer sudoku puzzle every 15 min
Pretty nice,

But There is too much numbers given at the start. And I ended up on a sudoku with 2 possible solutions. At the end there were only 3 pairs of cells with only 5 and 8 in them. If the first one was a 5 it would work, if it was an 8 it would work. I typed 8 and got an error :/

linkdd··on What are your pros and cons of using Hugo?
I'm pretty happy with Hugo+Netlify, but I've never tried Jekyll.

Pros:

  - TOML syntax for Frontmatter data in markdown content
  - The `data` folder which can contain JSON, TOML, CSV, and YAML
  - The layout system, once you get used to it is pretty straightforward
Cons:

  - Go templating, I wish I had Jinja2 or the Django engine
  - Partials can't be used as shortcodes and vice-versa, this makes reusability tricky
  - URLs not ending with / use a redirection to the trailing / URL, which is not SEO friendly
NB:

  - I'm not using the pipeline system for assets, I use sass (scss) and lunr.js (search engine) separately to generate files in the `static` folder
  - For reusability, I'm using a homemade lib[0] to build web components
  - I've found themes and archetypes to be pretty useless
I've tried to setup Netlify CMS to allow a non-technical user to update the content of the website. But the experience was atrocious. It's still nowhere near a Wordpress. Which is pretty important if you want to put your "marketing website" in the hands of sales people.

  [0] - https://github.com/link-society/micro-web-component
linkdd··on Ask HN: How do I hack love?
You should resist commenting stuff like that too.
linkdd··on Ask HN: What front end framework do you recommend?
I would use Vue3 (with Pinia, vue-router and typescript). There is also the Quasar framework based on those tools which provide many components out of the box.
linkdd··on Req – An HTTP Scripting Language
not particularly interested, but highly curious to what is a "declarative client".
linkdd··on Ask HN: How did you learn to appreciate the beauty of mathematics?

  log(a*b) = log(a) + log(b)
Or: how to transform a multiplication into an addition.

  i^2 = -1
Or: multiplying by i is a 90° rotation on the plane

This was an eye opener for me. Math is designed to simplify things. To represent concepts in an easy way to read and manipulate and tinker with.

I tried at some point to invent an extension of the complex numbers to represent a 3D space with i and j, only to rediscover that this is not possible, you need to go deeper, with i, j and w to represent 3D rotations along an axis. and that's how i began reading about quaternions.

The beauty of maths is also the fact that it is kind of universal, even if it was invented.

linkdd··on Tech Sanctions: Companies like Disqus should revoke licenses for RT.com
I support free speech. I will fight misinformation with facts and argumentation. Not with censorship.

If a media of any kind starts to filter what I can see, I will loose trust in that media. Being blind to the opposing side, and being stuck in a bubble where everyone agrees with me is the perfect place for misinformation to spread.

> And political posts and comments on HN are everywhere

There is a difference between "i think that ... because ..." (expressing yourself) and "we should censor/attack/cancel ... because they are the bad guys" (propaganda).

linkdd··on Ask HN: How well do your front end and back end teams work together?
Documentation and communication is key.

The frontend team will be using the APIs provided by the backend. It should at least be fully documented to avoid unnecessary back and forth.

Regular "get together" meetings (remote or not, not necessarily with everyone) can help exchange pain points and prioritize issues. But not too often to impact productivity.

Basically, the backend team should know what the frontend team needs to consume. And the frontend team should know what the backend's technical limitations are. Trust in each-others expertise is also important IMHO.

linkdd··on Ask HN: What are you favourite games?
Not in order:

  1. Kingdom Reborn: https://store.steampowered.com/app/1307890/Kingdoms_Reborn/
  2. Factorio: https://store.steampowered.com/app/427520/Factorio/?l=french
  3. Oxygen Not Included: https://store.steampowered.com/app/457140/Oxygen_Not_Included/
  4. Civilization 5: https://store.steampowered.com/app/8930/Sid_Meiers_Civilization_V/

Why I like them:

  1. I find it satisfying to build a large self-sustaining empire.
  2. I love programming, this game is like development but without the annoyances. I prefer the top-down 2D over Satisfactory/Dyson Sphere Program's 3D, you get a nicer overview of what's going on
  3. Dealing with heat/gas/fluid dynamics and logistics in this game is so fun.
  4. I enjoy conquering the world from time to time.
But my all time favorites are : All of the Zelda games. The lore, the music, the story, the gameplay, just perfect.
linkdd··on Tech Sanctions: Companies like Disqus should revoke licenses for RT.com
Please refrain from advocating for censorship, political agenda, or any other crap of that kind.

Fighting misinformation is not done by shutting up every one you deem (rightfully or not, this is not the subject) inappropriate.

And HackerNews should not be a place to spread political views. And if it is, I might as well go find another place then.

linkdd··on Tell HN: We should show "No to War" banners on our websites
In 2022, I made a resolution:

> I should focus on doing well what I know instead of badly doing what I have no clue about

Geopolitics is one of the thing I have no clue about. I won't take part in the pissing contest between USA and Russia that's been happening in Ukraine for the last 10 years.

I'll keep focusing on the tech, dev and ops. Because that's what I know.

linkdd··on Ask HN: Why don't more software projects use BitTorrent for downloads?
When distributing over torrent, you need at least one seeder with a good connection. You obviously. So you still need to host a server with your package on it, and configure a torrent client to seed it.

I know a lot of HTTP/FTP storage space providers, or I can just put my binary on Github (Github Pages, or Release asset), or host it on a CDN like netlify. I think there is more solutions than real numbers between 0 and 1.

But I don't know a single "torrent seedbox" provider. Setting it up yourself is not complicated, but since it's DIY, this alone explains why it's not more wide-spread.

linkdd··on Ask HN: Is Kubernetes the only alternative for being cloud agnostic?
> Do I need a load balancer? That’s nginx on a droplet

Multiple droplets and a keepalived/haproxy on each one if you don't want a Single Point Of Failure in your infra, being the load balancer.

> A database? That’s mysql on a droplet

And another one for backups, making sure your first droplet has 2 network interfaces, one used by your application, the other one used by your backup procedure so that it does not create too much latency.

Also, potentially multiple droplets if you want your database to be highly available so that you avoid yet another SPOF in your infra.

What you propose is fine for small needs, but it does not scale well unfortunately. I'd still recommend to keep things simple and avoid premature optimization though.

In my case, my production infrastructure runs on a k8s provided by DigitalOcean with one of their load balancer (provided by a k8s Service of type LoadBalancer). I have a droplet running a single-node k8s provided by k0s[0] for testing purposes.

I have a terraform to create the cluster and configure the DNS, then I developed klifter[1] (based on ansible) and klander[2] to provision my cluster via Github Actions.

  [0] - https://k0sproject.io/
  [1] - https://klifter.datapio.co
  [2] - https://klander.datapio.co
linkdd··on Ask HN: Is Kubernetes the only alternative for being cloud agnostic?
> Kubernetes is a waste of computer resources

Yes, because orchestrating storage volumes, network policies, redundancy, secrets, and containers on a cluster with potentially heterogeneous nodes (some might have a GPU, some might not), is a waste of resource

> you don’t need Kubernetes to have declarative infrastructure as code

True.

> Addicted to yaml? Ansible uses YAML

Yes, because rollbacks in case of failure are so easy to do with Ansible. And who cares about an API that is becoming wide-spread (to not say standard) so you don't have to relearn everything when jumping from project to project?

> your build steps and doesn’t leave detritus like an agent nor waste any target resources

Only if you wrote your playbooks properly. Which is hard.

> Avoid containers unless you have a specific reason for using them. It’s a silly trend, IMO

Yes, because who cares about isolations, reproducibility, and avoiding the "it works on my machine" when integrating your app on different OS with various configurations?

> I fail to see what anti-lock-in benefits either containers or Kubernetes provide.

This sums up your whole unhelpful comment.

linkdd··on Ask HN: Is Kubernetes the only alternative for being cloud agnostic?
It's up to you to decide where the "cursor" is on the "cloud agnostic spectrum".

As an example, let's say you can deploy your app as containers orchestrated with SystemD on an Amazon EC2 instance. Switching providers will require you to rewrite your whole deployment procedure but not the containerized application code. Your application is cloud agnostic, but not your deployment pipeline.

Now, let's say instead, you have an Helm chart to deploy to k8s, you can move from Google GKE, to Azure AKS, to Amazon EKS, to baremetal k8s, without modifying your Helm chart. Your package is cloud agnostic, but not your infrastructure.

If your application requires a PostgreSQL database, you can provide it with Amazon RDS, or by self-hosting it with KubeDB in a k8s cluster, or any other solutions. To your application, it would be changing the `DATABASE_URL` environment variable and running a migration script from the old DB to the new one. There is no true lock-in in that specific case.

In other words:

  - yes, using Kubernetes can facilitate the deployment of your app on your infra in a "cloud agnostic" way
  - no, using Kubernetes does not mean your whole infra is "cloud agnostic"
  - it's ok if parts of your infra is not "cloud agnostic", that does not mean you're "vendor locked"
linkdd··on Ask HN: Why is UI design in Unity so hard?
I like Game Maker Studio 2 a lot for 2D games.
linkdd··on Ask HN: What apps are teams using for irregular/spontaneous/frequent meetings?
Slack for each one of them. Google Meet if we need video. Teams/Zoom when some clients/partners sets up the meeting and is using this.
linkdd··on My team can't move off of using GitHub for project management
At my company, we use Trello and Pull Requests massively, Issues not so much.
linkdd··on Ask HN: Good Alternatives to VS Code?
There is Sublime Text which is quite nice.

Vim if you want to grow a beard (just kidding). It's quite powerful and can be turned into a complete IDE.

As a teenager, I used Geany on Linux, it was quite nice and the first editor I used with an integrated terminal.

← PreviousPage 13 of 29Next →