Meanwhile Rust: you might get an error at line 45 word 3 because it assumes variable foo is an int32 but it could be (whatever else idk), let’s not compile this before you correct this by changing line 43 in this specific way. Here’s the before and after code snippets so you can just copy-paste the fix.
In my IDE there us even a button for accepting the compilers recommend fix. This is only possible because the error messages and recommendations are that good.
The US add engineer to everything to sound most prestigious than they are. If you sell your service as a AI prompt writer, you get paid peanuts. If you sell the same service as AI prompt engineer, the C-Suites cream their pants.
I’ve found it helpful in learning things about languages I’m unfamiliar with, but it seems like saying “I’m an AI programmer” means “I don’t really know what I’m doing in this language, I’m still learning.” Which I suppose shows a willingness to learn, but that’s about it.
Every time I commit I have to look through git diff, figure out what the hell I actually did, come up with something intelligent to say about jt, possibly split the commit into multiple commits if I changed multiple things, do some shuffling with git reset and git add…
For some reason all my personal projects are all like 4K SLoC with 50 total commits, all of which include apologies for not doing more smaller commits
You see, sometimes I code something, go to bed before finishing it, come back, decide not to commit because then I’d have to think of a commit message and I just want to code, start working on an unrelated feature, do that for a couple days, get distracted by life stuff and put the project down for a few weeks/months, rinse and repeat, and then I finally get around to writing a commit message because I’m about to start a huge change and I want a restore point and I’m like. Okay, it’s been like 3 months since my last commit, I’m pretty sure my code can now do something it couldn’t 3 months ago but come on, I can’t even remember what I had for lunch last Thursday
I’m well aware this is terrible practice but I don’t know how to stop doing it
Commit more often. Maybe work in a different feature branch, and don’t be afraid to commit your half-working crappy code. If it’s a personal project/fork, it’s totally acceptable to commit often with bad commit names and small unfinished changes: you can always amend/squash the commits later. That’s how I tend to work: create a new branch, work on the feature, rebase and merge (fast forward, no merge commit). Also, maybe don’t jump around working on random features :P
You can help yourself a lot here by making commits every time you make a meaningful change. A feature doesn’t need to be complete to commit major checkpoints along the path to completion. That’s what feature branches are for. Commit often. It’ll help you think of messages, and it’ll help you recover in the case of catastrophe.
I just get too excited about actually implementing/fixing something (random things that I see along the way) more than commit ceremony (nobody will care about it in my project anyway other than one random guy who gave the repo a star)
I spend much time splitting them up inside visual studio by file and individual lines changed to try and separate my many simultaneous changes into several somewhat usable commits. If I was stupid enough to make some big refactor at the same time I might just have to throw in the towel… It’s really painful after a few weeks to try and pick up the pieces of what I was doing but never commited too lol.
Patch add - it shows you particular changes you made, and you choose whether or not to include them in the commit. (You can then use git stash -k to stash only the changes you did not add, so you can test before you commit.)
Also Go: exceptions aren’t real, you declare and handle every error at every level or declare that you might return that error because go fuck yourself.
It is better than in most languages with exceptions, except from languages like Java, that require you to declare that certain method throws certain error.
It’s more tedious in Go, but at the end of the day it’s the same thing.
When I use someone else’s code I want to be sure if that thing can throw an error so I can decide what to do with it.
Java doesn’t have to declare every error at every level… Go is significantly more tedious and verbose than any other common language (for errors). I found it leads to less specific errors and errors handled at weird levels in the stack.
It’s better than “invisible” exceptions, but it’s still the worst “better” version. The best solution is some version of the good old Result monad. Rust has the BEST error handling (at least in the languages i know). You must handle Errors, BUT they are just values, AND there’s a easy, non-verbose way of passing on the error (the ? operator).
Aside from the technology stack being the embodiment of vendor lock-in and misery, the scamming is really what makes me not want to work on Generative AI tasks, or whatever the next hype thing is going to be.
The worst part is that many people want to be scammed. We have customers come to us, asking for a solution to a problem they’ve had for long time, and asking it to be solved with GenAI.
Then we tell them that there’s really no use-case for GenAI there, that it could be better solved for half the money using traditional methods.
At which point, they ask us to integrate GenAI in some place anyways, because otherwise their boss will not give them the money. And of course, that boss also has a boss who also only frees up budget for GenAI.
And that just repeats upwards, until you have shareholders at the top, who eat up the hype, because other shareholders eat up the hype.
And if you tell them “no” too often they’ll choose your scummy competitor who’ll just tell them “yeah we put all the AI in it, whatever” over you who want to actually help them.
And it took a lot of hard work by a lot of people to adopt new date standards to avoid that problem. Now it’s time to adopt new IP standards, and it’s going to take a lot of hard work by a lot of people.
Python, on the other hand, deserves all the hate it gets for making whitespace syntactically significant - I even prefer Go’s hamfisted go fmt approach to a forced syntax to python’s bullshit.
Just put them in separate functions. If you have too many levels of indent, your code is convoluted. Sticking to the line length limit sometimes forces you to write more lines than you’d like to. But it makes everything so much more readable that it’s 100% worth the trade off
It’s quite often I have to second guess whether the code is correctly intended or not. Is this line supposed to be part of this if block or should I remove that extra indentation? It’s not always entirely obvious. Extra troublesome during refactors.
In other languages it’s always obvious when a line is incorrectly indented.
Yeah, it is a completely nonsensical thing to complain about. I hate to go around matching curly brackets like some braindead nematode. If you use more than two levels you should rewrite the code in most cases… just use advanced indexing and vectorization (by pythonic ;p). Or you can loop around like a freaking peasent in your inefficient garbage code that nobody can read because it is cluttered with comments explaining basic stuff. There is a reason Python is popular… and it is not because no one can read it. Same goes for dynamic typing - it is a blessing for most tasks. I do not want to explain to the machine what every temporary variables means…
I agree but still you can oftentimes expect that the average person’s initial reaction to be somehow reluctant… until they understand it. it’s like those foods and drinks that you might need to try a couple times before you start enjoying them.
I hate em cos regardless of language auto formatter takes care of everything. So now im typing extra characters and fucking shit up and confusing myself when moving code between scopes.
In all seriousness, I freely admit that I’m biased towards python because it was my first language and remains my favorite. I use an IDE for anything but the simplest scripts, so I’ve very rarely had any issues with spacing.
Go really does do well in the zero-to-hero case, that’s for certain. Unfortunately it doesn’t fare nearly as well in terms of ease when it comes to continued development.
Go has a heavy focus on simplicity and ease-of-use by hiding away complexity through abstractions, something that makes it an excellent language for getting to the minimum-viable-product point. Which I definitely applaud it for, it can be a true joy to code an initial implementation in it.
The issue with hiding complexity like such is when you reach the limit of the provided abstractions, something that will inevitably happen when your project reaches a certain size. For many languages (like C/C++, Ruby, Python, etc) there’s an option to - at that point - skip the abstractions and instead code directly against the underlying layers, but Go doesn’t actually have that option.
One result of this is that many enterprise-sized Go projects have had to - in pure desperation - hire the people who designed Go in the first place, just to get the necessary expertice to be able to continue development.
Ananace and the article they linked are using their dislike of Go to conclude that it’s a bad language*. It is not a bad language. Every language has hidden complexity and foot guns. They don’t like Go. Maybe you won’t like Go. That’s ok. But that doesn’t make Go a bad language. The language designers are very opinionated and you might dislike them and their decisions.
I haven’t used Rust but from what I’ve seen, it’s a lot less readable than Go. And the only thing more important than readability is whether or not the code does what it’s supposed to do. For that reason I doubt I’ll ever use Rust outside of specific circumstances.
*I’m using “a bad language” as shorthand for “a language you shouldn’t use”. Maybe they don’t think it’s bad but amounts to the same thing.
Another reason is kind of a general thing with programming language design: Go, like Java or C, has relatively few concepts in the language and stdlib. This means you’re relatively quick to have seen all of them.
But this also means that for various tasks, these concepts that were left out, would have been the right tool. For example, Go doesn’t have enums.
Generally, it’s still possible to create all possible programs, because of turing-completeness, but it will be more cumbersome and more boilerplate-heavy.
So, as a rule of thumb, the more concepts are provided by the language and stdlib, the more you have to learn upfront, but the less pain you have long-term.
Is there a language that anyone would say really does fare well for continued development or is it just that few people enjoy maintaining code? I’ve maintained some pretty old Go programs I wrote and didn’t mind it at all. I’ve inherited some brand new ones and wanted to rage quit immediately. I’ve also hated my own code too, so it’s not just whether or not I wrote it.
I have found maintainability is vastly more about the abstractions and architecture (modules and cohesive design etc) chosen than it is about the language.
Rust is extremely geared toward maintainability at the cost of other values such as learnability and iteration speed. Whether it’s successful is of course somewhat a matter of opinion (at least until we figure out how to do good quantitative studies on software maintainability), and it is of course possible to write brittle Rust code. But it does make a lot of common errors (including ones Go facilitates) hard or impossible to replicate.
It also strongly pushes toward specific types of abstractions and architectural decisions, which is pretty unique among mainstream languages, and is of course a large part of what critics dislike about it (since that’s extremely limiting compared to the freedom most languages give you). But the ability for the compiler to influence the high-level design and code organization is a large part of what makes Rust uniquely maintainability-focused, at least in theory.
If I’m going to inherit a large code base to maintain, I’d like Java, C# the most, Python, the least. Go isnt too bad IMO. I’ve not worked with enough Rust code to really judge it. BTW I like Python but lack of types makes refactoring and discoverability harder
programmer_humor
Top
This magazine is from a federated server and may be incomplete. Browse more on the original instance.