There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

backhdlp , in C++ Moment
@backhdlp@iusearchlinux.fyi avatar

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.

TxzK ,

Man I fucking love the Rust compiler. Easily the most understandable and useful error messages I’ve ever seen.

skulbuny ,
@skulbuny@sh.itjust.works avatar

Have you seen Elm’s error messages? They were what inspired Rust to have its error messages.

Asudox ,
@Asudox@lemmy.world avatar

I like how Elm error messages are like the compiler talking to you as a person.

anton ,

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.

agent_flounder ,
@agent_flounder@lemmy.world avatar

Hm. Rust sounds better and better every time I hear something new about it.

TrickDacy , in Tough break, kid...
@TrickDacy@lemmy.world avatar

“prompt engineering”

Sounds made up af

datavoid ,

It is, I believe the correct term is “proompt”

Croquette ,

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.

TrickDacy ,
@TrickDacy@lemmy.world avatar

So you’re telling me that people advertise themselves as AI programmers? That does not seem like something to brag about in such a manner

SpaceCowboy ,
@SpaceCowboy@lemmy.ca avatar

Yeah right?

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.

Croquette ,

Lots of people think that computers are magic box. And now a diffuse entity in the cloud talk to them? Big heads will gobble that shit up.

AVincentInSpace , (edited ) in Manager: This task only takes 30 minutes. Why did it take you the whole day?

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

Anticorp ,

There’s a bigger issue than your commit message if you don’t even know what you just coded and are committing.

AVincentInSpace , (edited )

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

dukk ,

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

AVincentInSpace , (edited )

but…but new feature shiny

Fr tho this is all excellent advice

ExtraMedicated ,

Jumping around to random features is how my ADHD brain works most efficiently.

Slotos ,

Good news, TDD is methylphenidate of software development!

Anticorp ,

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.

adrian783 ,

you can setup a on-save script to force you to commit when the number of changes is greater than a certain number from the previous commit.

akkajdh999 ,

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)

oce ,
@oce@jlai.lu avatar

Nah, I’m that guy, I gave your repo a star for the effort, but I’m not reading your history.

adrian783 ,

it means you commit too infrequently. your commit messages should be able to describe what u just did within 10 words.

PixxlMan ,

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.

PoolloverNathan ,

^psst,^ ^git^ ^add^ ^-p^

etchinghillside ,

Remind me what -p does.

Edit: never mind - I see it mentioned below.

PoolloverNathan ,

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.)

suy , in Show me a better text format for serializing

Norway.

Ups. Sorry, I meant “NO”.

Deleted , in Which side are you? Javascript or Typescript

I'd rather stay out of the frontend all together but I'd rather chop my balls off than go back to JS.

SpeziSuchtel ,

Plot twist: You are transgender and love working with JS

MarkusMagMagenbrot , in Father material

I did not notice which community this post is from for way too long.

fkn , in Golang be like

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.

zorro ,

Because that’s sane and readable?

fkn ,

Wow. I’m honestly surprised I’m getting downvotes for a joke. Also, no. It isn’t. It really isn’t.

gornius ,

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.

fkn ,

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.

GlitchSir ,

You know it’s social media when the one that’s right is downvoted

eestileib ,

I’m with you, exceptions sound good but are a bug factory.

r1veRRR ,

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).

theneverfox ,
@theneverfox@pawb.social avatar

Beyond a quick “hello world” when it came out, I’ve never used rust, but that sounds pretty great

herrvogel ,

There’s nothing sane and readable about how Go insists you format dates and time. It is one of the dumbest language features I’ve ever seen.

refalo , in no amount of documentation can save users from themselves
amotio ,
BigFatNips ,

What’s this from?

karthnemesis ,
@karthnemesis@leminal.space avatar

gravity falls

Wilzax , in A QA engineer walks into a bar

Orders a

Orders a beer"; DROP TABLE beverages; –

Orders a beer%s%s%s%s

kubica , in When your shower uses GitHub more than you

Plot twist, all of those are project initial commits.

CanadaPlus ,

