Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hasenj
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
91.
▲
by
hasenj
9y ago
Docker is its own nightmare :/ I just find it weird and confusing. Also, how do you setup a database in docker? Docker does not support persisting data as far as I know. So if you need to restart the thing, all the data will be wiped.
92.
▲
by
hasenj
9y ago
Strictly speaking, SQLite is dynamically typed in a sense, because the database does not enforce the values in the rows match what the columns claim about the type. But from a developer experience point of view, the main difference between
93.
▲
by
hasenj
9y ago
It's really weird to have to write on every request. If you're logging user visits for example, you can queue those up in a list (in the code) and flush it to the database every few seconds instead of flushing it on every visit.
94.
▲
by
hasenj
9y ago
I think it's not used widely enough yet. For example, 99% of websites could benefit from using SQLite instead of MySql or (god forbid) PostgreSQL. I mean Postgres is a fine piece of software but if your website gets 500 visits a day, y
95.
▲
by
hasenj
9y ago
Did you consider a simple build script, e.g a make file or a nodejs script that just manually pipes the files in your codebase to the desired compilers/transpilers? That's how I always set things up and I never once wished for any
96.
▲
by
hasenj
9y ago
There was a service a while ago called "clarity" or something like that, which was supposed to facilitate this kind of activity. EDIT: It seems to still be in business at clarity.fm, though it seems to be more aimed for startups t
97.
▲
by
hasenj
9y ago
Why is Slack being an Electron-based app more tolerable? I find it absurd that you need a whole browser to make a chat app.
98.
▲
by
hasenj
9y ago
It was slow because at first I put the import inside the function. Moving it out improved the python performance to 20ms (as I mentioned in another comment). The javascript version runs in 15ms. > In the real world, things like haversin
99.
▲
by
hasenj
9y ago
Writing documents is a use case for the general public. Writing code is not the same. In general, programming tools _are_ getting better (text editors, debuggers, IDEs, etc). The only barrier to non-programmers is learning how to program. I
100.
▲
by
hasenj
9y ago
Opening pubished documents seems to take a relatively long time? Example, page with no content except "This is a test" takes over 3 seconds to load. https://www.airbornos.com/pub#?f=c8d42cd38bfc2c26/87261eeee8
101.
▲
by
hasenj
9y ago
> I think the future of programming (or I should say, one branch of it) is making programming easier, and letting the computer do more work. I think this is already what is happening. Computers now are orders of magnitude faster than t
102.
▲
by
hasenj
9y ago
If I make software that enables you to create things, then the software is mine and I can charge you for using it, but what you make using my software is yours and you can do whatever you want with it. Doing it the other way around is wrong
103.
▲
by
hasenj
9y ago
Am I the only one who things this is a really really bad idea? The world does not need more interpreted languages on the backend. Visual UI layout is cool for beginners but almost useless for serious projects. Plus if you're a beginner
104.
▲
by
hasenj
9y ago
What's wrong with TypeScript?
105.
▲
by
hasenj
9y ago
There's rarely a need for a language with anything "new". There's a strong need for a language that brings the best ideas recently developed and puts them together in a new language that does not have baggage from the pa
106.
▲
by
hasenj
9y ago
How would this ever cause dystopia?
107.
▲
by
hasenj
9y ago
It relates because we are not talking about scripting. We are talking about programming. Python/Ruby/etc.. are slow. D/Go/C/Rust/etc.. is fast.
108.
▲
by
hasenj
9y ago
D and Go compilers can both run a script seamlessly without a visible compilation step (it still happens, but behind the scenes, and compilation is fast enough that you would not even notice it).
109.
▲
by
hasenj
9y ago
Sounds like you have a lot of unnecessary cruft in your infrastructure.
110.
▲
by
hasenj
9y ago
I cannot edit my previous comment but just now I revisited the code and noticed there was an import inside the function measuring the distance. One I moved the import out of the function, the execution time was cut by a bit more than half,
111.
▲
by
hasenj
9y ago
It's a bit more complicated. I'm measuring geographical distances so I'm using haversine from math import radians, cos, sin, asin, sqrt def distance(lat1: float, lon1: float, lat2: float, lon2: float) -> float:
112.
▲
by
hasenj
9y ago
Our project at work is using 3.4 and full of legacy code, and typical python code always has something astonishing. I always use type hints when I write new code. Because 3.4 has no type hints for class member declarations I end up writing
113.
▲
by
hasenj
9y ago
The csv parsing is not part of the benchmark. The only thing I measured is iterating the list and matching entries within range of the input coordinate.
114.
▲
by
hasenj
9y ago
That's one of the biggest pain points. You look at code and you have no idea what is what. You have to be on your toes ALL THE TIME! Even when you are editing a method on a class you cannot safely assume that all the properties will ex
115.
▲
by
hasenj
9y ago
Yup! This is what I meant by "lacking compilation". For example, in Go, you can produce a single statically linked executable and run it on the server directly. No need for a dev-ops/infra team.
116.
▲
by
hasenj
9y ago
> Which specific code did you benchmark? I had a csv file with ~16k entries. Each entry has a lat, lon, name and id. The task: given a (lat, lon) pair, list all entries within 5km. The simplest straight forward solution is to iterate the
117.
▲
by
hasenj
9y ago
Fast would be something like Go or D or any of the other compiled languages.
118.
▲
by
hasenj
9y ago
Using these solution makes the development process much more troublesome than it needs to be, thus defeating the whole point of using python.
119.
▲
by
hasenj
9y ago
You don't even know whether it quacks or barks or what.
120.
▲
by
hasenj
9y ago
Python is optimized for small programs being easy and quick (and pleasant) to write. Every other use case it fails in some way. For being slow. For lacking static typing. For lacking compilation. For having a GIL. etc.
More ›