As someone with 20+ years coding experience, this only gets worse as you get more experienced.

There are way too many Notepad enthusiasts out there.

@LolaCat@lemmy.ca
creator
link
fedilink
21Y
Image Transcription:

number-1-haxorus-fan

[In large text]
The coding experience:

“Okay, everything looks good, time to run it”
Code fails
“What? Let me try again…”
Code fails
“What the fuck, where’s the issue???”
Checks syntax error
“GOD DAMN IT TELL ME WHERE THE FUCKING ISSUE IS YOU PIECE OF SHIT”
Hopelessly tries to fuck around with the code and find the error
“PLEASE PLEASE JUST WORK WHY WON’T YOU WORK-”
Notices obvious error that I should have noticed like 15 minutes ago
“Oh. I’m a fucking idiot.”
Code works now
“I have gained nothing from this experience and I will do it again”

#coding #coding pain #python #coding hell
#this is from painfully personal experience
#but replace 15 minutes with a fucking hour

57 notes

Write smaller units. Test those units. Save time.

You should switch to Rust. Through massively impressive feats of compiler engineering and a phenomenal amount of novel syntax constructs that make Rust the hardest language for existing programmers to learn, the rustc team has successfully managed to move this agony from after the program compiles to before.

This is clearly an improvement.

@pixelscript@lemmy.ml
link
fedilink
English
61Y

It’s 2023. If you’re not using an IDE or a highly extensible text editor with simple static analysis features, I really don’t know what to tell you.

GigglyBobble
link
fedilink
71Y

I had to read it repeatedly and check if it really said “syntax error”. What will those people do if they encounter their first race condition?

Well, what most of us do… manage to reproduce it by chance one out of twenty attempts and then remove any evidence that you managed to trigger it and mark the ticket “unable to reproduce”. Bury the ticket by removing any good tags or keywords and hope it’s at least three months until anyone else reports the error so you can repeat the dance.

They insert sleep(1) and print statements. No shit. I had to fix this in two projects. One was a complete rewrite.

Reading this made me nausesous. I feel your pain.

Me and my cs prof i’m TA’ing for trying to debug two swapped lines for an hour yesterday be like

Dynamically typed/interpreted language?

Python Yup that checks out.

I’ve never understood why so many languages insist on a feature that causes such a obtuse and tedious programming experience.

Python is great, until you don’t remember a function call, and can’t guess using your LSP to tell you. :/

Time to delivery is important. Moving quickly withing a language and frameworks that prioritise speed over safety gets a product out the door is important when testing whether a business idea holds merit. Once you’re established with a better scope of the project you should be rewriting this in a static language.

Dynamically typed interpreted languages should never be used for long term support imo

@traches@sh.itjust.works
link
fedilink
English
4
edit-2
1Y

Idunno, Ruby was my first language and the other day I was trying to write a one-file script to wrangle some CSV data and even that got irritating. What does this function need? What does it return? Who the fuck knows! Is it even a function? Run it and find out, loser

And I’ve got reasonably popular projects in ruby, I’m not a beginner.

Yeah I completely agree with you, but sometimes there are other things that jankier languages allow you to do. Say in python, you can do direct property assignment. This is gonna be annoying for someone later to figure out why their object has suddely changed, and without getters and setters, you’ll have a harder time picking apart what’s going on. The benefit though is that it’s very quick to just tack on a property onto some global object and then have that read elsewhere down the road.

It sucks, and you will curse yourself later, like you don’t even know what type it is, or maybe it’s just null, however it did allow you to ship a project. Maybe that bodge solution is indicative of needing a complete overhaul on how you structure your project, but until you get to that point where you’ve scoped out what the final idea looks like, it might not be time for static typing and good code design.

I also think that static typing and such makes you move a lot slower when making changes. I love rust to bits, but maintaining an old project is like wading through treacle. I only jump towards using it now once I’ve got a really great understanding of all the needs of the system, and have the time to really think about the problem in its entirety. Maybe you suddenly need a mutable self in somewhere that you didn’t before, perhaps that means going and refactoring a whole load of traits that were designed without mutability (for good reason).

Once you’re established with a better scope of the project you should be rewriting this in a static language.

Or bolt MyPy to it, right? concerned Padme meme

