HNHacker News
TopNewBestAskShowJobs

edsrzf

436 karma · joined October 13, 2010

My GitHub: https://github.com/edsrzf
submissionscomments
edsrzf··on PHP Popularity: Is it decreasing and what to do about it?
The world that PHP grew up in has changed. The language and community have matured, and in the process PHP has lost most of its competitive advantage: low barrier to entry.

It used to be:

  * Moving from static HTML to dynamic server code was a matter of changing file extension and adding PHP tags.
  * Many shared hosting services supported PHP.
  * Deploying was a matter of copying files to the server.
Projects that started from HTML + PHP tags grew and became unmaintainable messes. The PHP community learned from this and evolved in a different direction. You can still _write_ PHP code in the old way, but it's strongly discouraged and (rightfully) seen as a bad practice. You don't even use PHP as a templating language anymore. Symfony and Laravel have their own templating languages that dynamically compile to PHP.

Modern PHP code looks very much like Java or C# -- classes, OO design patterns, and so on. Except in most ways, it's worse than Java or C#. Why would anyone start a new project in PHP?

Deploy models have also changed. You're usually not copying files to servers, but deploying Docker images or other formats. PHP has no particular advantage in this new world.

If PHP wants to turn things around, it needs to figure out what makes it unique or better than other languages. Right now, there's really nothing.

edsrzf··on Tell HN: GitHub leaked names of private repos with pages
I find it bizarre that urlscan.io displays recent scans from paying customers. I assume GitHub is large enough that they have to pay, anyway. If they're not, who is?
edsrzf··on Logging as a code smell
I agree logging is a bit of a code smell, but I prefer Mark Seemann's take: https://blog.ploeh.dk/2020/03/23/repeatable-execution/

TL;DR: Log impure actions. If you minimize and group side effects, you don't need to log as much. Pure functions can be recomputed any time if you know their inputs.

Event buses can be useful, but it's hard to look at an event being published and know what it does and whether it's important. Whereas the importance of a logger call is usually pretty clear. Logs are rarely load-bearing, but an event can mean anything.

edsrzf··on NPS doesn’t say anything particularly useful
Honest question: what science? Any good papers you could recommend?

After a quick search it seems that NPS originated in a Harvard Business Review article, which I don't consider a credible source of scientific results. The scientific papers I'm seeing mostly seem pretty skeptical, judging from the abstracts.

edsrzf··on New Zealand relied on science and empathy
I live in Auckland and the tech scene has really been booming in the last year or two. Obviously it's no SF bay area, and there are now companies struggling in the current economic conditions, but it may be worth another look in, say, a year.
edsrzf··on Rules for Autocomplete
This is pretty interesting and useful. Now where are the details about how to get ElasticSearch to behave this way? :)
edsrzf··on Relicensing React, Jest, Flow, and Immutable.js
The problem is that there actually are patents covering GraphQL. So anybody who writes an alternative GraphQL server implementation is potentially infringing upon those patents.

The issue with the GraphQL spec is that people actually want a patent grant for alternative implementations, but there isn't one.

edsrzf··on Benefits of named return values in Go
I normally hate it when people immediately trot out the old "premature optimization" quote, but it really applies here.

Please don't go around naming all your returns just because today's compiler happens to generate better code with them. This is a compiler issue that I'm confident will be fixed one day, especially if you do the right thing and file an issue.

But by all means, if you're profiling and your inner loops are actually slowed down by this, then make the change. And add a comment so that someone might be able to change it back some day when the compiler's improved.

edsrzf··on Ask HN: Alternatives to Vagrant for development environments?
Could you please link to some docs for the cached flag you mentioned? I can't find anything about it.
edsrzf··on From AST to Lossless Syntax Tree
I think calling it a "mess" is hyperbole, but yes, it's true that it has shortcomings and may be deprecated and replaced.
edsrzf··on From AST to Lossless Syntax Tree
The Go library's standard AST package[1] similarly stores comments and whitespace information. It has to, since it's used by gofmt, and you wouldn't be very happy you lost comments when formatting your code.

[1] https://golang.org/pkg/go/ast/

edsrzf··on Ask HN: Freelancer? Seeking freelancer? (September 2016)
SEEKING WORK - Auckland, New Zealand or remote

I'm Evan Shaw. I have been writing high performance, scalable backends and RESTful APIs in Go (Golang) for the last five years. I also have strong C and C++ skills, as well as experience with a variety of other languages and technologies. I'm good at diving into and making sense of unfamiliar code bases to add features, optimize, or refactor.

GitHub: https://github.com/edsrzf Email: edsrzf@gmail.com

