4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions
comment 3y ago · link · parent
But I'm okay with that.
The problem with de facto standards is: The fact that something became de facto standard, doesn't make it a better idea. The only thing it means is that it is now even harder to get rid of it.
> It's basically very late to be doing this.
Yes, it is. But not yet impossible. Languages and libraries that wait forever instead of ripping off the bandaid at some point, eventually become so crusted with such early problems, they become problems themselves.
comment 3y ago · link · parent
I am not a python maintainer, and I also use naive datetimes a lot, and I can absolutely understand the maintainers rationale behind this.
Let me explain.
What's a "naive datetime" suposed to be conceptually? There is no such thing. Datetimes only make sense in the context of a timezone. UTC is just another timezone, with an UTC-Offset of +0
So why do we have this strange thing that may be a UTC timestamp, or a local timestamp, or god knows what in the first place? It makes sense as an implementation detail of the datetime library to have timezones as separate objects, but for consumers of that library? It can cause confusion, and hard to track bugs, when suddenly one of the functions that accept aware or naive is used and spits out something completely unexpected.
I have spent many an hour tracking bugs, where systems spat out complete nonsense timestamps, only to discover that the reason they do that, is a mixed usage of aware and naive dateteime objects.
In my opinion, making explicit use of aware datetime the norm as much as possible, is a good thing. And removing prominently named functions that spit out naive ones, is a good first step.
Let's look at the listed usecases:
> An application may be designed in such a way that all dates and times are in a single timezone that is known in advance.
Okay...so put that TZ info somewhere it's easy to find, like a configuration Singleton, and use it.
> It is also a best practice to store naive datetimes representing UTC in databases.
Okay...read them from, and into datetime objects using UTC as their timezone information.
The bottom line is: There shouldn't be "naive" datetime objects, or at least they shouldn't be a common thing. Conceptually, datetimes always have a timezone attached, they are worthless without one.
comment 3y ago · link · parent
And here is my opinion:
I think in 20 years, Go will still be a mainstream language. As will C and Python. As will Javascript, god help us all.
And while all these languages will still be very much workhorses of the industry, we will have the next-next-next iteration of "Languages that incorporate all that we have learned about programming language design over the last N decades". And they will still be in the same low-single-percentage-points of overall code produced as their predecessors, waiting for their turn to vanish into obscurity when the next-next-next-next iteration of that principle comes along.
And here is why:
Simple tools don't prevent good engineering, and complex tools don't ensure it. There are arcs that were built in ancient Rome, that are still standing TODAY. There are buildings built 10 years ago that are already crumbling.
comment 3y ago · link · parent
And this is exactly what Go avoids, in my opinion and experience.
Unless someone shoehorns Go into an Enterprise Java style (which, sadly, is possible, and sometimes done), the problems you listed with the Java codebase either don't exist in Go, or are orders of magnitude less painful to deal with, even in large Go codebases. Plus, the toolchain is pretty obvious, because most of it ships with the language.
And while my argument mentions new hires specifically, because the impact is most visible with them, this is just as important for mid and senior level developers; yes Go is sometimes more verbose (although enterprise Java and lots of C++ code still runs circles around Go in that regard) than it's contemporaries, it is also obvious. There is little magic, there is little action at a distance, and the opinionated style of the language discourages superfluos abstractions.
I have used quite a few languages so far in my career. Go is the first where I was able to comfortably read and understand std library code within the first week of learning the language.
> Just off the top of my head, for-loop semantics [which to Golang's credit, is being fixed but it is absolutely a breaking change],
It is technically a breaking change. Practically, it isn't, because there simply are no examples of production code in the wild that rely on this unintuitive behavior (As mentioned multiple times in the discussion on Go's issue tracker, the dev team did their research on that), and code that implements the (very easy) fix, will continue to work after the upcoming change.
> Nothing about Golang gives me that confidence.
My experience is different. I know that most of the problems the Rust compiler complains about will be handled by the fact that Go is GC'ed, and most of the rest I avoid by relying on CSP as my concurrency model (Can't accidentially copy a mutex if there's no mutex ;-) )
comment 3y ago · link · parent
The behavior of nil-channels always blocking is on purpose, and tremendously useful in functions where we receive from multiple channels via `select`. It allows the function to easily manipulate it's own receive behavior simply by setting the local reference to the channel to `nil`.
Since `selects` can also have `default`, the resulting functions don't have to block either.
comment 3y ago · link · parent
And how well did that work out for Haskell?
https://gist.github.com/graninas/22ab535d2913311e47a742c70f1...
Just because one person thinks Functional Programming is the right way to do it, doesn't mean another person has to agree. The same goes for every paradigm, and language feature under the sun. Different people want different things, different projects have different needs.
No single language gets everything right, no single paradigm solves every problem, no feature is a "must have" in every language. A functional approach might be great or a productivity killer depending on the use case. A GC may be the best thing in the world or a performance nightmare. OOP may be a really good idea or a path to unmaintainable crap depending on the implementation.
There are no silver bullets.
The only thing that is ABSOLUTELY certain: When people get told "Our way is better, you should use our way", despite the fact that there are no silver bullets, people will resist. And that resistance can lead to languages vanishing into obscurity.
comment 3y ago · link · parent
Mind showing us the source for that?
Go wasn't made for incompetent developers. I'm fairly certain that people who land a job as devs at Google are pretty competent.
Go was made to facilitate rapid onboarding, easy digestion of large codebases, and working efficiently in large teams where people are guaranteed to have widely different educational backgrounds, experiences and ideas about programming.
That's why the language has to be simple, obvious, and be focused on readability. That's also why Go is strongly opinionated.
comment 3y ago · link · parent
I get what you're saying, and I'm glad you are having such a good experience with it. Disclosure, I am not talking down to any language here...in fact I actually like Rust as a language, even though I don't use it professionally.
I am just saying that Go is incredibly easy to learn, and I don't think there are many people who disagree on this point, proponent of Go or not.
> I have to disagree.
We'll have to agree to disagree then :-) Yes, the code is verbose, but it's not really noise in my opinion. Noise is something like what happens in enterprise Java, where we have superfluous abstractions heaped ontop of one another. Noise doesn't add to the program. The verbose error handling of Go, and the fact that it leaves out a lot of magic from other languages doesn't make it noisy to me.
> I don't think those two are incompatible.
Neither do I, but that's the path Go has chosen. It may also have been poorly worded on my part. A better way of putting it: Go doesn't subscribe to the "add as much as possible" - mode of language development.
> But is it high-value productivity?
Writing the verbose parts of go, like error checking, isn't time consuming, because it's very simple...in fact, these days I leave a lot of that to the LLM integration of my editor :-)
Is is high value? Yes, I think so, because I don't measure productivity by number of lines of code, I measure it by features shipped, and issues solves. And that's where Go's ... how do I say this ... obviousness really puts the language into the spotlight for me.
comment 3y ago · link · parent
Novel as in "implements a new algorithm that has never seen in any form and is actually an improvement over existing methodology"?
Here is a little thought experiment: If all the training data in the set says that manned, powered flight is impossible, is a statistical prediction engine trained on that data capable of developing an airplane?
In other words, could a very powerful stochastic parrot do what the Wright Brothers did?
My best guess is that no, it cannot.
comment 3y ago · link · parent
> You have to use an interface. That’s much more complex than using a sum type would be.
More complex how and by what metric?
comment 3y ago · link · parent
No it isn't, and yes it does. By definition, the more features I add to something, the more complex it becomes. So yes, Go achieves it's simplicity precisely by leaving out features.
> this great list of issues
I just picked three examples at random:
"Sending to an Unbuffered Channel Returns As Soon As the Target Receiver Is Ready"
"Send and receive operations on a nil channel block forver."
"Many languages have increment and decrement operators. Unlike other languages, Go doesn't support the prefix version of the operations."
All of these are behavior and operators that are documented in the language spec. So how is any of these a "footgun"?
comment 3y ago · link · parent
Sure, it could be done. Lots of things could be done to Go. The people who invented it are among the most brilliant computer scientists alive. It's a pretty sure bet that they know about, and in great detail, every single thing people complain Go doesn't have.
So every thing that is "missing" from Go isn't in it for a reason.
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupéry, Airman's Odyssey
comment 3y ago · link · parent
True, and because of this, the language can be learned over a weekend or during onboarding, new hires can rapidly digest codebases and be productive for the company, code is straightforward and easy to read, libraries can be quickly forked and adapted to suit project needs, and working in large teams on the same project is a lot easier than in many other languages, the compiler is blazing fast, and it's concurrency model is probably the most convenient I have ever seen.
Or to put this in less words: Go trades "being-modern" for amazing productivity.
> It always feels like a regression when switching from rust to go.
It really does, and that's what I love about Go. Don't get me wrong I like Rust. I like what it tries to do. But I also love the simplicity, and sheer productiveness of Go. If I have to deal with the odd nil-based error here and there, I consider that a small price to pay.
And judging by the absolute success Go has (measured by contributions to Github), many many many many many developers agree with me on this.
comment 3y ago · link · parent
Two questions:
1. How can humans come up with novel ideas then? Statistically predicting the next item means I am limited to the training set. How do humans formulate new concepts in this scenario?
2. Why can humans learn from their own output then? If all we do is statistically predicting the next token, then, by necessity, feeding our own output back into the model (aka. letting humans learn from it) should degrade human capabilities by overfitting to the training set. But we observe exactly the opposite.
comment 3y ago · link · parent
Maybe it is, maybe it isn't. Maybe we are "just" an incredibly powerful prediction engine. Or maybe we work from a completely different modus operandi, and our ability to predict things is an emergent capability of it.
The thing is, no one actually knows what makes us intelligent, or even how to define intelligence for that matter.
comment 3y ago · link · parent
I have a question to people in charge of politics everywhere:
Given how much money governments spend on nonsense, why can't we take some money, and build simple, but quality and stable shelter for people?
If there are 100.000 homeless in a community, and 2 people manage to build that sort of shelter, with what they could get in tools and materials for <100 Pounds, why can't we say "Okay, let's budget 200 per shelter, but do it with professional builders, better tools and materials, and no requirement to hide it."?
1,000,000 // 200 = 5000 Shelters. Oh, and that shelter served 2 people. So to house 100,000 people, this would need 10 Million pounds. And that's before we factor in economics of scale.
Let's acknowledge what a difference the existence of even a simple shelter makes in the life of a person: They have a stable base of operations to sleep, keep their posessions, a postal address, a place to wash up and prepare food. They know that place is there at the end of a day, eliminating some anxiety. They have a place they can heal when they get mildly sick. They won't be sick as often, be in better physical and mental shape. As a result they have an easier time finding jobs. So building these shelters doesn't even have to be a charity...it's literally an investment into a societies economic power that pays dividend over dividend.
So WHY AREN'T WE DOING THAT ALL THE TIME, EVERYWHERE?!?
comment 3y ago · link · parent
Sure is. Wanna know why? Because there is no unversal standard on how to do it.
And arriving at such a standard is really really difficult, in no small part because of all the "amazing" design ideas I mentioned before, which are not only fast-and-ever-changing, but also don't work well together.
In ye'olde days, the problem was approached from the technical side: Technically, designing graphical interfaces is hard, so here is a constrained system that gives you these well defined methods for doing so. That's what design gets to play with, so that's the standard. It didn't look cool, and didn't lend itself easily to branding etc. but it worked. In fact it worked so well, that we STILL have ALL the UX elements from these days in active use today, and they STILL WORK.
Nowadays, we are in a situation where we try and approach the problem from the other side: Technical limitations basically went away, so everyone is free to design his own stuff, leading to a cambrian explosion of conflicting principles and ideas, including ideas how to standardize and categorize all of it.
If we were able to get this under control and design universal widgets that can automatically adapt to whatever device they are used on, that would be wonderful. And there are amazingly intelligent people who are trying to do that. But all that effort flies out the window the very next time some design studio or company want a nice juicy piece of personal brand recognition and "design" the next-shiny-thing.
comment 3y ago · link · parent
This is basically the only part of your post I disagree with, for reasons you pointed out yourself.
Low-hanging-fruit would imply that it is easy to displace these flawed languages with something better. And you have made a beautiful argument for why that is very very very difficult indeed.
comment 3y ago · link · parent
I didn't miss any part of your comment. The line you quote was as a reaction to the alternatives presented immediately after that part.
Because why would I sacrifice the advantages of semver for a minor convenience to the programmer of a sorting function?
> in practice the semver works 95% of the time
Which, based on nothing but my gut feeling, is a lot better than the 30% of the time any other versioning scheme works, where the only way to be reasonably sure that an update would not break my code was to diff the library (if the thing is open source), or read all the documentation, and pray to Zeus that it's complete and accurate.
comment 3y ago · link · parent
> If we wanted trivially comparable with regular numeric ordering we could have incremental numbers as versions. 1, 2, 3, ...
Yes, and then we would be back to the day when the version number gave me zero information about what changed, and how that affects compatibility with existing code.
There is a reason semver is used across the industry by now.
comment 3y ago · link · parent
The problem here is: Implementation details are not guaranteed to be stable. They can change with every release.
So if I write code that relies on any particular implementation detail, it may be correct today, and may be wrong two weeks from now, even though I didn't change anything.
comment 3y ago · link · parent
e.g.; there are C-compilers that usually zero most allocated structures. That's an implementation detail however, not a feature of C. C doesn't guarantee you zeroed memory anywhere, and code that assumes otherwise is just one compilation away from a desaster.
comment 3y ago · link · parent
No, I am comparing what was common then to what's common now.
Granted, the menu structure of apps back then was in large part common, because there was only the desktop, and GUI programming was still in its infancy, so everyone used the same widgets.
And no, I am not saying that everything back then was great. There absolutely were apps with shite interfaces. Only it was a lot harder to justify them.
> Standards for things like this will likely settle in over time.
Some will, but since we made the transition from building interfaces to designing them, agreeing on standards became much much harder.
Because now interfaces are the playground of marketing, brand recognition, product identity and design fads. Even explaining how an app works can be hard, because the person asking me could be in another group in some godamn A/B test and have a different one, even though we use the same App.
> When apps now need to have support for touch + trackpads + mouse + keyboard, mobile/tablet/desktop screens, and multi-platform
That certainly makes it more difficult, and requires careful consideration for different platforms.
So riddle me this: Why was common the reaction of all these different requirements to suddenly pretend everyone is using a phone for everything all the time?
Because that's how many apps and websites now look: Like something designed for a small phone screen and navigation by thumb. I open a website on a 4K monitor with a laser-precision pointing device, and I get an information density comparable to the intergalactic void.
comment 3y ago · link · parent
The problem with that: Such messages are rarely helpful in diagnosing and actually fixing the problem, which is the point of error messages in the first place.
The 404 Error message is short, precise, and (unless the server misuses HTTP codes), tells me EXACTLY what is wrong: 404: Resource not found. The thing that the URL I entered denotes, isn't there.
That is a helpful error message. "Oh dear, oh dear, it didn't work." however, is a crap error message, and the only thing it accomplishes, is enraging both users and technical support staff.
> Double click has largely went away, yes. I see double click in desktop file managers still but it's mostly gone elsewhere.
Please do tell, where else was it used to begin with, where it no longer is?
> It never became a thing on touch screens because it's not discoverable
a) It never became a thing on touchscreens because there is no mouse on touchscreens
b) There were, and still are, apps that use double taps
> which is why it's not great on desktop either
Please, do tell, how would you differentiate, in a file browser, between marking an item, and opening an item?
comment 3y ago · link · parent
What exactly is the point of an error message being "friendly"?
Does a sad cartoon face with an "Oops" in a speech bubble make users feel better? No. Not really. Because the user wants the thing to function, and if it doesn't, the user may want someone to help him, and if all that someone gets to work with is a little cartoon picture, that's not going to result in a happier user.
If there is an error´ in my app, I make it EASY for the user to see, copy and send it. Yes, I have written apps where an exception results in the stacktrace to be displayed in the actual app.
You know what these "unfriendly" errors caused? Countless very happy users, whos problems were quickly solved by knowledgable stuff who got actual error messages and stacktraces to work with.
> People would be confused about if single or double-click would do something different and when to do which
And did double clicks go away as a result? No. No they did not.
And btw. neither did Menu bars. We still have them. Only now, we have them IN COMBINATION with ribbons etc. and they are sometimes themselves hidden behin dsome element.
comment 3y ago · link · parent
We had these things figured out in the late 90s already.
- Menus were single click, and hierarchially organised
- The hierarchy was similar between programs
- Everything was text, no one had to guess what "tiny arrow inside a box" means
- Everything looked the same, because everything used the same widgets
- Common functions were placed in menus that were labeled the same across applications
- Menu-Items were directly labeled with their shortcuts if they had any
- Hover-Tooltips have been a basic widget of GUI libs for ages
Sure, they didn't win any design awards, but they worked. In all their boring, obvious blandness, they worked, and they were easy to use. And that's the most important thing.> removing _unnecessary_ jargon
Please tell me what is "_unnecessary_ jargon" in things like "File", "Edit", "New", "Preferences", "Save As...", "Tools", "Layout" or "Help"?
> I'm talking about software that casual non-techy people would often use.
As am I. These problems plague many many popular apps as well. Where is the account setting? Behind my profile picture? In a sub-hamburger? In the App-Settings? Where is the sub hamburger? Topright, mid-bottom, only visible when the display is in landscape mode? Do I have to swipe the menu in? If so, from which direction and with how many fingers?
That professional complex software is plagued by this as well is a personal gripe for me as a tech person, but these problems are universal.