You can always revert (i.e. undo in a new commit) the faulty commit. That will keep the history. This meme is not just about pushing straight to master, it’s about push --force which overwrites the remote branch completely, changing history.
Sometimes there’s only the nuclear option left, I have only done it a few times, someone merged a major refactoring and we ended up reverting by changing history.
I have also observed that when you revert with git revert and then merge back some time later git can get confused about if a commit was merged or not.
Mind you we didn’t use git flow or other smart processes to our own regret.
git can get confused about if a commit was merged or not.
You have to revert the revert before re-merging the branch. Otherwise git keeps track of the commits that you reverted and doesn’t apply them ever again.
I try to always rewrite complicated code. As an example, another dev who left the team had written a program in Elixir that nobody knew or understood. I rewrote it in python (with his help, since I still had contact with him over chat). After that, everyone in the team could understand the code and we could make changes very easily to it and document it.
Another program he wrote in python was kind of complicated and we would have bugs in it that we didn’t know how to fix. So I rewrote it with a completely different architecture with focus on simplicity. And again, now everyone could just read the code and understand it.
I think many devs are writing code that is not simple to understand for others. Then rewriting it can be worth it to avoid the pain of trying to fix bugs in complicated code.
That’s only the first stage. Once you get tired enough you start writing code that not even you can understand the next morning, but which you’re loathe to change because “it just works”.
Yeah I’ve had that experience too. But sometimes I write a lot of hackish code to get it to work, and then after spend time rewriting it so it’s easy to understand. But it depends on mood. Sometimes I don’t change it because it’s complicated and it would be too much thinking required to make it better. :)
Think about it though. When people say they want to “code AI” what they typically mean is they want to play with prompts and waste electricity on garbage models, not actually write any of the underlying models that power AI.
Well yes, but also people can use TenserFlow and other AI tools without learning how to properly code. And they can also get the results they want. So be afraid of the question “do you really need to know how to code” anymore.
If you want to disabuse yourself of the notion that AI is close to replacing programmers for anything but the most mundane and trivial tasks, try to have GPT 4 generate a novel implementation of moderate complexity and watch it import mystery libraries that do exactly what you want the code to do, but that don’t actually exist.
Yeah, you can do a lot without writing a single line of code. You can certainly interact with the models because others who can have already done the leg work. But someone still has to do it.
It really is big. From baby’s first prompting on big corpo model learning how tokens work, to setting up your own environment to run models locally (Because hey, not everyone knows how to use git), to soft prompting, to training your own weights.
Nobody is realistically writing fundamental models unless they work with Google or whatever though.
I've even heard people try and call slightly complex bots "AI" and claim they can code them (or their friend totally can lol). It's infuriating and hilarious at the same time.
“AI” means nothing. If you want to learn about machine learning algorithms, neutral network programming (actual programming), heuristic collective intelligence, or path finding, then maybe we can have a conversation.
Of course AI does mean something - but it’s a very broad term. It’s a bit like saying you want to buy a vehicle. Could be a boat, car, truck or even a zeppelin.
I’m still struggling with understanding for loops tbh. I kinda get them, but I can’t “make my own” so I don’t really understand them.
I’ve never had any schooling coding, just made some scripts with internet help when I switched to linux, and I have ADHD like fuck so I haven’t really tried to understand them in months, but yeah if anyone knows of a good website to help learn for loops and how to create them (when to use what variables and brackets and shit, etc) I’m taking recomendations.
Don’t let yourself down because you don’t know the syntax off the top of your head.
Even after 15 years of programming, and studying computer science, I would have to look up how to write loops, conditions, variable assignments in bash / sh / batch.
Coming to python from a primarily java focus background wasn’t any different. I knew what steps the program should do, but had to look up how to translate it into whatever language. And for further improvements what features the language has to express the things “in the style of the language”
Thanks, that encouragement is definitely helpful, it felt like I was struggling with something most programmers would consider should be mastered day 1, right after lunch because hello world is before lunch haha. Glad to know people still have to look it up even after a while sometimes.
yeah as nice as it is what you can achieve with trait-bounds there are definitely trade-offs, being compile time and error messages, and sometimes mental complexity, understanding what the trait-bounds exactly mean… I really hope, that this area gets improvement on at least the error-messages and compile time (incremental cached type-checking via something like salsa)
I much prefer getting told of that it doesn’t match a trait than get 600 characters of which the majority is implementation detail of global allocators und from what exactly the string is derived.
Depends on what trait bound error messages you have had yet, I had 1000 lines long already, where it’s not obvious at all what is meant (and is often a very simple fix). But I’m sure this will get better over time, there’s already a bigger ongoing redesign of the type system solver, so maybe it will be integrated into stable rust soon.
Tbf, you have to be pretty far with Rust to get to a point where Rust’s compiler errors stop helping you (at least, as far as I’ve seen). After that, it’s pretty much the same
Yep use a little bit more deeply cascaded generic rust code with a lot of fancy trait-bounds and error messages will explode and be similar as C++ (though to be fair they are still likely way more helpful than C++ template based error messages). Really hope that the compiler/error devs will improve in this area
Rust has better runtime errors, too. If you run a dev build, it should pretty much never segfault unless you use unsafe and will instead tell you what went wrong and where, no valgrind necessary.
This is actually unironically a major benefit of Rust - compile time errors are supposed to be for dev mistakes and runtime errors supposed to be for user mistakes. Way easier to debug something at compile time instead of runtime.
programmer_humor
Oldest
This magazine is from a federated server and may be incomplete. Browse more on the original instance.