r/shittyprogramming • u/sysroot107 • Mar 20 '18
r/shittyprogramming • u/ycz6 • Mar 05 '16
[interesting] The story of how AT&T copyrighted an empty file, which was later optimized
r/shittyprogramming • u/birdbrainswagtrain • Jun 10 '15
A fun piece of code in the Source SDK
r/shittyprogramming • u/Jonno_FTW • Feb 02 '15
Why solve a project euler problem yourself when you can use a web solver!
r/shittyprogramming • u/IronTek • Sep 13 '16
This probably explains why the WD MyCloud Uninstaller Crashes
r/shittyprogramming • u/weirdalexis • Apr 21 '16
Should I switch to UTF-8 or is it better to wait for UTF-9?
Boss wants UTF-8 but it's like 40 yer old. Better wait no?
EDIT: someone pointed out UTF 2016 is a thing. So UTF-16 be it. Thanks for all the advice.
r/shittyprogramming • u/Am0s • Feb 06 '16
Will president Sanders break my projects when he does away with inheritance?
This seems bigger than y2k, why is nobody talking about the clear threat this man poses to languages that are too big to fail, like Java?
r/shittyprogramming • u/Wxyo • Aug 02 '22
Extensions to Python's operators +=, -=, etc.
In Python, you can rewrite
a = a + b
a = a - b
a = a * b
a = a / b
# etc. for //, &, |, ^, **as
a += b
a -= b
a *= b
a /= b
# etc. for //=, &=, |=, ^=, **=I propose to extend these based on the fact that I keep wanting to do stuff like this.
a = ~a --> a ~=
a = a[:-1] --> a [:=] -1
a = a[1:] --> a [=:] 1
a = f(a) --> a f=
a = f(a,b) --> a f= b
a, = a --> a ,=
a = [a] --> a [=]
a = a == b --> a === bGuido plz
r/shittyprogramming • u/keksdieb • Sep 20 '19
"Our system uses a special algorithm to boost your products."
r/shittyprogramming • u/BuonaparteII • Nov 18 '18
how to build an AI which asks questions on stack overflow to reprogram itself
I only accept O(1) answers, thanks
r/shittyprogramming • u/[deleted] • Feb 03 '18
okay, think i understand cache memory now.
r/shittyprogramming • u/robertgfthomas • May 27 '16
Hey, guys, I made this great Tic Tac Toe game!
r/shittyprogramming • u/[deleted] • Dec 10 '14
This Google new code that makes Google search 100-150 milliseconds faster. Notice that the function ends in line 1.
r/shittyprogramming • u/imwearingyourpants • Feb 15 '14
Am I doing it right? [x-post from /r/webdev]
r/shittyprogramming • u/[deleted] • Aug 31 '19
Browsing StackOverflow when I discovered this perfect way of exiting an application. It's perfect.
r/shittyprogramming • u/[deleted] • Jan 23 '15
ShittyDB: a fast, scalable key-value store written in Python
ShittyDB is a fast, scalable key-value store written in Python. It is also asynchronous, purely functional, sharded, distributed, clean-coded, lightweight, and fault-tolerant even though I don't know what those words mean. It is also embeddable. Here is the entire source code:
#shittydb.py
import subprocess
def set(key, val):
f = open(key, 'w')
f.write(val)
f.close()
def get(key):
return subprocess.check_output(["cat", key])The philosophy surrounding ShittyDB is: more code means less fast so tiny code means fast. There is very little code here so it will be lightning fast and very scalable. Here is how to use it:
>>> import shittydb
>>> shittydb.set('foo', 'this is really fast')
>>> shittydb.get('foo') # wow super fastPlease build your business on top of this super scalable data store
r/shittyprogramming • u/DoktuhParadox • Jan 01 '15
<wrong_sub>this</wrong_sup> Spotted in a GameTheory episode
r/shittyprogramming • u/Monkey_Adventures • Nov 02 '20
super approved I tried recreating the Windows troubleshooting feature. How'd I do?
#include <windows.h>
#include <stdio.h>
int main() {
printf("Searching for problems...\n");
Sleep(60000);
printf("We didn't find any problems\n");
}r/shittyprogramming • u/TheSalamiKing • Feb 11 '20
<%=quality comments; --!> When you dont know what .ToString() is
r/shittyprogramming • u/tehdog • Dec 01 '15
"We can't accept your pull request because it contains comments, which our style guide prohibits" - the Signal devs
r/shittyprogramming • u/jkjustjoshing • Apr 19 '16
Pro Tip: To keep your commit history clean, always commit using "git commit --amend"
No one likes a cluttered commit history. Keeping your projects to just 1 commit reduces the number of commits you need to go through to find where a change was made.
r/shittyprogramming • u/gistya • Feb 04 '16
OMG they were actually doing this.
So I inherited an iOS project from some shitty programmers in a highly populous non-USA nation which I will not mention by name. I'll let you just guess ;D
The project has an iOS client that, every minute, syncs with a server in the background while you're using the app. I was noticing that for some reason the Settings View Controller was constantly being allocated randomly even though I was not going near it.
Then I realized why... in the background syncing class, they did this fucking shit:
- (void)SyncToServerFinishedWithSuccess:(NSDictionary *)successDictionary {
**SettingsViewController *settingsVC = [[SettingsViewController alloc] init];**
**[settingsVC.settingsInfoTableView reloadData];**
//rest of the code
}Reminds me of a scene from Full Metal Jacket:
HARTMAN Holy Jesus! What is that? What is that, Private Pyle?!
PYLE Sir, a view controller initialization, sir!
HARTMAN A VC initialization?!
PYLE Sir, yes, sir!
HARTMAN How did it get here?
PYLE Sir, I copied it from the main view controller, sir!
HARTMAN Is UI allowed in the background threads, Private Pyle?
PYLE Sir, no, sir!
HARTMAN Are you allowed to write initialization methods, Private Pyle?
PYLE Sir, no, sir!
HARTMAN And why not, Private Pyle?
PYLE Sir, because I'm too slow, sir!
HARTMAN Because you are a horrifyingly stupid idiot, Private Pyle!
PYLE Sir, yes, sir!
HARTMAN Then why did you hide a view controller initialization method in the background web service thread, Private Pyle?
PYLE Sir, because the table wasn't updating, sir!
HARTMAN Because the table wasn't updating?
Holding out the iPad, HARTMAN walks down the row of recruits still standing with their arms outstretched.
HARTMAN Private Pyle has dishonored himself and dishonored the platoon! I have tried to help him, but I have failed! I have failed because you have not helped me! You people have not given Private Pyle the proper motivation! So, from now on, whenever Private Pyle fucks up, I will not punish him, I will punish all of you! And the way I see it, ladies, you owe me for one random view controller initialization statement in a background web service thread! Now, get on your faces!
HARTMAN (to PYLE) Press "Build"!
He shoves the iPad into PYLE's mouth.
HARTMAN They're paying for it, you eat it!
HARTMAN turns to the recruits.
HARTMAN Ready . . . exercise!
The platoon does push-ups.
RECRUITS (chanting in cadence)
One, two, three, four! I love the Marine Corps! One, two, three, four! I love the Marine Corps! One, two, three, four!