Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tored
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
46 ms
·
511.
▲
by
tored
5y ago
I think you can use a string type with a regexp pattern.
512.
▲
by
tored
5y ago
Perhaps create your own custom type floatable that can be either be of type float, integer or string with a regexp pattern.
513.
▲
by
tored
5y ago
One thing I'm guilty of is designing a document format as JSON, thus the need to formally verify it. Passing data works well as JSON but documents works better as XML where you can use XML Schema.
514.
▲
by
tored
5y ago
When I used JSON schema last time a few years ago the different implementations of it in PHP and nodejs where either incorrect of feature incomplete. Seems like it is hard to get right.
515.
▲
by
tored
5y ago
Yes, the unspecified fields is a nuisance. It is hard to manually look at JSON data and compare it visually to a JSON schema because the schema has a depth to every property and lots of other cruft, which makes it somewhat cumbersome to ret
516.
▲
by
tored
5y ago
The big strength and at the same time big weakness of nodejs is the asynchronous event loop. If we ignore the cluster setup to get parallelism, concurrency in nodejs is done by running all request in the same thread by segmenting them and
517.
▲
by
tored
5y ago
Many governments use COBOL too, governments are theoretically rich, but they also have many holes to fill.
518.
▲
by
tored
5y ago
Only threat to Java is the success of the JVM, that Java could be replaced by another JVM language seamlessly, but the JVM itself will definitely be here and developed 50 years from now.
519.
▲
by
tored
5y ago
I guess another scenario could be if you need to import massive amount of schemaless data, like csv imports, then types can be a problem if the sender does not have clear definition of what type the data has, common problem when dealing wit
520.
▲
by
tored
5y ago
Interesting concept, but a guess that a file system is at a lower abstraction level than a database. Only argument that I can sort of understand for flexible types is that it is easier to get started or for smaller projects, like some batch
521.
▲
by
tored
5y ago
Can't say I agree on the notion that dynamic languages doesn't gain anything with strict typing. I have written a lot of PHP over the years and PHP has gradually introduced type hints for function parameters and return values. For
522.
▲
by
tored
5y ago
One thing the article doesn’t mention is that it takes massive amounts of energy to produce hybrit. LKAB (Government owned ore mining company) will require 55 TWh by the year 2045. That is more than the entire nuclear power production in Sw
523.
▲
by
tored
5y ago
I do agree that Sweden is good at PR when it comes to green policies, but I can’t really agree on all your claims. Cycling neglected? I guess it depends where you live in Sweden but in my city they have added much more bike paths (cykelväg)
524.
▲
by
tored
5y ago
Throw an exception. In PHP we would throw LogicException on these cases, it should never happen thus it something wrong with your code (logic). https://www.php.net/manual/en/class.logicexception.php Then in your o
525.
▲
by
tored
5y ago
Any examples of these gotchas?
526.
▲
by
tored
5y ago
This is what I usually do too, it works well for projects where user management is minimal and the only way to use the product is visiting the web site. I mail the user a login link with a tamper free token, clicking the link will give the
527.
▲
by
tored
5y ago
How exactly is it more difficult to write secure and quality software in PHP compared to other languages?
528.
▲
by
tored
5y ago
Typical västgötaklimax.
529.
▲
by
tored
5y ago
You don't need docker for running Laravel. You can install via composer https://laravel.com/docs/8.x#installation-via-composer Just make sure you have PHP and composer installed https://getcomposer.org&
530.
▲
by
tored
5y ago
What is status quo? Why is it bad? Why would it be free just because it is funded by taxes? It is true that it does exist some limitations on what kind of commercial interest the government can execute. Some by law (in Sweden for what a Kom
531.
▲
by
tored
5y ago
That is all true, but the government is incapable of commercialization, so there isn't an alternative reality where we would have consumer wide spread state network if it wasn't privatized. And I think it is there Chomsky is wrong
532.
▲
by
tored
5y ago
The big difference to the 80s compared to today, at least in the West, is the the Cold War. Cold War was a huge economic engine for state subsided private companies that not only produced defense material but also that innovation spread int
533.
▲
by
tored
5y ago
If you have decided to go microservices the most important part to have is good tooling to handle them. Log tracing over multiple services, how to get an address of another service, deploy services independently from each other, track deplo
534.
▲
by
tored
5y ago
As long as you don’t have any dependencies between the services. But as soon as you do, which is probably the case, you end up doing method calls over HTTP and you need to have a strategy for refactoring two services at the same time that c
535.
▲
by
tored
5y ago
No, what matters is user experience & user satisfaction. That is why this frontend churn is useless because it doesn’t improve either.
536.
▲
by
tored
5y ago
This is basically what PHP is. PHP can be deployed in several ways, CGI, FCGI or as threaded module in apache, but that rarely matters from the perspective of the programmer, the code will work the same regardless what you put in front of i
537.
▲
by
tored
5y ago
Unpoly looks really nice, something I need to investigate as a comparison against htmx. Server Side Events (SSE) is better option to websockets IMHO, it is a much simpler protocol so you can implement in any backend of choice with a few lin
538.
▲
by
tored
5y ago
Reactive changes with server side templates is less complicated than using a frontend framework. Just fetch the pre-rendered HTML fragment and put into the page. Done. And the good thing is that you can render a server side component either
539.
▲
by
tored
5y ago
It is definitely possible to do structured dynamic updates without page reloads with SSR because that is what we did 15 years ago before the JSON hype. I know because I worked with it then. The need to separate the team into frontend &
540.
▲
by
tored
5y ago
Great article but at the same time the absolute horror of what "modern" frontend development is. I do understand the need for React when building truly complex applications, like a spreadsheet or word processor app, but I wouldn&#
More ›