Oh no. I think just reading that idea gave me cancer.

Keep your unfinished project ideas in a folder of shame like everyone else.

kernelle ,

How else do you suppose I store my API keys?

narc0tic_bird ,

My GitHub pretty much is my folder of shame.

dosuser123456 ,
@dosuser123456@lemmy.sdf.org avatar

my github is a folder on my desktop called “do_not_open_dir_of_shame”

onlinepersona , in Play stupid games, win stupid prize

So trying to hack hackthebox is not permitted? Confusion is the name of the game

Anti Commercial-AI license

firelizzard ,
@firelizzard@programming.dev avatar

hackthebox is essentially a puzzle solving platform where the puzzles are designed to teach you hacking. You’re not supposed to hack the platform.

Hawk ,

So trying to hack hackthebox is not permitted? Confusion is the name of the game

Ephera , in I Will Fucking Piledrive You if You mention AI Again

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.

suction ,

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.

frezik ,

<span style="color:#323232;">import tensorflow # we don't actually use this anywhere, but my boss told the client we use AI
</span>
FiniteBanjo , in It's easier to remember the IPs of good DNSes, too.

The problem is we’re projected to run out of unique IPv4 addresses by 2003.

orangeboats ,

And we are facing the effects of it as we’re speaking. CGNAT and protocols like TURN were not invented without a reason.

lambalicious OP ,

Not a big deal. We’re projected to run out of years by 2000 and then the world will end.

PaintedSnail ,

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.

joel_feila ,
@joel_feila@lemmy.world avatar

Oh god that brings back memories. Reallying dumb ones of people but memories none the less

xmunk , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

Who hates s-expressions? They’re elegant as fuck…

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.

eestileib , (edited )

I dgaf about indices starting at 0 or 1, I can deal with case-insensitivity, but syntactically significant whitespace drives me up the wall.

Diplomjodler3 ,

What’s so hard to understand about it? It’s how you should format your code anyway. Only it’s enforced.

Lysergid ,

No it’s how Python wants you to format. Many times I want to separate two logical sections in one function and can’t coz Python go crazy

Diplomjodler3 ,

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

xmunk ,

What if the logic is more readable in one function?

I use whitespace to make my code more legible, python forces more whitespace consistency but it comes at the cost of limiting the legibility.

AdamBomb ,

Are you saying that you want to separate your two logical sections by having different levels of indentation and that’s what makes Python go crazy?

umfk ,

Can you give a concrete example? Because I don’t understand what you mean.

magic_lobster_party ,

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.

slice1 ,

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…

vrighter ,

sometimes, a script needs to be edited in a plain text editor, without having access to an lsp or any other dev tools.

pkill OP ,

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.

xmunk ,

Oh, definitely, they can look bizarre and confusing before you understand them.

muntedcrocodile ,
@muntedcrocodile@lemm.ee avatar

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.

Theharpyeagle ,

You take that back, python is my homie!

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.

best_username_ever ,

In 20 years of using Python, I never had one issue with the indentation. Use spaces all the time, use PyCharm, and that’s it.

Whitespace is statistically insignificant in Python.

ace , in Go vs Rust learning
@ace@lemmy.ananace.dev avatar

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.

z3rOR0ne ,

I’m a beginner in both (heavily leaning towards putting more time into learning Rust though). Could you please elaborate a bit?

ace ,
@ace@lemmy.ananace.dev avatar

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.

Here’s one example in the form of a blog - with some examples of where hidden complexity can cause issues in the longer term; fasterthanli.me/…/i-want-off-mr-golangs-wild-ride

firelizzard ,
@firelizzard@programming.dev avatar

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.

Feathercrown ,

And the only thing more important than readability is whether or not the code does what it’s supposed to do.

Isn’t that exactly what Rust is supposed to be good at

arendjr ,

And conversely, something Go is very bad at. For example, os.Chmod silently not doing anything on Windows.

Ephera ,

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.

andrew ,
@andrew@lemmy.stuart.fun avatar

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.

BatmanAoD ,

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.

kaffiene ,

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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines