r/shittyprogramming • u/teatacks • Jul 10 '15
I did it! I just wrote a program that passed the Turing test!
Here's the output of our latest chat session:
Me: Hi
Carl: Hello
Me: Are you a bot?
Carl: No
Carl: :)
Me: Okr/shittyprogramming • u/teatacks • Jul 10 '15
Here's the output of our latest chat session:
Me: Hi
Carl: Hello
Me: Are you a bot?
Carl: No
Carl: :)
Me: Okr/shittyprogramming • u/poothspactus • Apr 29 '24
r/shittyprogramming • u/TheUnwelcomeJester • Aug 21 '14
r/shittyprogramming • u/GarethPW • Aug 30 '16
Acknowledging the UK's upcoming departure from the EU, import costs are undoubtedly going to increase. To reduce the effect, I recommend the following steps.
If you're only importing one or two items, write them yourself instead.
Make sure you never import all items in a package if you won't use them all.
Shorten import names to increase efficiency.
Low-level interfaces will let you optimise to reduce cost.
Before
import time
time.sleep(1)After
from time import sleep as s
s(1)Before
import urllib2
result = urllib2.urlopen("http://www.reddit.com/").read()After
from socket import socket as a
from socket import AF_INET as b
from socket import SOCK_STREAM as c
s = a(b,c)
s.connect(("reddit.com",80))
s.send(b"GET / HTTP/1.1\nHost: www.reddit.com\n\n")
result = s.recv(10000)r/shittyprogramming • u/samuraiseoul • Jul 07 '16
My friend was telling me that Random is sudo random.
r/shittyprogramming • u/notverycreative1 • Mar 29 '16
r/shittyprogramming • u/aerosole • Jan 19 '16
Don't use obvious names for your database tables like 'users' or 'products'. This makes it easy for malicious users to enter things like ";DROP TABLE users" and drop your tabels. Instead make table names hard to guess by using the same strategies you should use for picking passwords:
Replace letters with numbers: 'us3rs', 'pr0ducts'
You can also prefix them with a salt: 'salt_us3rs', 'salt_pr0ducts'. This should secure any rainbow tables as well. This is really basic stuff and called security through obfuscatery. Take care!
r/shittyprogramming • u/BassGaz • Oct 06 '18
r/shittyprogramming • u/FoxFire64 • Dec 10 '17
r/shittyprogramming • u/mktiti • Apr 21 '15
r/shittyprogramming • u/tmewett • Jun 15 '14
This sub is mainly for bad practices and downright stupidity in writing program source code. A bug is not a sign of shitty programming!
Thanks, and enjoy your stay
Hmm. As /u/ekolis rightly says, it's not /r/badcode/ either. Mods! Define the sub better! ;)
r/shittyprogramming • u/[deleted] • Feb 16 '14
r/shittyprogramming • u/Cosmologicon • Nov 23 '16
In computer science a fundamental law is that if I have one Turing Machine I can build any other Turing Machine. If I have COBOL then I can bootstrap a compiler for FORTRAN.... if I cannot create another Turing Machine in your language, then your language cannot be Turing Complete.
Currently you cannot run Python 2 inside the Python 3 virtual machine. Since I cannot, that means Python 3 is not Turing Complete and should not be used by anyone.
r/shittyprogramming • u/[deleted] • Jan 10 '16
I'll then write yours for you. PM me, thx!
r/shittyprogramming • u/SaraphL • Oct 06 '15
r/shittyprogramming • u/tophernuts • Oct 01 '14
r/shittyprogramming • u/legendaryroots • Feb 25 '15
So this just happened at a Fortune 100 company that I contracted for...
When pushing to production a new requirement came down that unit tests needed to have 80% code coverage. This was a big issue, because unit tests weren't even part of the requirement let alone this much code coverage for such as large application.
So I throw up the red flag and say we have to delay the launch because apparently the 80% coverage is a "unchangeable automated check". To which the senior developer responds with the following:
"Oh don't worry about it - just add a 5000 line private function that just writes to the debug log, and call it with the unit test."
Now that is thinking outside the box. A shitty box.
r/shittyprogramming • u/[deleted] • Sep 16 '14
Go into Internet Explorer or any of the lesser browsers
Press F12
Type the following into the console:
document.title=document.title+' (Not Responding)';var el=document.createElement('div');el.setAttribute('style','cursor:wait;position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(255,255,255,.8);z-index:2147483647');document.body.appendChild(el);
Voila! Instant crash!
r/shittyprogramming • u/Pandalism • Apr 20 '13
r/shittyprogramming • u/Intrexa • Dec 07 '20
Right now, given a list of n destinations, the current solution for a traveling salesmen to visit each destination once without repeating roads is for the salesmen to not actually do that. There's covid out there, it's just irresponsible to go door to door. The solution is to just stay home.
r/shittyprogramming • u/[deleted] • May 08 '18
println(2.718) just prints 2.718 instead of 1. any ideas?