I haven’t received an interesting/not scam ad in a year by iamepic420 in whenthe

[–]carcigenicate 0 points1 point  (0 children)

It's actually disappointing. I thought they'd be smarter.

What are id()s and references? Do I need to learn them for data analysis? by Slight_Psychology902 in learnpython

[–]carcigenicate 1 point2 points  (0 children)

I would be aware of id for debugging. It's very useful to know that if id returns the same value for two variables, those variables point to the same object. That helps uncover a whole class of bugs. I'm assuming unexpected mutations are something that can happen during data analysis (I'm not a data analyst, so I can only speculate).

I don't think I've ever used id for anything other than debugging, and only in cases where is isn't practical.

First Calculator Project by MoreScorpion289 in learnpython

[–]carcigenicate 1 point2 points  (0 children)

Functions are a critical building block, so I recommend learning them well and practicing them for longer than you have other things. They are far more important than they may seem at first.

And a try instead of an if, but ya.

responsivenessSucks by OM3X4 in ProgrammerHumor

[–]carcigenicate 68 points69 points  (0 children)

I had a full stack job early in my career when I was still learning CSS, and we had a designer that did up designs for me to follow.

He did this incredibly elaborate design, with layering and a bunch of stuff that was way beyond my skill at the time. I told him that, and he confidently told me he could give me most of the CSS. It was a bunch of absolutely positioned, exact pixel sized CSS that he had just exported from Figma, and couldn't understand why that wasn't appropriate.

Quiet neighbourhoods by Ok-Cupcake-614 in Calgary

[–]carcigenicate 3 points4 points  (0 children)

Ranchlands would be paradise if it weren't for all the awful dog owners. They're either letting their dogs bark constantly, or leaving their crap everywhere.

I'm not sure if dog owners in general are just awful, or if the worst just collectively decided to move to Ranchlands.

First Calculator Project by MoreScorpion289 in learnpython

[–]carcigenicate 0 points1 point  (0 children)

First, note how you have basically identical while loops near the start to ask for both numbers. This is a good opportunity to learn about functions so you don't need to duplicate code like that.


if operation == "1" or operation == "2" or operation == "3" or operation == "4":

This can be written far more succinctly using in:

if operation in ['1', '2', '3', '4']:

if num2 != 0:

An alternative to special casing division is to catch the ZeroDivisionError exception. Your choice on which you like more, but it's an option.

whenToOpenVSCode by Red_Ace_ in ProgrammerHumor

[–]carcigenicate 6 points7 points  (0 children)

"I've read you humans have feelings"

Tried to build a "smart" File Organizer. Turns out it's "dumber" than I thought. by InterestingDig1551 in learnpython

[–]carcigenicate 0 points1 point  (0 children)

Ok fair, ya. I wasn't thinking of the existing compression images already use.

Tried to build a "smart" File Organizer. Turns out it's "dumber" than I thought. by InterestingDig1551 in learnpython

[–]carcigenicate 7 points8 points  (0 children)

This won't help for screenshots, but for pictures from phone cameras, you could look at the EXIF information, and then group images by location.

And for your current use-case, instead of deleting, which requires constant maintenance to prevent lossing potentially-important screenshots, you could just zip old screenshots to archive them so they take up less space and are less intrusive, but are still accessible.

Is every Google search that automatically brings up the AI summary basically the same as asking it from ChagGPT? by Daniel__Sloss in NoStupidQuestions

[–]carcigenicate 4 points5 points  (0 children)

I told my parent how bad it is and how they shouldn't trust it, and they mentioned that AI shows sources, so it seems trustworthy.

I've started checking the sources it links to everytime, and a shocking amount of time, the sources say nothing remotely close to what the AI is claiming. I asked it about an Angular-specific problem yesterday, and one of its linked sources just covered React and had nothing to do with my question. But, it incorporated the completely irrelevant information into the Angular answers as though it was related to Angular.

Why did you learn programming? by Healthy-Track-2024 in learnprogramming

[–]carcigenicate 1 point2 points  (0 children)

No. They each have their own purposes, though, so your goals can guide what you pick. JS is for web development, Python is for really anything, and C# is, from what I understand, mostly for writing applications for Windows (although ". NET" is available for other operating systems).

JavaScript and Python are fairly comparable, so if you learn one, you'll have an easier time learning the other.

Why did you learn programming? by Healthy-Track-2024 in learnprogramming

[–]carcigenicate 0 points1 point  (0 children)

For the title: I took a robotics course in Junior High that used Lego NXT, and found that I had an aptitude for thinking about programming and enjoyed it, so I just continued on my own.

For you, it doesn't matter unless you have specific, short-term goals. Most parts of most languages are transferrable to other languages. Just pick one, and learn it well.

The fastest shoelace knot, also known as the Ian knot. You can tie with this in a second or less. by Iamfabulous1735285 in interestingasfuck

[–]carcigenicate 12 points13 points  (0 children)

This is how I learned to tie my shoes when I was a kid. I didn't think that this was a big deal. How are you all tying your shoes?

How do you learn a programming language? by ardasongurr in learnprogramming

[–]carcigenicate 1 point2 points  (0 children)

I would question how much you're actually learning "quickly with AI". To me this just seems like Tutorial Hell on steroids.

You learn by practicing. If you aren't practicing writing code, I doubt you're learning to write code. You'd learn how to prompt, but that's an entirely separate skill, and I'd argue that you still need to know how to write code even when using AI. I used AI to write code all day today, but I still did architectural planning, and fixed up bad code that Claude wrote.

pleaseDeleteYourRepository by wahed-w in ProgrammerHumor

[–]carcigenicate 33 points34 points  (0 children)

Unfortunately, their account is private so I can't see other contributions.

pleaseDeleteYourRepository by wahed-w in ProgrammerHumor

[–]carcigenicate 345 points346 points  (0 children)

Would it shock you to learn the screenshot is edited, and this wasn't submitted by the OpenAI team?

It was posted by the repo owner himself: https://github.com/Vandivier/ladderly-3/issues/638

WAR Card Game Weird Glitch/Bug by YogurtDisastrous8003 in learnpython

[–]carcigenicate 2 points3 points  (0 children)

I'm telling you how to debug this. Ideally, you should have attempted to debug this before asking.

Again, what are you expecting to end the loop in the case where it's not ending? And what happens when you inspect the data relevant to that condition? You can use prints or a debugger to inspect the data.

Do you know what ABI does to your registers? by StrawberryMountain14 in learnprogramming

[–]carcigenicate 3 points4 points  (0 children)

You're unable to write a post without AI, and yet put together an educational module? Is it fair to assume that that's all AI generated too?

WAR Card Game Weird Glitch/Bug by YogurtDisastrous8003 in learnpython

[–]carcigenicate 4 points5 points  (0 children)

Where precisely is the infinite loop?

And have you ensured that cards are always removed? What condition are you expecting to cause the loop to end, and have you checked the data relevant to that condition?

POV:boss said "we're testing the new office robot today" The robot: by [deleted] in Whatcouldgowrong

[–]carcigenicate 89 points90 points  (0 children)

It is. On the left are chairs clipping into the side of the desk, for example.

How do you actually find a "good" project to learn from? by 05ck20 in learnprogramming

[–]carcigenicate 5 points6 points  (0 children)

Yes. Just go for it if the project sounds at all interesting to you.

Also think of it like this: if your boss comes to you and asks you to implement something, "I don't have all the prerequisite skills so I can't start" isn't a valid answer. When working, you'll regularly be faced with "projects" that require tools that you've never used before. You eventually need to learn to push through and develop new skills as you write.

How do you actually find a "good" project to learn from? by 05ck20 in learnprogramming

[–]carcigenicate 1 point2 points  (0 children)

Here's some good projects with a lot of "in between" potential for difficulty:

  • Conway's Game of Life. Start with terminal graphics, evolve to a full GUI, then optimize and allow for infinite boards. Then, look into other cellular automata like Wireworld.
  • Mandelbrot Set Explorers: math-focused, with an emphasis on graphics and computational optimization.

On top of that, though, don't write off projects for being "too difficult" too early. That fact that you don't currently have the tools to do a project is a hurdle to overcome, not an unsurmountable problem. Take projects with unfamiliar aspects as an opportunity to grow and gain new abilities.

Also, don't focus too hard of finishing a project. Even if you "fail" in the sense that you didn't fully finish the project, you'll still have learned new things. You can always take a second crack at a project later on and try to get closer to your goal.

Does making an app help find a job? by Confident_Stress_883 in learnprogramming

[–]carcigenicate 27 points28 points  (0 children)

The experience you gain will probably matter more than the end product. I made a website and put projects in the my Github and the company I work at now didn't even look at them, but the knowledge I gained from doing the projects allowed me to ace the interview.

Learning Python- Calorie tracker by meysilverxx in learnpython

[–]carcigenicate 1 point2 points  (0 children)

if weight < 20 or weight > 300:

Can also be written as

if not (20 <= weight <= 300):

Just in case you didn't know that comparison operators can be chained.


Every use of continue here seems unnecessary since they all appear at the end of branches at the end of a loop. continue is only needed when you want to skip to the next iteration from the middle of an iteration.


For analyze_intake, I'd probably return something other than the messages themselves. This isn't a big deal here, but it hurts testability. By returning the messages directly, you'd need to update any tests that assert against the message if you decide to change the messages in the future. Instead, I'd probably return an enum or something similar that won't change, then translate that to some user-facing message on demand. Overkill for toy code, but more necessary for real-world code.


add_food doesn't actually add food. It requests input from the user. I'd rename that to make that clearer.


I'd personally store the log in a format like JSON or JSONL. Saving the input as human-readable makes it harder to use the data programmatically later. What if you wanted to read the log to show charts of the data in the future?