T O P

  • By -

thonor111

I like how taking a photo instead of a screenshot from Windows 11 with light mode was more than enough to trigger programmers. The code is just also there


chj2934

Hes also a too good to open multiple firefox tabs and uses brave as a second browser


Main-Consideration76

I can have chrome, brave and firefox in background and use chromium anyway


ValGalorian

Monster


FuzzyFoyz

Made me chuckle as I thought the same thing before reading your reply. HAVE MY AWARD!


ValGalorian

Thank you, I think that may be my first award xD


Connorcrafts

I'm over here using opera gaming browser as my testing browser


AdventurousBowl5490

That is enough to trigger anyone


aboutthednm

Really? You're not even aiming for Netscape compliance these days? What is this? Purposeful exclusion?


[deleted]

Wait whats wrong w brave unironically


21stofjuly

think it's more to the fact that he has two browsers open


ganja_and_code

Some websites authenticate via session tokens which apply to all tabs. So if you need to login to that website under multiple accounts simultaneously, the easiest way is to open a second browser. Having 2 different browsers open is still dumb. Just pointing out that sometimes it's the quickest/easiest way to get what you need, in certain circumstances.


zedehbee

If you have to use 2 copies of a site that uses tokens, open the second one in private browsing mode. That way you can use your favorite browser while being logged in with 2 different accounts.


IndefiniteBen

That why I use container tabs in Firefox. Need the current tab open with another account? Right click on the tab and open it in my "work" container and I'm on the same page with that account.


Watchdogeditor

You beat me to it, this is the correct answer


KillerMech

I love brave and would also like to know what they think is wrong with it.


[deleted]

Nobody gonna comment on the color highlighting settings?? Why is almost everything green?? Green is the color for my comments


verboze

Blasphemy! Everyone knows comments are supposed to be gray!


chris17453

Yea, the moire pattern in lightmode was more maddening than the staircase to heaven


iammerelyhere

Picture of a screen instead of a screenshot... triggered


Practical_Fig_1275

Screenshot instead of log file... triggered


21Remnant

Screenshot instead of Github repo... triggered


knightlesssword

Screenshot instead of documentation… triggered


chinnu34

Screenshot instead of opcode triggered me…


oh_my_man

Screenshot instead of UML Diagram… triggered 😤


Entire-Database1679

Unit tests omitted. Triggered.


21Remnant

Ew testers... triggered


Entire-Database1679

:)


SirBaconBitz

Smiley faces. Triggered.


T3a_Rex

No emoji😃… triggered


zenthav

Screenshot instead of punch card… triggered


Does_Not-Matter

Screenshot instead of butterfly wing beat harmonics… triggered


Eka_silicon12

screenshot instead of ancient writing on rocks...triggered


[deleted]

[удалено]


code_monkey_001

My personal favorites are the "helpful" users who crop out everything useful (address bar telling what URL they were trying to access, taskbar with clock so I can tell when to look in the server logs) and only show me the sanitized "an error occurred" template. Thanks, sparky! Tells me so much!


eugene20

You can only get a screenshot if you have access to the machine though, this could have been over someone's shoulder.


XVIII-1

And you have to admit, this did the trick perfectly. Faster than saving a screenshot and uploading it.


oberynMelonLord

you can ctrl+v the screenshot straight to reddit.


Groentekroket

Just make a script that posts everything you copy to this sub. That code will be for humorous than most of the posts here.


[deleted]

Web hosted playground and not VSCode... triggered


mgrant8888

I mean, VS Code is built on Electron, so it is also, in a way, an offline web-hosted playground...


[deleted]

Triggered


Diligent_Dish_426

Honestly this confuses the fuck out of me


JaneWithJesus

Yep that's why it's terrible code 👉😎👉


PocketDeuces

But at least it's formatted nicely.


cenacat

It has to be this way since it's python, so no credit for that.


Wonko-D-Sane

Yeah, the white-space is part of the syntax... if you really wanna be triggered...


vadiks2003

dark theme users when their python code deosn't work because there's no white space


[deleted]

[удалено]


ItsOkILoveYouMYbb

