Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

11–20 of 281 posts

Re: Re: Moving from PHP to Go and Back Again

#11
post #5
post #4

I don't know why the author bothered to even respond to that Medium article. The Medium article starts with that Go shines as a systems programming language. He lost me right there: how can a language with a garbage collector and a runtime be called a "systems programming language"?

"systems programming language" doesn't start and stop with bit twiddling one step removed from assembler. There's a huge fuzzy region between that extreme and "application programming as a semi-skilled trade", and go seems to fill certain "systems programming" needs adequately as far as that goes.

Languages like C and Rust are true system programming languages, and they are not one step removed from assembler. Rust has a very complex compiler. Go is a low level applications programming language.

Re: Re: Moving from PHP to Go and Back Again

#12
post #11
post #5

Earlier quoted context omitted.

"systems programming language" doesn't start and stop with bit twiddling one step removed from assembler. There's a huge fuzzy region between that extreme and "application programming as a semi-skilled trade", and go seems to fill certain "systems programming" needs adequately as far as that goes.

Languages like C and Rust are true system programming languages, and they are not one step removed from assembler. Rust has a very complex compiler. Go is a low level applications programming language.

This pedantic terminology fight about what constitutes a “systems” language hasn’t been worth having since 2009, when all of these arguments were already aired and resolved. Please find another hill to die on.

Re: Re: Moving from PHP to Go and Back Again

#13
PHP is unique in several ways: it's especially designed for the web, is a Web framework itself, comes with everything inbuilt, has C/Java syntax, has a shared nothing architecture, replaced VB as the most popular language for beginners, is used by most websites, is easy to use just drop a php file to Apache www dir. You simply can't objectively compare PHP to other languages because it's different to all others, it's unique. And due it's wide spread usage and earlier non-academic approach it still gets (rather unfairly) some bad reputation. Anyway PHP 7.2 is great, and Go too.

Re: Re: Moving from PHP to Go and Back Again

#14
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

Kotlin.

Re: Re: Moving from PHP to Go and Back Again

#15
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

PHP has object checking. This is why I started using value objects in PHP.

The VO's I use trow exceptions when you construct them with some bad value. This is great because when you use for example a natural positive integer object you are sure it is one.

So now I have 'type checking' and more secure code in PHP.

Re: Re: Moving from PHP to Go and Back Again

#16
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

I’d really like a strongly typed (or optionally typed) Python or Perl derivative. Rust feels most Perl-like so far.

Re: Re: Moving from PHP to Go and Back Again

#17
post #9

Earlier quoted context omitted.

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

I’d really like a strongly typed (or optionally typed) Python or Perl derivative. Rust feels most Perl-like so far.

Modern PHP is very nice to work with. Ignore the haters that haven't touched the language in 10 years.

Re: Re: Moving from PHP to Go and Back Again

#18
post #15
post #9

Earlier quoted context omitted.

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

PHP has object checking. This is why I started using value objects in PHP. The VO's I use trow exceptions when you construct them with some bad value. This is great because when you use for example a natural positive integer object you are sure it is one. So now I have 'type checking' and more secure code in PHP.

PHP also supports other type declarations. But using lots of value objects is a good idea anyway.

http://php.net/manual/en/functions.arguments.php#functions.a...

Re: Re: Moving from PHP to Go and Back Again

#19
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

https://nim-lang.org/

Re: Re: Moving from PHP to Go and Back Again

#20
post #9

Earlier quoted context omitted.

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

I’d really like a strongly typed (or optionally typed) Python or Perl derivative. Rust feels most Perl-like so far.

https://docs.python.org/3/library/typing.html

http://mypy-lang.org/

Post reply on HN