by ordinaryradical · 8y ago · 0 comments
I keep looking at languages like Go and frameworks like Angular as being steered for huge-org problems, but I wonder if startups are better off incurring the debt of riskier, less conservative languages and paradigms and worrying about the technical debt only once they've reached the scale where it a) actually matters to your agility in delivering customer value and b) you have the capital to make it worth solving the problem.
Maybe this is reading too much into the generics kerfluffle, but I would love to be enlightened if anyone can clarify this further.
Is that it just doesn't matter very much. F# has very powerful generics, and there are particular circumstances where that saves me a lot of typing. But you can still get it done in C# with less powerful generics, or Go with none.
F# has sum types, and replaces null with an option type - great ideas, but you can approximate these ideas in any language if you need to.
Similarly, Nim's metaprogramming has let me do some really clever things, but again, it just saves some typing.
I've found that language features and properties are often given more weight than they deserve. The really hard problems I've had when coding are just the actual problems. And while a particular language can be life-changing in particular problem domains, its rare that they are life changing in general.
Go is maybe the language I think is least interesting of all of the ones I've played with but I currently prefer it over the others because
1. stable, mature language and tools (unlike nim) 2. fast compile times (unlike rust) 3. compiles to native executables
F# might be my favorite if it had fast compile times and native compilation. Rust might be my favorite if I ever grok the borrow checker. But if someone said I had to use language X to do project Y I would almost always be fine with it, unless there were insurmountable performance problems caused by the language.
Both C and Go are very, very simple languages; there aren't many keywords, and it's pretty easy to grok both at a functional level. It takes, of course, a bit to reach the second-level understanding you need to make full use of either language, but it's easy to hit the ground running in both.
We sometimes get stuck on one language being better than others because it has X feature or Y concept, and I've seen some people essentially root for one language over another. But at the end of the day, languages are tools to get your work done, and on balance the work is going to be hard whichever route you go. Use the one that suits the talents you have available and that broadly complements the needs that you have.
Are you sure about that? I don't think you'll be running Go on an AVR. Likewise to this day Go still can't pin pointers so interop with native C libraries is a royal pain(this is something that C# and Java both support).
People love to bag on C but there are domains where it can go that a GC'd language can't. I wouldn't be so quick to equate the two.
I don't think Go needs to be a like-for-exact-like analog of C to be a valid replacement. For many C programs, the memory management pattern they use is something that could be handled just as easily with GC, and done so in such a way as to lift a significant burden on the programmer.
I mentioned this in another comment, but definitely, if you need to manage your own memory—don't use Go. I must disagree that GC disallows Go as a replacement for the language. But I will respect your opinion if you think it does!
I haven't used it with teams of people on any way yet but I imagine it makes it somewhat easier to drop into code that isn't yours and understand it. There are less ways to create voodoo. Which can be a pro or a con, depending!
Go does have a GC, not manual memory management
Go can't interact performantly with other languages.
Go is like Java (not C). Its kind of nice but deliberatley sabotaged by (Big Company).
That said, I don't think there's anything more I can say which can add to the conversation. I'm happy to allow what I have said to stand.
C was owned by AT&T, and now by everyone that can afford to have a seat at ANSI/ISO C meetings, apparently it is easy to forget this little fact.
No, go has a garbage collector. It is not a replacement for C. Languages like C++, Rust or Ada are.
I suppose you could write your own malloc in Go... if you preallocated a bunch of bytes in a huge chunk, and wrote some functions to use that up. But that sounds like a pain.
If you really really specifically need to manage your own memory, then I agree, you shouldn't use Go. But that doesn't mean that Go is not a valid replacement for C. Do you think a majority of programs that are written in C are done so because they need to manage their own memory?
Joe Duffy has putted it quite nicely regarding how many in the Windows team saw Midori, even though it was proven to be running right in front of their eyes.
RustConf 2017 - Closing Keynote: Safe Systems Software and the Future of Computing by Joe Duffy
I have to disagree with this one. I tried go briefly, and what I found was that it provided a couple of relatively nice high-level features (multiple return, nested functions, interface{} (although that doesn't count it's basically void*)), but that ultimatley it tried to constrict what I could do in a way that c didn't. Add to that that c somehow has much better metaprogramming than go even though literally every language ever made has better metaprogramming than c.
No, it is not. Put macros back in, pointers and memory without GC before claiming Go can do the same things C does.
Yes, i will approximate a Formula 1 car by connecting two bicycles side to side and fitting a lawnmover motor.
If you insist on car analogies, Go is a good-at-most-things car.
It's not the fastest car, it's not the most gas efficient car, it's not the cheapest car, it's not the best looking car, it's not the most technically advanced car but it scores in 10% percentile on all on those fundamental characteristics.
Other cars are more bimodal. One car is very fast but also very expensive. Another uses the latest high-tech titanium making it very light but designers only included very small gas tank. C++ is like Homer Simpson's car: wants to have everything and ends up as a frankenstein.
And I'm already regretting this car analogy because it's so unnecessary.
Go gets top marks on things that matter.
Fundamentals like: generates fast code, compiles quickly, has garbage collector, array bounds checking, excellent concurrency, great standard library, lots of third party libraries, generated binaries use little memory etc.
Go might not have something that your favorite language X has but language X is very bad on at least one of those fundamentals.
It might be 10x slower, compile code 10x slower, rely on gigantic runtime, lack any reasonable concurrency etc.
Why doesn't Java count?
* Because it doesn't have "excellent concurrency"? (I posit its concurrency is far better than C, Python, Ruby, JS, or pretty much any mainstream language)
* Or because "generated binaries use little memory"? (That's the stereotype and arguable, but Java is used as the primary user space language on low end, memory constrained mobile devices. AFAIK, Go can make no such claim.)
* Or something else?
FWIW, Java has other fundamentals like custom generic collections, standard package management system/conventions, nullable types/optionals, and a workable error strategy.
How? You can make up for it somewhat with linters, unit tests etc. but it's tiring and nowhere near as robust as a type checker that enforces null checks for you.
But it is just one parameter of a thousand affecting how easy it is to write good code, it sometimes has runtime costs.
if (...) {
...
} else if (...) {
...
} else {
...
}
is pretty good 99% of the timeHaving less lines of code looks like a big win to me.
I'm glad it's a big win for you! But in the main, I think, it's a tradeoff. Expressiveness has a cost; simplicity has a cost.
Personally, I think it's best not to get too attached to specific concepts or languages, because times change, and needs change. If you're a good programmer, you can learn any language and any concept you need to.
So I don't think it is always a big win, but maybe sometimes it is.
i am sure you must have heard of ocaml and reasonml .. why didn't you consider them
Ocaml has some tough to live with syntax for me, the threading issue, and tiny ecosystem.
But yes it interests me! ReasonML fixes the syntax and maybe it will lead to a bigger ecosystem, that would be great.
But on the other hand, when the day is done and I look at what has been created, I'm really impressed with the quality of the project. A good team can write good software in any language, but I do believe this language has helped this team write better software than they might have in another language.
I suppose that, like everything, there are tradeoffs. I'm not not yet sure which tradeoffs are most important to me.
.filter()
Not having to write useless type casting boilerplate like this: https://github.com/majewsky/sqlproxy/blob/f5b297e7dce14c0453...
Not having to write `if err != nil { return nil, err }` every second line. (Or, in other words, Rust's question-mark operator.)
There is a clear path to working around this case, but I find it to be a bit tedious. I miss languages where, through generics, duck-typing, or similar that I can simply pass the application's structure to the third-party library and it "just works".
[1] https://github.com/upspin/upspin/blob/master/upspin/proto/pr...
The reason for that is largely the 'come back to it' factor. I'm reasonably able to identify go code I wrote and put away. I can't say the same for other languages I've used professionally.
I can give you some counter-testimonial for .net when I ran a 50 dev project. Skillsets were all over the place, the architects wrote boilerplate the devs didn't understand, and the codebase was messy, thanks in due part to .net drawing commodity developers and Anders making sure csharp has 5 different ways to do everything.
Lang history driven in large part by new features is turning out to be bad for business, IMO. I want something solid for my team that's easy to code, easy to test, and easy to consistently hire for. And I want them all to be SME's on the code they write for their domain. What that gets me is a lot of devs who will effort point stories about the same, no matter what team they are on. My gut tells me I can get to that state of bliss with something like golang faster than I can .net. Lot of mitigating factors built into that I get it, but that's what my gut tells me.
Having a compiler that catches 80% of the errors you can make during big code changes already starts becoming a real advantage.
I don't think that Go is a perfect language, but for most of my use cases it is the most efficient one overall.
semi random, but for another example of someone enjoying the hell out of go for personal projects, take a look at:
that guy's amazing, one of my programming heroes.
Go was the first compiled language I learned coming from Python and scientific computing. And I felt the same way and was so delighted to write fast native multithreaded code without ceremony.
But then I learned some other languages that have elegant and powerful type systems (namely, Rust, OCaml and Haskell) and now I'm somewhat disgusted at my former self. Go could have been great, but it ain't. It's a blub language if ever there was one.
I know my opinion on these things doesn't matter. But I feel resentful of Go, I feel like I was duped.
but i wouldn't feel "duped".
those are much more ambitious languages than go; they're in a different space. go is simple, easy to learn, small...
(a lot what's nice about go is beyond the language too -- the whole ecosystem is just very pleasant to work with.)
Since it is structured code, I keep adding more features without much breakage. I know people can do it so many other languages and ways. My point was that Go can be used for variety of person or single developer projects. It is more tuned towards making new/interesting things in boring language vs learning interesting language to reimplement existing things.
Go has a simple syntax that rarely changes and has been backwards compatible since 1.0. It even has a built-in code formatter to keep things consistent. This means that you can write a service with the confidence that it will compile on the latest version of Go when you need to change it. Even if that is months or years later.
Additionally, the dependencies for Go programs are stored on disk, relative to the project, in a simple hierarchy. I can't think of a single other language or package manager that makes it easier to vendor all your dependencies. And I do so for most Go projects I work on (I mostly use it for standalone services, not libraries).
Here are the typical steps for reviving a project that I haven't touched for over year:
git clone ...
cd ...
go test ./...
This can be very useful for the some teams and utterly useless for other teams.Additionally, I agree with your points about Go.
Eh, you get that with most languages, though.
this has pro's and cons.