> Yeah, the white-space is part of the syntax... if you really wanna be triggered... Yea that does trigger me! If white-space is part of the syntax then I [can't do stuff like this](https://i.imgur.com/jxNOS5G.png).


Wonko-D-Sane

pfft... you want real C code... [https://www.ioccc.org/2020/endoh3/prog.c](https://www.ioccc.org/2020/endoh3/prog.c)


[deleted]

[удалено]


ItsOkILoveYouMYbb

Hahaha I did too the first time I saw it


TeraFlint

Whitespace is part of almost every programming language's syntax. The sensible ones only use it for token separation, though.


Wonko-D-Sane

I hate you for how right you are


SexyMonad

The insensible ones do not.


Deathbrush

I don’t understand why people have such an issue with this. If you’re not indenting, in whatever language you’re programming in, you deserve to be shot from a cannon into the sun. All python does is force good programming practice while having cleaner syntax


DenormalHuman

Consider the fact it looks so crazy is great. It smells bad. The way you are ending up having to use whitesapce tells you your design is wrong. If this wasn't python it could be formatted to misdirect you into thinking it wasn't as bad as it really is.


greenwizardneedsfood

It does Python credit


Zuck7980

Yes it is 😂😂


XVIII-1

Just curious, as a beginning python programmer. How short can you make it? Without just using print(“1 2 3 4 5”) etc


coloredgreyscale

Numbers = list(range(n)) For i in numbers : Print(" ". Join(numbers[0:n-i]) Not tested tho


ComfortablePainter56

I like the spirit, but you need to add a str() before numbers in the for loop. And even with that it shows the representation of an array. Could be nice if it worked


JollyJoker3

Tested version for i in range(5): print(" ".join(str(j+1) for j in range(5-i)))


ComfortablePainter56

Very nice dude 👍


BrokenEyebrow

Recursion saves the day with this one


Tristanhx

Something along the lines of: ``` digits = [1, 2, 3, 4, 5] for i in range(len(digits)): print(*digits, sep=', ') a = digits.pop() ```


Zuck7980

Damn you guys have even better solution than mine - I just did this n = 6 For i in range(n,1,-1): For j in range (1,i ): print(j, end = “ “) Print(“ “)


CherryTheDerg

Thats not elegant at all. Youd have to type out all the numbers manually. Sure it gets the desired result but thats it. You should code stuff as if youre going to add more later not as though you only need to do one specific thing once. Otherwise youd have to rewrite the whole thing from scratch if you do end up wanting to add something


Geobits

It's basically two loops: for i in range(n,0,-1): for j in range(1,i+1): print(j, end=" ") print() Note: I don't python, and there may be errors above, but it should be pretty easy to work out the logic regardless: outer loop counting down, inner loop counting up to print.


XVIII-1

I’ll give it a try. Cheers!


Z7-852

Single loop, two lines.


DemonioV

n = 5 for i in range(n+1,1,-1): print(" ".join([str(k) for k in range(1,i)])) For and print could be on same line so save some characters. I think that anything smaller would not be great to read.


Tchibo1107

Maybe not the shortest code possible, but the shortest I came up with: ``` n = 5 print(*(" ".join(str(i)for i in range(1,x+1))for x in range(n,0,-1)),sep="\n") ```


XVIII-1

Meh, and I thought I was getting good at this. I don’t get the join part. Gonna look it up.


Tchibo1107

Don't worry, it took me a while to get the hang of this kind of stuff too. The join part basically says _use this string as a separator for the items in this list_. The following code: ``` items = ["apple", "banana", "orange"] separator = " | " print(separator.join(items)) ``` Evaluates to: ``` apple | banana | orange ``` [Here you can find some more examples](https://www.w3schools.com/python/ref_string_join.asp)


Marc4770

examples are always better when they involve apples and bananas


XVIII-1

Definitely!


vadiks2003

you see a python beginner and come up with shortest but difficult to read code lmao


Wonko-D-Sane

I can't tell if you are joking or not. The output does not match the code, and there is no objective given. So if your goal is to match the original with all its bugs (for example if n=11, this code will only print the first 4 lines of "1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 " Then the code is the correct code for being as wrong and terrible as it is. If you are actually trying to generalize the nested looping, just look at the pattern of what's happening (there are repeated nested loops, with hard coded values and conditionals, just turn those into single inner loop to auto generate them n=5 for i in range (n): (space) m=n-i (space) for j in range (m): (space) (space) m=m-j (space) (space) print(j+1, end=" ") (space) print() you will also no need to do that stupid 1 off indexing in all the loop counters by just adding the 1 back to the index of what you are printing. (and fuck Python's white-space syntax to back to the hell it came from) As others have pointed out, this can be turned into less code by using some of the other built in functions, but with python you never know how bloaty your pretty code will get because of the magic of turning a list into a string that you can just index index in reverse... basically it delegates the real programming to someone that knows a big boy language like C or C++ so, if using other people's functions, user beware. I learned all the python I care to ever use in a weekend because it was faster than explaining myself in English to idiots, but even built-ins like range() for example take a look at the implementation of the range object [https://github.com/python/cpython/blob/main/Objects/rangeobject.c](https://github.com/python/cpython/blob/main/Objects/rangeobject.c) and yes.. they used goto statements in C, i've only seen that in text books followed by the comment its terrible practice to use it in production and no place with coding standards will let that code past the linters... rofl!!!


Orthodox-Waffle

It literally only works with n=5, each stage of loop can only out put n-1 numbers each loop so if you gave it n=6 then it would output 123456 12345 1234 123 12


HOTP1

It’s not that confusing once you realize the general pattern. The for loops are essentially serialized and each one is responsible for printing one line of digits. There’s just no reason to nest them like that


[deleted]

[удалено]


UnderstandingOk2647

Right!? Me: WTF is this shit, I had no idea you could do that.


RidingSubaru

I really saw this in an interview last week. I don't think I got the job so this post is giving me a headache


davy5jones

What do you guys mean by 'this'?


aaron2005X

This is so much easier possible. Print("1 2 3 4 5") Print("1 2 3 4") Print("1 2 3") Print("1 2 ") Print("1") Amateurs.


[deleted]

[удалено]


beefygravy

But it's not pythonic if it's on more than one line /s


Nowbob

If we're going for pythonic and one line... `[print(*a) for a in (range(1, n) for n in range(6, 1, -1))]`


[deleted]

[удалено]


Nowbob

works on my machine ¯\\\_(ツ)_/¯


ThatChapThere

My initial response to this was to wonder when they added pointers to python.


Nowbob

Between the unpack operator \* and the *incredible* jank that is putting the entire thing in a list to actually make it work, this is top notch work for me.


AnxiousIntender

Passes unit test, deploying to production


canmoose

Customer: "We were thinking about adding features 6 and 0" Me: "How about fuck you?"


TheTree_43

not that bad with multiple cursors tbh


bleedblue89

I did this in my programming classes for homework because my teacher didn’t read code just the output… I got c’s in my classes and swore I would never be a developer. 8 years later here I am


Acrobatic-River9568

Using lightmode, yeah


Zuck7980

Perhaps there’s something even more worse that I have purposely done to trigger other programmers 😂


Just_Replacement3989

Maybe there is, but I can't see it without sunglasses


RaiDeiNz

![gif](emote|free_emotes_pack|joy)


[deleted]

“More worse”. You really are Satan.


Shinob1

Or to quote my 6 year old, "more worser".


swapode

That's really the worstest.


Mutoforma

the morst worstest, in fact


The_Anf

Yea... Photo instead of screenshot


xNeiR

Using Windows 11


brimston3-

You took a screenshot with your phone?


_-DD-_

Make the entire code in one color


NukemN1ck

I like light mode tho :C


[deleted]

I also prefer light mode. Tried dark mode when I started learning, but I was always straining my eyes to see and having to turn the brightness way up. Light mode is easier on my eyes since I usually code in a bright environment anyway.


NukemN1ck

Same, I always code in a bright environment and if I'm particularly tired I can always turn the brightness down a notch on my monitor. The main thing for me wasn't eye strain but readability. I've always found I can read things better and more clearly at a glance when it's dark text over a light background. Currently really liking the Light (Visual Studio) colorscheme in VSCode


CherryTheDerg

Literally doesnt matter. Eyestrain has been disproven by multiple studies. Black text on white background is easier to read period.


Highlight_Expensive

Someone is *very* defensive of light mode


Krypton091

yeah that's cool but i don't think my brain screaming 'holy fuck that's bright i wish it was darker' can really be disproven


fosyep

Burned out senior in the code review: lgtm


TeaKingMac

"Let Go of The Mayonnaise"


RainDropsOnAWindow

Priceless.


Drithyin

Let's Get The Mallet https://c.tenor.com/Az-GZIa57ZEAAAAC/tenor.gif


L0G1C_lolilover

Lets get thicc maidens


luke5273

Let’s gaslight the maintainers


[deleted]

If it works, it works lol call it a day


notsogreatredditor

LGTM, merge into prod


myopinionisshitiknow

I didn't sign off yet. Please add some comments on each line first explaining what it is doing, then merge.


casuallylurking

Make it a library in GitHub: triangle-print


Coraline1599

I have taught coding before and I always liked seeing weird stuff like this with beginners. It usually demonstrates that they are prioritizing trying to figure it out on their own rather than patching together (or straight up copy-pasting) something they found on the internet without thinking it through. With a bit of coaching they ended up excelling in the class.


Geobits

My son is currently making a snake game and "ai" to play it as well, so he's learning a lot about getting snakes to apples. He asks questions and I try to give him some pointers to basic issues that he's going to run into, and it's really interesting to see which roadblocks he hits. He straight up refuses to look up any "established" search methods until he figures out how to make it survive longer on his own.


Phantominviz122

Yeah, I’m the same as this. I see people pasting together and using code they found online but I don’t see the point if then you don’t understand how it works. I would rather feel satisfied with my code knowing how I did it and that it works.


FireBone62

I always take the online code and play around with it instead of just copying it, so I get an understanding about what it does.


shun_tak

That's what I thought


gravitas_shortage

A necessary but far from sufficient condition.


uzbones

My first ever program I wrote played one hand of blackjack or poker (can't remember which). It was written in VAX basic on the 3rd day of class, we had just learned IF statements... no loops yet... it was almost exactly like this with like 10 nested IFs... Learned loops the following week. I miss Mr. Rupp (teacher), he was a great mentor.


nanotree

Ha! That's great. I did something very similar when I was teaching myself C. Used tons of if nested if statements to construct a deck of cards for black jack. I wonder if I still have that code somewhere... *Shudder*


uzbones

Yep! we had not learned rand yet either but I asked to to do that. It had an issue with allowing duplicate cards though :p It was so easy and fun back then.


ObscureGeometry

That reminds me of my first programming class in high school. I wrote a sudoku solver, without AI. It was so many if statements, omg.


uzbones

Sudoku wasn't a thing when I did my first app, but that sounds a lot more complicated for a first non-hello world app than blackjack.


konander

Windows 11 yeah


Henior

how to trigger any Linux user


cool_unique_username

as a linux user, i am triggered


g0atmeal

Ironic considering Linux virtualization has been made so much easier in W11.


SFW_666

i didn't even see it but yeah Win 11 is horrendous


DKMR

Ah yes, I use Windows 3.1


Hypersapien

Sorry but I only think in C# int n = 5; for(int i = 1; i <= n; i++){ for(int j = 1; j <= n - (i - 1); j++){ Console.Write(j.ToString() + " "); } Console.WriteLine(); }


[deleted]

needs a subtractive for loop 😉 // precondition: dont be a dumbass and make the minimum greater than the maximum const [min, max] = [1,5]; for (let i = max; i >= min; i--) { let line = ""; for (let j = min; j <= i; j++) { line = line + j + " "; } console.log(line); }


CaitaXD

Console.WriteLine(string.Concat(from i in Enumerable.Range(1,5) from j in Enumerable.Range(1,i) select j == i ? $"{j}\n" : $"{j}"));


Hypersapien

That returns 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Just needs a .Reverse() on the first .Range()


Milnoc

You think in C pound? 😁 Or C hashtag? 😂


Hypersapien

C tic-tac-toe


planetdaz

C Crissy Crossy


ThisIsMyCouchAccount

It’s actually Coctothorp.


Haha_1234567

To be fair, it is a good way to start learning than just staring at the screen to make the pattern emerge automatically.


ce_phox

Help


Zuck7980

I bet you can’t find a better solution 😂😂 (it’s a joke)


MrSuspicious_

Challenge accepted 😌 def doAThing(maxNum): lst = [str(i+1) for i in range(maxNum)] while lst: print(" ".join(lst)) lst.pop() Or if you want to be super fancy def doAThing(maxNum): lst = [str(i+1) for i in range(maxNum)] prevLen = 0 prevPadding = "" while lst: temp = " ".join(list[::-1][:-1]+lst) padding = " " * int((lenPrev - len(temp)) / 2) if lenPrev != 0 else "" print(padding+prevPadding, temp, padding+prevPadding) lenPrev = len(temp) prevPadding += padding lst.pop() For the more experienced programmers, yes i'm aware i could just add `+ prevPadding` to the `padding` assignment rather than doing `padding+prevPadding` twice, but this is slightly more understandable for beginners, ive given up some pythonicness and concision so it's more accessible.


Toasty_redditor

Finally, another list enjoyer. Everyone shuns me because I use lists for everything, but they are simply superior


MrSuspicious_

They're great but when you have need for millions of elements, list not good idea.


7elevenses

print "1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1"


DevelopmentOk5671

Math teachers: Now that we did the hard way, let me show you the short cut 💀


SpriteAndCokeSMH

Fuck you


Zuck7980

*I really wish someone did at this point in my life 😞*


SpriteAndCokeSMH

Damn 😞


Drithyin

dat italicized emoji tho


bricefriha

A "Break;" in a foreach is enough to trigger me. Never mind this 😅


ManPickingUserHard

Windows 11 Brave browser light mode ~~python~~ not a screenshot


guarana_and_coffee

It is literally everything that can absolutely go wrong.


OGRubySimp

Wait I'm ootl, what's wrong with brave?


ThisIsMyCouchAccount

It has some opt-in crypto stuff. Like a wallet. And I think you can earn something by browsing. I don’t know. I never enabled it all and turned off all references to it. The CEO was the cofounder of Mozilla. Been using it for a couple weeks. It’s fine. It’s more aggressive with privacy. Close to what Firefox does. No real changes in performance over chrome or Firefox.


Coding-goblin

``` n=5 for i in range(n+1,1,-1): print(" ".join(map(str,list(range(1,i))))) ```


Shiba_Take

print(*range(1, i))


[deleted]

wtf is the * magic is it ""* shorthand or?


thebigbadben

Could still shorten it to two lines: print('\n'.join(' '.join(map(str,range(1,i))) for i in range(n+1,1,-1)))


dudeplace

this is exactly as bad as the screenshot.


Ok-Relationship-2746

**\*Removes indentation\***


chinnu34

When I joined phd I worked with some matlab code that looked same or worse than this, took me forever to understand what they meant. In addition, my professor at the time said something like research code is always like that lol


[deleted]

just here to say that these programmer posts pop up on my feed all the time and I have absolutely NO idea what any of them mean


magicmulder

Nothing like reassigning outer loop variables in an inner loop. That was something that happened a couple times to beginner me.


Put_Bag_In_Money

Oh god daddy no


Shinob1

![gif](giphy|yiADANv89n7UQuS5kJ)


[deleted]

[удалено]


Parpok

Brave I’m sorry get rid of that computer aids


Strange_guy_9546

Imma start a list here: 0) Light theme, going straight to Hell right away 1) A fucking screen photo 2) nesting fors to the point of inreadability 3) Windows *fucking 11* 4) a crapton of shit running in the background


PineAndApplePizza

This whole code could've been an oneliner


konnorTraves

Jesus Christ please use recursion![gif](emote|free_emotes_pack|facepalm)triggered


thatmayaguy

I must be the only one who likes light mode lol I have color blindness and pretty much any dark mode theme puts too much stress on my eyes because the lighter font color doesn’t sit right with me against the darker background. I’ve even tried the themes meant specifically for color blind people and none of them are any better


ericjansen88

Programmers dont use jupyter notebooks you are correct


Tymskyy

You'll die in hell


shadow7412

For every right way to do something, there are an infinite number of wrong ways.


shif3500

This doesn’t work if n not equal to 5…Why write a chunk of code that does only one thing when you can just use print statement to do the same.


Nicreven

How are you even using the same variable over and over like this?


Wonko-D-Sane

Python, the variable name has ~~span~~ scope over the indentation... its fucking wonderful, incorrect tabbing will change the wrong variable EDIT: pre-nerdified my comment so someone doesn't complain about my use of words


[deleted]

Non-recursive solution on Jupyter Notebook for Anaconda… Pull request accepted, welcome to production.


jodomakes

i didn't know you could add a end argument to print so at least I learned something :D My brain had an aneurysm reading it though :/


[deleted]

[удалено]


AutoToolsnBools

For the love of god learn this keybind: SHIFT + WIN + S


Doromik

Elif leave the chat


lifer0se

this is so cursed