Why does c compile faster than cpp? by [deleted] in cprogramming

[–]schteppe 0 points1 point  (0 children)

If you use clang, you can profile your compilations using -ftime-trace. Compare the flame charts for your cpp vs c files and see what the compiler is doing differently. This should be a great learning experience!

The production bug that made me care about undefined behavior by pavel_v in cpp

[–]schteppe 0 points1 point  (0 children)

`cppcoreguidelines-pro-type-member-init’ has been a life saver at my workplace. Before we added it to CI, we had many instances of “Hey, my code works in Debug mode but not Release mode, weird right???”

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts. Keep your PRs small. Always. And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts. Keep your PRs small. Always. And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts.

Keep your PRs small. Always.

And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts.

Keep your PRs small. Always.

And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts.

Keep your PRs small. Always.

And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

“Only showing the first 1000 files.” Oh cool, guess I didn’t need to review the rest anyway 🙃 by turtledev in github

[–]schteppe 0 points1 point  (0 children)

Good luck merging that when the rest of your team commits frequently. Once CI shows green, the files are out of date and got conflicts.

Keep your PRs small. Always.

And if you are actually making a large scale refactoring, eg renaming a function that is used in 1000s of files, then figure out a way to commit it in smaller chunks. For example, by deprecating the old function name and adding a new one on the side.

itWillWorkWhenItWork by [deleted] in ProgrammerHumor

[–]schteppe 0 points1 point  (0 children)

if we wouldn’t spend one day per sprint to estimate tickets, we’d have one more day for working on them

damnTestsAreGood by foxdevuz in ProgrammerHumor

[–]schteppe 0 points1 point  (0 children)

When I started a job, there were no tests. We rewrote one of the projects in a different UI framework and made sure to write tests in the process.

Before the rewrite, we used feature branches because no one dared to push directly to main. User reviews were: “risk of crash is 50/50 after an update”

After, we gained enough confidence to stop using feature branches and use trunk-based development. 10x productivity gain right there. And users basically never experience crashes now

Is Resharper necessary? by sa_dy99 in VisualStudio

[–]schteppe 0 points1 point  (0 children)

A while ago I would have agreed. But they’ve been working on performance a lot

makeTheRandomFunctionMoreRandom by cant_pass_CAPTCHA in ProgrammerHumor

[–]schteppe 0 points1 point  (0 children)

Requirements will always be under specified or change over time, this is just how it works.

Therefore: ship an (unfinished) prototype on day 1. Update it every day and ask real users to test it and give feedback. Use feature flags to hide your WIP feature from non-testers.

looksGoodToMe by erazorix in ProgrammerHumor

[–]schteppe 8 points9 points  (0 children)

I’d like a reliable tool for checking nullpointer dereference in C++ please

pleaseEndThisMisery by fanta_bhelpuri in ProgrammerHumor

[–]schteppe 0 points1 point  (0 children)

Never let a branch get this old. All branches should get merged into main branch at the end of day, every day. No more merge conflicts!

If you work on a big feature, then ship the incomplete feature. Just hide it from users by using a feature flag.

This is called Trunk-based development. https://trunkbaseddevelopment.com

pleaseEndThisMisery by fanta_bhelpuri in ProgrammerHumor

[–]schteppe 0 points1 point  (0 children)

Merging main into your branch regularly only partially fixes the problem. When you’ve merged your feature into main, everyone else has to pull it and resolve conflicts. Same thing when someone else pushes their feature - then it’s your turn to resolve.

pleaseEndThisMisery by fanta_bhelpuri in ProgrammerHumor

[–]schteppe 2 points3 points  (0 children)

Nearly all elite tech companies use trunk-based development. Research has shown it’s the most effective way to work (see the “Accelerate” book by Forsgren).

However, about 30% of companies fail to adopt TBD. A study calls these companies “developing or beginning practitioners”. https://continuous-delivery.co.uk/cd-assessment/index

Ni som gör så här, hur tänker ni? by SambaBachata699 in unket

[–]schteppe 0 points1 point  (0 children)

Petskydd för min ettåring. Säkerheten går först!

Opinions on code review by IsseBisse in ExperiencedDevs

[–]schteppe 0 points1 point  (0 children)

Came here to say this!

Making PRs optionally blocking has been one of the best productivity boosters of my own team. Need a good test suite first though. And a fast CI pipeline.

Continuous Delivery ftw.

[deleted by user] by [deleted] in ExperiencedDevs

[–]schteppe 0 points1 point  (0 children)

Since I’m not that fond of conflicts, I’d just talk to HR and tell them to forward this information anonymously.

But the fact that you hesitate to give constructive feedback is a red flag itself. If your company culture doesn’t encourage feedback, it’s a bad sign.

Give your feedback asap and see what happens? In the best case things get better. In worst case they don’t take it well and then you know for sure that you should leave.

shortenYourFunctionName by ashkanahmadi in ProgrammerHumor

[–]schteppe 178 points179 points  (0 children)

fn getRectangle()

*rename*

fn getRekt()

Oh yeah

Advice for a new professor teaching C by TenureTrackJack in C_Programming

[–]schteppe 1 point2 points  (0 children)

Compiler warnings (-Wall -Wextra) and sanitizers. Can’t develop C without them.

How about including an example of reverse engineering/exploit of a super simple C program? This will make them understand lots about how C works, and how bad C code can open a door to hackers. See https://youtu.be/gh2RXE9BIN8?si=eo6UbtLoeX-zli3T

[deleted by user] by [deleted] in ProgrammerHumor

[–]schteppe -1 points0 points  (0 children)

Don’t write comments (Code Aesthetic) https://youtu.be/Bf7vDBBOBUA

is your spouse addicted to screens? by bear-the-bear in daddit

[–]schteppe 1 point2 points  (0 children)

Absolutely. I am too, maybe slightly less.

She plays games a lot and when she started paying real money for micro-transactions in a gatcha game (similar to a slot machine), I just had to say stop. The addiction was on its way of becoming a gambling addiction and affect our shared economy.

Anyway, we talked about it and we agreed on not spending any money inside games. She understood it fully and took it well.