edsrzf··on First chapter of Kernighan and Donovan's new Go book [pdf]
One non-obvious downside is that the Go 1 compatibility guarantee doesn't apply to struct literals that don't use field names. (I suspect you're aware of this, but other readers might not be.)

So it's possible that a future version of Go could add a field to some struct you're using and your code will stop compiling when you upgrade. It's an easy fix, of course, so it's not that big of a deal, but it's worth realizing.

edsrzf··on What Color Is Your Function?
> Suggestion that threads are way better than other asynchronous implementations.

I don't think that's true. The author mentions several languages that use different solutions:

* Java uses threads

* Lua and Ruby use cooperative multitasking with coroutines and fibers, respectively

* Go uses goroutines, which are coroutines multiplexed onto threads

There are definitely similarities, but not all are threads. The common element is that each solution involves keeping separate call stacks. (The author mentions this too.)

> You still have disjointed code.

I disagree. In Go, I can write an HTTP server that never uses the "go" keyword, yet it's still concurrent. This is because the net/http package handles the goroutines for me. With Node, I have to use callbacks no matter what.

edsrzf··on How my life was changed when I began caring about the people I did not hire
If you're agreeing not to sue, then the company can use any criteria they like to hire or not hire you and there are zero consequences.

Imagine you check the box, you don't get the job, and your feedback turns out to be "You're a man and we don't like to hire men." You have no recourse because you agreed not to sue.

You can argue that that's obviously illegal hiring criteria and you should be able to sue anyway, but then you're back to square one.

edsrzf··on Help improve gcc
There has been recent talk of it. See here for a link and (brief) HN discussion: https://news.ycombinator.com/item?id=8149810
edsrzf··on 33 Questions
Maybe something like "Do you have more older siblings than younger siblings?" would work. One twin has to be born before the other.

That question has some problems, but I feel like it could serve as the basis for a more specific question that would define how an only child or middle child would answer without introducing much bias. It would also have to define how half-siblings are counted and probably some other things.

edsrzf··on Why Cruise Ships are My Favorite Remote Work Location
I'm pretty sure it's the other way around: he wouldn't be launching a cruise deal aggregator site if he weren't so gung ho about working on cruise ships. http://tynan.com/cruisesheet
edsrzf··on Common Pitfalls in Writing Lock-Free Algorithms
Dmitry Vyukov keeps a great resource for learning about lock-free algorithms (and other interesting things) here: http://www.1024cores.net/home/lock-free-algorithms/introduct...
edsrzf··on 22 and no life
New Zealand offers a similar Visa, but you'll be better off in Australia if you want to make money.
edsrzf··on Why do game developers prefer Windows?
> Someone needs to nuke this site from orbit and build a new debugger from scratch, and provide an library-style API that IDEs can use to inspect executables in rich and subtle ways.

LLDB[1] can do this, but I'm not sure how far along it is.

[1] http://lldb.llvm.org/

edsrzf··on Fay -- A proper subset of Haskell that compiles to Javascript
Wikipedia describes a compiler as "a computer program that transforms source code written in a programming language into another computer language".

That certainly seems to describe what's going on here.

edsrzf··on Light Table Is On Kickstarter
Since it will build on top of CodeMirror, I assume it will run on any OS that supports a modern browser.
edsrzf··on JavaScript Needs Blocks
Interestingly, there are places where even Ruby doesn't follow Tennent's Correspondence Principle: the next and break keywords. They always act on the innermost block.
edsrzf··on A Programming Idiom You've Never Heard Of
This sounds fun. Is there a link anywhere?
edsrzf··on Goodbye, MMX Usage inside Qt possibly removed soon
I don't think he's saying that you need to stop using MMX to use AVX. I think he's saying that MMX is old and SSE is much better, especially on x86-64 where you're guaranteed to have at least SSE2.
edsrzf··on Clojure & Java Interop
Thanks! I'm totally fine with the fact that you left it out of the article. The little bit of a story you did share just made me curious.
edsrzf··on Clojure & Java Interop
Clojure and Java interop works and that's great. What's really interesting about this situation is that there's one guy committing code in a completely different language from everyone else. Not only that, but it's a language that most would consider "weird". How well is that received by the rest of the team?

Is anyone else picking up Clojure or is it "that one guy's crazy code that no one can understand"? I think we've all seen latter situation even when everyone's coding in the same language and it's a huge red flag.

I'm all for new and different languages seeing business use, but doing it this way seems potentially harmful. But maybe it was a huge success here; I'd love to hear more about it.

edsrzf··on Beyond Exception Handling: Conditions and Restarts
Here's a good explanation using pseudo-Java: http://axisofeval.blogspot.com/2011/04/whats-condition-syste...
edsrzf··on The Go Programming Language turns two
I work at Iron.io[1]. Our new SimpleWorker API[2] is written in Go and we'll soon be releasing another service implemented with Go.

[1] http://iron.io/

[2] http://blog.simpleworker.com/2011/11/simpleworker-has-shiny-...

Page 1 of 2Next →