/r/shittyprogramming

Photograph via snooOG

r/ShittyProgramming is participating in the Reddit blackout begging June 12th to protest the planned API changes that will kill third party apps.

More here: https://www.theverge.com/2023/6/10/23756476/ & https://archive.is/RtZdp.

For general news and info on the situation: r/Save3rdPartyApps and r/ModCoord.

Join the r/ShittyProgramming Discord server to discuss whatever: https://discord.gg/shittyprogramming

We will not be adding approved users to the subreddit during the blackout.

Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?

Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.

/r/shittyprogramming

103,227 Subscribers

56

Django Unchained

11 Comments
2025/01/18
18:44 UTC

389

Struggling with this interview question

27 Comments
2025/01/02
00:17 UTC

12

The real way to commit

For all the beginners, this is how you commit to git:

git -c color.status=always -c user.name="$(git config user.name)" -c user.email="$(git config user.email)" -c commit.gpgsign=false add --verbose . && git reset && git add -A && git -c core.autocrlf=input -c core.safecrlf=warn commit --gpg-sign --no-verify --allow-empty --cleanup=whitespace --verbose --date="$(date -u +%Y-%m-%dT%H:%M:%SZ)" --author="$(git config user.name) <$(git config user.email)>" -m "$(echo "feat: changes made at $(date)" | base64 | rev | base64 | tr 'A-Za-z' 'N-ZA-Mn-za-m')" && git push origin "$(git rev-parse --abbrev-ref HEAD):$(git rev-parse --abbrev-ref HEAD)" --force-with-lease --recurse-submodules=check --progress 2>&1 | tee >(cat >&2)

I think I have commitment issues...

0 Comments
2024/12/22
06:52 UTC

33

Anyone else casually says 'fu*k you' when Copilot suggestions pop up by accident?

8 Comments
2024/12/21
12:03 UTC

23

Production code my eyes were blessed to see

userData.name = session.user.firstName as string as string;

10 Comments
2024/12/20
08:35 UTC

9

When you need to reach the max line count..

So I'm reviewing a repo for work, written by an external contractor a long time ago trying to make sense of everything. Despite the horrible lack of documentation/ comments, there are so many overly complicated pieces of code for no apparent reason. This one made me laugh a bit though and thought it worth sharing:

public decimal CalculateEffectiveBalanceWithPrecisions(decimal balanceEffectiveEras, BigInteger balanceTotalBalance,
    int decimalPlaces = 2)
{
    const long baseFactorDecimalPlaces = 10;

    var baseFactorWithDecimalPlaces = (long)Math.Pow(10, baseFactorDecimalPlaces);

    var denominator = (long)Math.Pow(10, baseFactorDecimalPlaces);

    var effectiveEraPortionInCycleInMillion =
        new BigInteger(balanceEffectiveEras / ErasInCycle * baseFactorWithDecimalPlaces);

    var effectiveBalanceInMillion = balanceTotalBalance * effectiveEraPortionInCycleInMillion;

    var effectiveBalance = decimal.Parse((effectiveBalanceInMillion / denominator).ToString());

    return effectiveBalance;
}

Simplified without the unnecessary padding it looks like:

public decimal CalculateEffectiveBalance(decimal balanceEffectiveEras, BigInteger totalBalance)
{        
  return (decimal) totalBalance * balanceEffectiveEras / ErasInCycle;
}
3 Comments
2024/12/12
22:19 UTC

189

wtf is this

28 Comments
2024/12/09
15:54 UTC

0

Do you think i can find aVLC plugging for readding this?

4 Comments
2024/12/02
00:13 UTC

35

fun_with_memory()

12 Comments
2024/11/28
20:22 UTC

239

Work smarter, not harder.

18 Comments
2024/11/27
18:57 UTC

6

Formated Database Value

The company I work for asked me to add a column to the database with a formatted numeric value, WTF

"

  1. Apply this intl rule as in the example in the link only on the preview screen and in the app

  2. Handle it in the backend by adding a new column

  3. Add a new column in the backend with the formatted value

  4. Display the formatted value on the screen

"

for example:
one column for the PRICE: 12000000
and other column for the PRICE_FORMATED: 12億円

why they dont just put it in frontend ?....

