r/shittyprogramming • u/Monkey_Adventures • Aug 22 '20
Rubber duck debugging has solved 100% of my coding problems so far. Let me show you how it's done.
r/shittyprogramming • u/Monkey_Adventures • Aug 22 '20
r/shittyprogramming • u/flarn2006 • Aug 22 '20
r/shittyprogramming • u/tjf314 • Aug 19 '20
(lambda a:lambda v:a(a,v))(lambda f,n:(f(f,n-1),(lambda x:(lambda y:y(-~x))((lambda s:__import__(s).__getattribute__(dir(__import__(s))[-19]))('\x69'.join(["bu","ka","lt","oi","ns"][::2]))))(eval(f"~-vars()[chr({(int)(bin(6)[2:])})]")))[0]if n>0 else 0)(sum((lambda f:lambda x:f(f,x))(lambda f,n,i=2:False if n%i==0 else f(n,i+1)if i+1<__import__('math').sqrt(n)else True)(a)for a in range(20)))r/shittyprogramming • u/elSenorMaquina • Aug 18 '20
Seriously guys, it's time to stop all the "Did I include this?" "Did I include that?" that comes with every project ever.
Just make a single file on your disk named "everything.h" and throw inside all the include statements you will ever need. All your stdios, stdlibs and the whole thing in one neat place!
Then, you just include everything.h in your source files and you are good to go.
Really, it´s the best way to do it. It's how us, REAL™ programmers, do it. Anyone telling you not to do it is probably a Microsoft simp or something like that.
r/shittyprogramming • u/Monkey_Adventures • Aug 16 '20
r/shittyprogramming • u/AMusingMule • Aug 13 '20
r/shittyprogramming • u/david-teather • Aug 12 '20
r/shittyprogramming • u/mort96 • Aug 07 '20
r/shittyprogramming • • Aug 07 '20
r/shittyprogramming • u/Monkey_Adventures • Aug 04 '20
r/shittyprogramming • u/Jackeea • Jul 21 '20
r/shittyprogramming • u/Diapolo10 • Jul 19 '20
I was doing some Project Euler challenges as part of my weekend routine (below 100, so don't worry about spoilers too much), when I decided to try if I could solve Challenge 22, using one line, without having the data file separately downloaded.
Well, it turns out I managed to do exactly that. Feast yer eyes on the best solution ever known to man!
(lambda u:sum(map(lambda t:sum(map(lambda c:ord(c)-ord('A')+1,t[1]))*t[0],enumerate(sorted(list(map(lambda x: x[1:-1],__import__('urllib.request').request.urlopen(u, context=__import__('ssl').create_default_context(cafile=__import__('certifi').where())).read().decode('utf-8').split(',')))),1))))('https://projecteuler.net/project/resources/p022_names.txt')r/shittyprogramming • u/quadrillio • Jul 18 '20
r/shittyprogramming • u/jan_mike_vincent • Jul 14 '20
r/shittyprogramming • u/Monkey_Adventures • Jul 12 '20
r/shittyprogramming • u/Monkey_Adventures • Jul 10 '20
r/shittyprogramming • u/Monkey_Adventures • Jul 09 '20
r/shittyprogramming • u/mohamedaameen • Jul 07 '20
You're Googling an error and you see a Stack Overflow, GitHub, and Reddit link. Which do you click on first? Why?
Copied from Twitter
r/shittyprogramming • u/Jinjinov • Jul 08 '20
I need the numbers 3, 5, 6, 10, 12, 20 inside a double "for" loop. I could just make an array and use "i" for index, like any sane person would
int[] numbers = { 3, 5, 6, 10, 12, 20 };but I don't feel like it...
for (int i = 0; i < 6; ++i)
{
for (int j = 0; j < 12; ++j)
{
// Here I need numbers 3, 5, 6, 10, 12, 20 in any order
int number = numbers[i]; // and I don't want to use this
}
}Is there any way to get these numbers just from using "i" and "j"?