Earlier quoted context omitted.
How is restarting a go-based server harder than restarting a PHP-based server?
You'll need the go process to complete all ongoing requests before restarting it. Whether that be RPC, HTTP, WS, etc. And this is behind a load balancer, so did you just go offline, or are you doing this one at a time? With PHP, you don't have to restart php-fpm or modapache. Just git-pull or FTP the new files in and the next HTTP request will automatically user the new version. Zero downtime. Honestly though, I expe…
Re: Moving from PHP to Go and Back Again
201–210 of 281 posts
Re: Re: Moving from PHP to Go and Back Again
#202Earlier quoted context omitted.
... curly brackets on new lines do work perfectly fine in case you're writing code on your own. As soon as you start working in a team and each team member starts to use their own formatting, it becomes super messy and unreadable. Either you inforce a clear style guide which leaves you to explain the team why your style is the best, or you leave this task to the language itself and never ever have to start arguing ab…
But why should Go enforce it on behalf of everybody? A parser option to not automatically insert semicolons would be all I need, but no. To me, even with super short lines, braces at the end of the line are messy, and consistently messy is still messy. > Either you inforce a clear style guide which leaves you to explain the team why your style is the best, or you leave this task to the language itself Which then leav…
Re: Re: Moving from PHP to Go and Back Again
#203Earlier quoted context omitted.
Why do you say that? I love both Perl and Rust, yet the latter doesn't feel very perlish to me.
Seems it’s optimized for developer enjoyment and is a big language that allows for terse expression, as well as a few ways to achieve the same thing.
Re: Re: Moving from PHP to Go and Back Again
#204I know this is about the weakest critique possible, but currently using Go, I know my next project won't be in it, simply for the impossibility to put an opening curly brace on its own line. Other languages that don't require semicolons at the end of a line have it, and even if they didn't, I'd rather have to put semicolons manually.. Go is "opinionated" I guess, but so am I. Whatever their target audience is, I'm no…
> impossibility to put an opening curly brace on its own line I sincerely wish all languages with braces would have this feature! Even Javascript devs practically standardized in always putting braces at the end of the line. I prefer working with code that mixes tabs and spaces than with the old-ancient style of spoiling a nice and clean empty line with a brace (yeah, you can just leave a line empty if you want your…
Re: Re: Moving from PHP to Go and Back Again
#205Earlier quoted context omitted.
You'll need the go process to complete all ongoing requests before restarting it. Whether that be RPC, HTTP, WS, etc. And this is behind a load balancer, so did you just go offline, or are you doing this one at a time? With PHP, you don't have to restart php-fpm or modapache. Just git-pull or FTP the new files in and the next HTTP request will automatically user the new version. Zero downtime. Honestly though, I expe…
This would be easily achievable by having 2 processes: one, which accepts the socket connections and relays them to the subprocess which does the actual work. New subprocesses could be started any time for updates, without killing existing connections. All new connections would be handled by the new subprocess.
Re: Re: Moving from PHP to Go and Back Again
#206Earlier quoted context omitted.
Since Xerox PARC, UK Royal Navy, DEC, HP Labs, ETHZ, Microsoft Research have implemented full stack OSes in GC enabled systems programming languages. At ETHZ Oberon workstations were used during a couple of years by several users across the department. Most of those attempts failed due to losing the political and financial wars of bringing them into the wider market, not because of lack of features.
very interesting. I would have thought that any practical kernel written in a language with a GC would either have unpredictable slowdowns or be exceedingly complex.
Re: Re: Moving from PHP to Go and Back Again
#207Earlier quoted context omitted.
... curly brackets on new lines do work perfectly fine in case you're writing code on your own. As soon as you start working in a team and each team member starts to use their own formatting, it becomes super messy and unreadable. Either you inforce a clear style guide which leaves you to explain the team why your style is the best, or you leave this task to the language itself and never ever have to start arguing ab…
But when the language/tooling enforces it, you've made language choice a proxy for style choice. A large part of what makes me stick to Ruby over Python for example, is that I can't stand languages with significant indentation. It may seem minor, but it isn't to me, to the extent where I avoid Python whenever I can. When your language enforces formatting like that, people will choose or choose away the language over…
What I can’t stand in other languages is the Laisser-faire attitude regarding styles. Some people put whitespace here, some there, some put the curly brace here, some there. How about some consistency across all codedbases?
Re: Re: Moving from PHP to Go and Back Again
#208Not always, but often, I find this attitude in developers who either refuse to read documentation, or just entrenched in their ways and too stubborn to try it someone else's way.
Is every project you're starting really so cutting edge that the problems others have solved and come to a consensus on don't apply to you? Perhaps, but maybe you should also be taking a look in the mirror and making an honest assessment on just how difficult you are to work with.
Re: Re: Moving from PHP to Go and Back Again
#209Earlier quoted context omitted.
This would be easily achievable by having 2 processes: one, which accepts the socket connections and relays them to the subprocess which does the actual work. New subprocesses could be started any time for updates, without killing existing connections. All new connections would be handled by the new subprocess.
So, basically what you get for free in erlang and PHP, but not in golang?
Re: Re: Moving from PHP to Go and Back Again
#210With Python - not so much. Sure, I can rent a whole VPS but I don't want to do server administration. And there are some options for hosting Django / Flask apps, but not many. Is it any wonder people still use PHP? I have used it for a long time and I hate the language - but it is hands down the best solution for small web pages where hosting is concerned.
EDIT: thank you for the downvotes. It was nice having a constructive conversation. But then again, I knew in advance it is unpopular to mention on HN that PHP, MongoDB and similar technologies have their use cases.