Earlier quoted context omitted.
What is "ninja coding"? Sounds stupid.
I think it refers to the Perl-era idea that good code should be somehow "clever" rather than maintainable. It's how bad programmers who spend hours agonizing over how to reduce their line count (presumably to save disk space?) justify their behavior.
Program your next server in Go
171–180 of 384 posts
Re: Program your next server in Go
#172I'd love to see Nim on this diagram: https://talks.golang.org/2016/applicative.slide#13 - it could be close to the top right corner.
Re: Program your next server in Go
#173I like slide 41 [0]. What just happened? In just a few simple transformations we used Go's concurrency primitives to convert a - slow - sequential - failure-sensitive program into one that is - fast - concurrent - replicated - robust. No locks. No condition variables. No futures. No callbacks. It's the ability to make these kind of transformations effortlessly at any level, whenever I need to, that make me appreciate…
I'm sure the author means there's no explicit locking done by the programmer, but readers should be aware that channels are actually implemented internally using locks (which are 4x slower than using a sync.Mutex yourself).
Re: Program your next server in Go
#174Earlier quoted context omitted.
You are scared of Erlang because it has uglyish syntax. Only reason I can think of. The "need to do computation" argument is silly. Just call into a C lib from Erlang.
I think you're replying to the wrong person - they just asked a question about when Erlang might be a good fit. > Just call into a C lib from Erlang. That's easier said than done. Certainly possible, but it's not quite as easy as just linking and calling.
But, it does seem that there are not regular blog posts about how to drop into C to make even the worst scripting language performant. Seems like maybe it's a dying art???
Re: Program your next server in Go
#175Earlier quoted context omitted.
Parent's claim: Of course, but not all tools are equal. In programming languages, languages that have a static type system have an insurmountable advantage of dynamically typed ones. Your response: javascript and python would disagree with you. My question: How so? Since the claim is about the advantages of static type systems, I'll respond on that claim alone. The primary advantage of static type systems, particular…
"insurmountable advantage" - I don't think so. the simplicity that javascript and python provides is an enormous advantage to many kinds of projects.
There are many classes of errors that can occur when writing software. Languages with implicit variable creation like python obscure errors like mistyping the name of a new variable (versus an explicit declaration like in C or an ML where the mistyped name will result in an error immediately modulo name conflicts). It looks correct at a glance, but:
def foo(a_name, b_name):
# computations
a_nam = #some more computations
# computations using a_name, not a_nam, returns
# erroneous values
(NB: The above is bad practice anyways, an advantage of the single static assignment of the dynamically typed erlang.)Oops, we forgot an 'e' at some point. Now we have a new variable, but we used the old variable name for future computations and returned a result based on that.
Type errors, I've already discussed.
Logic errors like:
if(a
Are universal to all languages, they can't eliminate these. Actually, this leads to a major gripe I have with C. The duplication of meaning for = as both initial value assignment and later reassignment paired with the use of non-zero values to indicate true. if (a = b) // well, shit. a has a wrong value, and we go
// down the wrong branch now depending on the
// value of b.
Good practices only get us so far. Moving those good practices (static typing paired with type inference for simplicity, single static assignment or immutability by default, etc.) into the language does add mental overhead to programming. But it also produces less errorful final products.As a guy who writes software that can literally save or kill someone depending on how well or not it functions, I'm in favor of better languages.
Re: Program your next server in Go
#176Earlier quoted context omitted.
IMO switching an enterprise developer from language such as Java to Go is like asking someone who has very developed vocabulary in English to try Toki Pona[1]. Yes, it is simple, and you can learn it fast, you also can also communicate with it, but you will often have to fight with the language to express what you want. That person generally won't be satisfied. Go's shortcomings wouldn't be so bad if in exchange, the…
Your opinion on this is couple of standard deviations away from popular one. Is there a specific example where a program written in golang lacked compared to other statically typed languages?
Re: Program your next server in Go
#177I'm afraid HN has a serious problem with downvoters. Why -in heavens name- is the above a question that deserves downvoting? UPDATE: whoray - I got downvoted too. Gee man. Just not worth it. Buy and thanks for the fish.
Re: Program your next server in Go
#178Earlier quoted context omitted.
You can also use left right keys to navigate. Just doesn't work with scroll wheel, if that is what you were expecting.
It doesn't work well being a user. Which is what i was expecting.
Re: Program your next server in Go
#179Earlier quoted context omitted.
You would like to write an entire server without using a GC?
I would not like to write a server with GC. Source: I've written many servers in both C and Java and given the choice will never use a GC language again for a server. Holding out some hope for Rust..
Re: Program your next server in Go
#180Earlier quoted context omitted.
This feeds into language supremacy mindset. There is no universal best language nor there will ever be the one. Right tool for the job is a better flexible mindset. If you are a master painter, you could paint something amazing with anything you have got. Same thing applies to programmers.
> If you are a master painter, you could paint something amazing with anything you have got. Same thing applies to programmers. That's a flawed analogy. Here is a better one: If you need to drill something, do you consider a screwdriver and an electric drill equally?
Only particular tasks have languages that fit best. Many other tasks can be solved in multiple languages. In that case, the best tool for the job is the language you know best.