News for hackers. Stuff that matters.
Re:My experience rewriting Enjarify in Rust by sethammons on Monday September 19, 2016 @11:32AM (#12532179)
I've not looked at Rust, but I've been using Go in production now for years at this point with non-trivial code bases. In our cases, they are mostly SMTP and HTTP servers. Sometimes the boiler plate gets in the way (and I think Go should almost never be used for simple CRUD stuff, there are better options), but I find the readability fantastic. It really dawned on my how readable it can be when I had to fix a missed condition in clean up on shutdown. It was fixed in an hour. For the perl version that the Go one replaced, it would have been a day before I even understood what would have needed fixing.
Re:My experience rewriting Enjarify in Rust by stormcrowsx on Monday September 19, 2016 @12:51PM (#12532791)
Really not a property of Go. Any codebase can be hard to follow if the designer wants it to be. It just happened that the Perl community went off the deep end and decided that tiny unreadable code was better than big readable code.
Re:My experience rewriting Enjarify in Rust by kbenson on Monday September 19, 2016 @01:19PM (#12533004)
> It just happened that the Perl community went off the deep end and decided that tiny unreadable code was better than big readable code.

That's one way to look at it. The other is that they embedded more syntax which makes the learning curve longer, but yields more more efficient writing and reading of code once you've fully internalized that syntax. The big mistake, IMO, was that they also made the language easily usable to get something done before you've fully internalized those rules, which leads to subtly wrong or weird programs that just work most of the time.

Perl is fundamentally different than most languages in how it uses context, but you can get away with not really understanding that at all by just learning a few rules-of-thumb. This, predictably, results in frustration in the writer, as they run up against what look like rough edges and weird idiosyncrasies in the language but are often just places where they've never actually learned how Perl really works.

That's not to say Perl doesn't have actual rough points and problems (what language doesn't after almost 30 years?), but contrary to popular belief, Perl is actually highly designed, and usually conforms to a few core principles (even it those principles are not what many other languages emphasize).

Re:My experience rewriting Enjarify in Rust by mbrock on Monday September 19, 2016 @05:27PM (#12534891)
It's worth keeping in mind that Perl, like its predecessors sed and awk, was intended among other things to be useful and convenient as an embedded language in shell scripts.
Re:My experience rewriting Enjarify in Rust by ngrilly on Monday September 19, 2016 @12:53PM (#12532799)
> I think Go should almost never be used for simple CRUD stuff

Why?

> there are better options

Which ones?

Re:My experience rewriting Enjarify in Rust by goatlover on Monday September 19, 2016 @03:29PM (#12534022)
PHP, Ruby, Javascript, Python - pick one.
Re:My experience rewriting Enjarify in Rust by duaneb on Monday September 19, 2016 @04:24PM (#12534400)
Why are they better? Dynamic languages are orthogonal to creating CRUD apps and come with massive runtime and reading overhead.
Re:My experience rewriting Enjarify in Rust by goatlover on Monday September 19, 2016 @05:48PM (#12535045)
The overhead doesn't matter for simple CRUD stuff. The developer's time is what matters. The dynamic language are more productive.
Re:My experience rewriting Enjarify in Rust by duaneb on Monday September 19, 2016 @06:32PM (#12535321)
> The dynamic language are more productive.

Do you have a source for that? I hear it a lot and I just don't buy it.

Re:My experience rewriting Enjarify in Rust by goatlover on Monday September 19, 2016 @07:01PM (#12535498)
If dynamic languages require less code and less hoops to jump through with more high level abstractions available to express yourself with, then chances are they will be more productive. There is a price to pay for this expressivity in terms of performance, overhead and potential bugs not caught at compile time. This is well understood, which is why you hear it a lot.

Now like most things having to do with programming, there is little empirical research backing up any language claim. As such, your anecdotal experiences might be different than the what you hear a lot. Maybe you are more productive in a statically compiled language. Maybe the metaprogramming features in a Ruby or Lisp don't make you more productive. Perhaps a more restrictive language fits your coding style and thought processes better.

Or maybe you're a Haskell programmer, at which point I would defer.

Re:My experience rewriting Enjarify in Rust by data_hope on Tuesday September 20, 2016 @02:54AM (#12537668)
There are basically not many conclusive and reliable studies out there that would show empirical evidence for or against dynamic or static languages (software engineering is not even a social science in this respect, i.e. psychology and sociology are more empiric than us).

From my personal and anecdotal evidence, I would say that dynamical languages are on average a good choice in terms of productivity. More or less, Smalltalk and Lisp have explored that design space and we have a fairly solid understanding of what a good dynamic language looks like (basically, most of them really look all the same if you look beyond the syntax). There are established practices and resources. I would even go so far and say that with dynamical languages - even though they are highly flexible - we have a pretty homogeneous situation. The most important differences between let's say Ruby, Python, Javascript and Clojure is in the ecosystem (libraries, etc). So I say: So dynamic languages are this robust and reliable family van.

With statically typed languages the situation is not so homogeneous. The selling point of statically-typed languages is that they can give you compile-time guarantees. Yet we have expressive and non expressive type systems. Languages that only allow for simpler types (golang), for complex types (ML/Haskell, and Rust which is simpler in terms of polymorphism yet more complex because it has these lifetimes). What I am trying to say is that already when speaking about expressivity, there are differences in statiically typed languages that are pretty huge. Yet they don't map 1:1 to productivity. I don't think there is a language better suited for compiler-writing than Haskell, yet it will be an unproductive language when I use it as a replacement for shell-scripts (or Python scripts that do shell script tasks). And I frankly don't know if Golang would be the right tool for this (if I had the choice between Golang and Python for writing a compiler ,I would probably choose Python).

When it comes to a CRUD application, it probably is not so much a question of which language you pick for implementing it, but for how well you understand the patterns (MVC, etc) established for CRUD applications, how nice the ecosystem supports you (libraries, frameworks, etc) and how well you write your tests.

Re:My experience rewriting Enjarify in Rust by slmyers on Monday September 19, 2016 @08:01PM (#12535787)
Isn't it more of an opinion than an objective truth? ie, it doesn't really need a source.
Re:My experience rewriting Enjarify in Rust by duaneb on Tuesday September 20, 2016 @11:42AM (#12540364)
That is what I was angling toward.