Recursion Gets Out of Hand
def findbranches(thenode): listofendvalues=[] for element in thenode.children: el=element.name.split('_') if el[0]=='dir': for element2 in element.children: el=element2.name.split('_') if el[0]=='dir': for element3 in element2.children: el=element3.name.split('_') if el[0]=='dir': for element4 in element3.children: el=element4.name.split('_') if el[0]=='dir': for element5 in element4.children: el=element5.name.split('_') if el[0]=='dir': for element6 in element5.children: el=element6.name.split('_') if el[0]=='dir': for element7 in element6.children: el=element7.name.split('_') if el[0]=='dir': for element8 in element7.children: el=element8.name.split('_') if el[0]=='dir': for element9 in element8.children: el=element9.name.split('_') if el[0]=='dir': for element10 in element9.children: el=element10.name.split('_') if el[0]=='dir': for element11 in element10.children: listofendvalues=listofendvalues+[element11] else: listofendvalues=listofendvalues+[element10]
A dark-themed code editor shows a Python-like function with deeply nested loops repeatedly checking directory names. The joke is that the supposedly easier way to traverse branches has become an absurd wall of indentation, making the code itself the punchline. It is used as a reaction to overcomplicated solutions, messy code, or tasks that keep nesting further. EN: A dark-themed code editor shows a Python-like function with deeply nested loops repeatedly checking directory names. The joke is that the supposedly easier way to traverse branches has become an absurd wall of indentation, making the code itself the punchline. It is used as a reaction to overcomplicated solutions, messy code, or tasks that keep nesting further.
- @eternalclassic / 30877 2023-04-12
- Type
- image
- Size
- 800×800 · 80.4 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added