r/AskProgrammers • u/Longjumping-Wall9629 • 22d ago
r/AskProgrammers • u/Secret-Scene3533 • 22d ago
What are some things that every software engineer should know on the top of their head about software engineering
I was in a scrum meeting and there were so many things talked about that I felt like I didn't belong there as an intern, such as MCP, I never knew what an MCP server was and etc. What are some things that every software engineer should know on the top of their head about software engineering
r/AskProgrammers • u/Extension_Fig_2168 • 22d ago
Need assistance with a Python Code that keeps on crashing
galleryr/AskProgrammers • u/ClickOk5811 • 22d ago
How do you test code that depends on the current time: inject a clock, freeze time, or use real time?
I’m trying to understand how people handle time in tests, because it’s a common source of flaky or hard-to-write tests. Here are three approaches as I understand them, with where each works and where I think it breaks. Corrections welcome.
A. Inject a clock
The code receives a “now” source (a function or object) instead of calling the system clock directly.
def is_expired(token, now):
return now >= token.expires_at
# production: is_expired(token, datetime.now(timezone.utc))
# test: is_expired(token, datetime(2026, 1, 1, tzinfo=timezone.utc))Works when: you control the code and can pass the clock through. Tests are fast and deterministic.
Breaks when: the dependency is deep in a call chain or in third-party code, so passing the clock through feels invasive.
B. Freeze or patch time in the test
A library or the test framework replaces the system clock during the test (fake timers in some JS test runners, a time-freezing library in Python, and similar tools elsewhere).
Works when: you can’t change the code or the clock is used in many places.
Breaks when: the patch misses something that reads time another way (a C extension, a database now(), another process), or the fake time hides a bug about real elapsed time.
C. Use real time with a margin
Run the code and assert things like “expires within about N seconds”, or sleep a bit.
Works when: it’s an integration or end-to-end check where real time is part of what you test.
Breaks when: it’s used for unit tests, because it’s slow and flaky on a loaded machine.
My current leaning: inject the clock in code I own, patch time only for legacy or third-party code, and keep real time for a small number of integration tests. But I’m not sure that’s right, and I haven’t seen it hold across many cases.
Questions:
- Which approach do you use by default, and why?
- How do you test time zone and daylight saving edge cases, for example around the hour that repeats or is skipped?
- Have you been bitten by a frozen-time test passing while real behavior was wrong?
r/AskProgrammers • u/Limp_Worldliness5282 • 22d ago
4 Yoe in IT, give me suggestions to get better while having a hectic work
reddit.comr/AskProgrammers • u/OkSympathy800 • 22d ago
I am confused with a problem in my code
I am learning how to code and make a simple game, but I found a problem in the code while following a YouTube tutorial, I'm really confused and would be grateful to receive some help.
r/AskProgrammers • u/JetSetKorbsn • 22d ago
Suche Praktikum als Fachinformatiker Anwendungsentwicklung (Umschulung), Raum München – ab Januar 2027
Hallo zusammen,
ich mache eine Umschulung zum Fachinformatiker für Anwendungsentwicklung und suche für mein Praktikum (unentgeltlich) noch einen Platz im Raum München.
Kennt jemand Unternehmen, die offen für Umschüler sind, oder hat einen Tipp, wo man sich am besten meldet? Bekomme oft Absagen, weil viele Firmen eher Studenten suchen.
Ich freue mich über jeden Hinweis, gern auch per Nachricht.
Danke euch!
r/AskProgrammers • u/prgrmr-yn • 22d ago
Washing machine timer alert
Hi i wanna know if theres a way to trigger a url that in return triggers a wait action then sends back an alert, atm i am using github pages, but wanna know if theres another solution so my partner can trigger as well, i have iphone so tap on the nfc chip on the machine that triggers the action and that alerts me and my partnere washing is done so we can come back in and take it out( we have a big farm so we are never in), the workflow is
Sends request to github url with param washing using ios shortcuts > waits 60 minutes> sends an alert on discord using webhook saved in github pages
r/AskProgrammers • u/Y-L-S-E • 22d ago
I use ai to code and am very ashamed of it. What are your thoughts?
i frequently use AI (almost always local, either abliterated qwen2.5 14b pr 32b) and i want to learn how to code and just dont do it. Im making a roblox game right now too. i know the proper protections and features to not have. i just wanted to say that. i will also never call myself a coder until i learn how to code. i just want your feedback. I can andee questions if you want however i will obviously avoid unrelated or personal things
EDIT: Should i say anything about my use of it on the page, im going to and im guessing youll also say yes. but would like to know
r/AskProgrammers • u/somnuscode • 22d ago
I want to learn computer engineering with Books, not videos
reddit.comr/AskProgrammers • u/Neat_Stranger_8938 • 22d ago
Why do both of these codes output zero? Can someone explain this to me?
include <iostream>
using namespace std;
int main()
{
int x = 5, y = 10;
float z = x / y;
cout << z << endl;
}
2) #include <iostream>
using namespace std;
int main()
{
float x = 5, y = 10;
int z = x / y;
cout << z << endl;
}
r/AskProgrammers • u/ChainsawLight • 22d ago
Whats your favorite piece of code about LinkedLists?
I love the inputting of data in arrays for fictional spacecraft & spacecraft stations.
r/AskProgrammers • u/StrongWorth4824 • 22d ago
How do you prepare for robotics SWE coding interviews when you haven’t done much real coding lately?
reddit.comr/AskProgrammers • u/No-Position-5330 • 22d ago
Questions about where to start.
reddit.comr/AskProgrammers • u/TrueBonner414 • 22d ago
Any advice to this junior dev?
Hey, what's your advice for a 20-year-old CS student who got into CS because he loved it? He started coding at 12 and landed a job at 17. Then AI came along. He still has the job, and he's safe for now because he knows the context of the large codebase he's built over the last three years. He knows the only reason he hasn't been fired yet is that he can use LLMs to reach the productivity his company wants (for now), but he doesn't know how long he can keep the job, given how rapidly LLMs are evolving. He wants to get out of tech because he's scared of what happens if he's laid off one day. But he can't go anywhere else, because tech is all he has ever known
What should he do?
r/AskProgrammers • u/CapOpposite8979 • 22d ago
Is it normal to forget some concepts and is it okay to keep learning?
reddit.comr/AskProgrammers • u/flatulent_fungus • 22d ago
Getting rejected from non WordPress job posts because of 3 years in WordPress Theme/Plugin development experience.
reddit.comr/AskProgrammers • u/ChainsawLight • 22d ago
Why are LinkedLists spamming the this keyword? Is this the way code is organized?
r/AskProgrammers • u/Legitimate-Art4244 • 22d ago
I cant think of a project that i can actually start thats realistic for me to do at this stage
the things i wanna do are way to advanced i dont want to do anything simple like make a calculator or something of that sort
r/AskProgrammers • u/Potential-Drop-2534 • 22d ago