1 Comment
2024/11/18
11:54 UTC

229

I'm sorry but who the hell decided this was a good idea?

48 Comments
2024/11/17
16:15 UTC

43

Some situations are just unavoidable

4 Comments
2024/11/12
14:43 UTC

116

diabolical

7 Comments
2024/10/22
01:48 UTC

311

Why Stack Overflow people don't want to answer my question... 😔

28 Comments
2024/10/19
18:19 UTC

47

What do you think about my visual programming style? Would this pass code review?

𓀥=lambda*𓁆𓀕:"".join(str(𓁆𓀕[0])[𓀥]for 𓀥 in 𓁆𓀕[1:]);𓀣𓁀,𓁆𓀟,𓁆𓀕,𓀥=chr(63),𓀥(type(0.),2,10,4,5),𓀥(type("",(),dict(𓀥=lambda:𓀥))().𓀥,9,10),𓀥(type(0),8,5);𓁆𓀕+=𓀥

print(
    𓀥 , 𓁆𓀕,
    𓁆𓀟, 𓀣𓁀,
)
9 Comments
2024/10/12
11:44 UTC

194

Tired of IDEs that don't show line numbers by default? Try this easy trick.

17 Comments
2024/10/05
23:47 UTC

31

A Brief Overview of D##: The Language of the Future

Announcing D##: The ONLY Language of The Future (Well, That & Ruby)

We're proud to announce D##, an evolutionary jump over all known program languages.

What Is D##?

D## is a future-forward programming language with multi-paradigmancy support: OOP, DOOP, visual (AR/VR), passive aggressive, co-dependency dejection.

D##'s ultimate golazo is to give developers unspeakable power, while at the same time maintaining JavaScript-like ehh-good-enough. ^(Penultimate: move fast but stop breaking things)

D## is currently in very early development, with the aim to release a limited, non-compliable pre-Omikron language preview by end of year.

We highly support and are greatly committed to maintaining D## as a Patreon-tiered open-sourced project. pre-IPO.

Want to contribute? Head over to our Patreon page and select gold-tier for repo access!

D## Feature Set

  • Stronk type system
  • Ducky typing
  • Exception-based eventing
  • Language-level codependency dejection
  • 1st-class comments
  • Generics
    • Type embrasure
    • Half-open & half-closed generics
  • Rich BAT file ecosystem
  • Dedicated IDE via OneNote
  • Familiar syntax influenced by C#, F#, and the Cambrian Explosion
  • Mutable constants
  • Instantiable everything
  • Emoji identifiers
  • Mandatory Bulgarian notation
  • Words of affirmation upon save & build success
  • Is not PHP

D## Future Set

The following god-tier features are in-development:

  • CompiLLM (LLM-enabled compiler)
    • Misspell-tolerant & case-insensitive member access
    • Infers what you intended your source code to do and compiles that
    • JIT code reviews
    • Configurable comment prose style
  • Targeted in-source advertising
  • Subscription model
  • Season 1 DLC Pass
  • Permadeath
  • Hands-on DevEx team to "encourage" D## developers adhere to S.O.L.I.D. (New York/New Jersey ONLY)

What's Next?

Follow us on TruthSocial for the latest news & updates!

VC? DM!

9 Comments
2024/10/04
12:18 UTC

0

PSA: Always Make Sure Your Code Is Readamentable

6 Comments
2024/09/30
19:01 UTC

53

my company's docker liscense expired. When searching for alternatives, i found podman. How do I get enough whales? What kind do I need? (i'm assuming blue?)

8 Comments
2024/09/26
03:56 UTC

59

I got told to get arch for a prod server, so i took a plane to St. Louis. However, as i was harvesting it, i got screamed at by the cops. Any ideas? Is a bomb the wrong tool for the job?

12 Comments
2024/09/24
18:15 UTC

3

password must be exactly 14 characters   BUT WHY

1 Comment
2024/09/24
17:34 UTC

38

[Discord] If only there was an emoji that matched my search...

2 Comments
2024/08/31
11:41 UTC

99

sudo shutdown -h now to optimize

2 Comments
2024/08/31
07:48 UTC

42

POV: You barely knew PHP & SQL

10 Comments
2024/08/09
22:03 UTC

Back To Top