Edit: Wow. Somebody out there has no sense of humor about their bolt-on type solution.

Hey its better than nothing? Haha

If performance isn’t an issue, I’d take it over nothing for long term support

Yeah. I live to make fun of MyPy - or rather of Python for needing MyPy, but it’s “good enough” in many situations.

@sping@lemmy.sdf.org
link
fedilink
English
21Y

Why make fun of it though? If you make typing and being checker-clean mandatory on a Python project, you get most of the benefits of static typing. The biggest hole is if the libraries you’re using aren’t properly type annotated. Perhaps I’d feel differently if the meat of my projects was the use of badly or un-typed packages, but thankfully it isn’t.

I would rather have a statically typed language with equivalent clarity, ease of use and extensive libraries, but the benefits of Python along with comprehensive, enforced type annotation are strong. Proper thread handling could be good, but since that forces you towards avoiding monolithic executables, and using asyncio (which is a delight to use), it’s almost a benefit.

That’s a good point. I do love options.

I’ll still jest a little at Pythons expense until a type system is natively available.

Having the option of not using types is great.

Having to go discover how to do basic typing in a 3rd party library is not great.

I adore Python, though - Right down to it’s painful Logging modules.

That’s nerve wracking. But you know what’s worse? Finding code that shouldn’t work, not being able to figure out why it works, and having to leave it in production because of you “fix” it, the whole damned thing will come fluttering down like a house of cards in a slight breeze.

Then when it’s a job, you can replace that with weeks. But instead of a silly syntax error, it’s a slow memory leak that nobody seems to have noticed for years, but that now forces you to restart your service every day at the very least. And we just spent an afternoon, six people, looking at it and only making it worse.

Don’t you love programming? I sure do!

This is why linting and static typing are mandatory

This meme was written by a novice that does not yet know true pain. An error that takes fifteen minutes to find! In your own code! Ha, you young whipper snapper… just wait until you have to debug an unforeseen edge case in a library… especially if it’s compiled. And once you’ve seen that, once you’ve known that horror, come and talk to me about DLL hell.

Unless you’re working with installers and, probably, in C++ it’s unlikely you’ll ever meet this Cthonic horror. Zalgo? Tony the Pony comes? You have met that friendly demon of development? They are but the apprentice… DLL hell is a span of time measured in days.

… Alternatively talk to me about trying to track down an extra newline at the end of a PHP file, that (against all advice) has a closing tag, that causes some output to be sent preventing you from sending headers to the client. There’s no error detection for that and PHP is an interpreted language… you just need to check files manually!

I once spent 6 months debugging an issue in a legacy component of our system that ultimately boiled down to “The team this component talks with forgot to revert changes they made for testing and obstinantely refused to admit any changes were made at all for 6 months until I could figure out this deprecated technology enough to prove it enough that the product owners forced them to look”

Not really programming but I once had an issue that lasted for months like that: I’m working with a software specific to our industry that generate quotes, sales order and production orders.

For quotes and sales order a PDF can be created and archived in the right folder automatically, or you can use the windows “Print to pdf” printer to do that manually which take closes to a minute for the sales person to create the right folder, with the right name and put the PDF in there with the order number.

The automatic PDF creation fail to include our logo each time and I battled for months with the software company that was telling me that everything is working fine.

Until I looked in the metadata of the PDF the company was sending us, few of the PDFs they were sending is did not have any logo and were created by their software, some had their logo and were created with an external PDF printer.

After I realized they had the same problem internally but were lying about it I just took a day to create a python script running as a service on the server that automatically add the logo on the PDF created and that was it.

Fedora
link
fedilink
2
edit-2
1Y

I spent 7 hours to debug why doubles in Java classes brick my class file parser only to discover the following small print in the specification after I read the corresponding OpenJDK source code: In retrospect, making 8-byte constants take two constant pool entries was a poor choice. Yeah no shit. I chose to write a custom user stylesheet for Oracle specifications to enlarge notes since they’re obviously critical to the implementation of JVMs. I guess the technical writers at Oracle didn’t want to offend the developers who wrote the JVM originally at the expense of developers who write JVMs today.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.48K Posts
  • 32.5K Comments
  • Modlog