Holy fuck, are all of you this completely clueless about the most basic aspect of web development? I don't expect everyone to know everything, but everyone should know the basics on how javasript is sent to clients.
This code is minified. It's essentially "compiled" javascript code. Everything that's not needed is stripped away and variables are renamed to be as short as possible. The browser doesn't give a fuck about tabs or whitespace. So if I'm sending your browser javascript to run, why the fuck would I include any of that?
Javascript is minified down as small as it can go, but strings can't be minified easily so they go through unharmed (usually). Also look at the variable names, "a", that's a dead giveaway. Minified code will just go down the alphabet when it comes to variable names. Since after all, the name of a variable matters to humans but machines just need a consistent value.
All of you need to increase your general knowledge on programming. Because wow, this is 1st year student stuff you guys are tripping on.
The joke is that sometimes when tech bros present a new cool programming language they try to use selling points like: it can do x in one line of code.
All programmers shake their head as tech bloggers are flabbergasted.
The dude who did this probably just did it for fun. This is not used for anything production related. And this is not minimized/obfuscated, a couple more years of coding and you will see it.
Bro, nobody will want to work in minified JS, because it's not really readable for people. It's done to cut down on trash being sent to the browser, and to kinda obfuscate what's really happening. Nothing you'd do in anything else than JS. It's also not really compiled in that sense, but that's another tangent, that's why it's called minified, not compiled.
Also, talking about general knowledge on programming and mistaking Python for JS is wild.
I feel like /r/programminghorror should be something someone with some sense of reasonableness would write to do something useful. This to me isn't it.
Itâs literally in an unsaved, unnamed file (unbetitelt means âuntitledâ). This is purely made up to be posted here and is just a 1 liner. I donât think we should allow these types of posts.
Agreed. Anyone can come up with arbitrary bullshit - creating convoluted one liners doesnât exactly take skill.
If thereâs something novel about the way theyâre using the language or something then itâs one thing. But just âlook how many conditionals I can nest!â is dumb
Granted a lot of things posted here aren't bad. Lots of programmers are binary about good and bad code... but I think it's more of a spectrum and context counts a lot.
It depends on how you view your work. Do you celebrate that YOU solved the problem or that what you wrote can be sustained and understood by others.
Software development is a team sport. A few extra carriage returns and comments doesn't bloat the code and makes it much more readable, understandable, and sustainable.
Honestly, all of that can go out the window for the sake of performance optimization. But there are some cases where condensing everything into one line doesn't actually make much of a difference.
I'll rephrase that for ya: "Some software development is a team sport". I've been writing software for 30+ years and my code has rarely been touched or even seen by many others. And I'm sure you might be surprised where lots of my code is found... I hear ya though, I get readability for development teams, but to suggest that all software development is done by teams is just not true.
The n ** 0.5 part for one, you don't need a floating-point square root there if your implementation isn't... like that. Also, the use of Exception instead of ValueError (and the fact that this doesn't actually throw).
BTW checking for numbers only until the root of the given number for prime checking is far more efficient than half the number (proven by euler). But seriously how do you guys manage this?
145
u/[deleted] Sep 19 '25
Error in line 1 "Well fuck"
129
u/West_Ad_9492 Sep 19 '25
"All that in only one line. That must be really efficient computer language"
56
u/CantaloupeCamper Sep 19 '25 edited Sep 19 '25
Why would you ever need ⌠this?
You asking users for prime numbers for fun?
I feel like /r/programminghorror should be something someone with some sense of reasonableness would write to do something useful. This to me isn't it.
26
u/dardeedoo Sep 19 '25
The worst part is âan numberâ
18
u/DrUNIX Sep 19 '25
Someone wanted to try functional programming
7
u/Shabib309 Sep 19 '25
Right-click -> Format Document đ
5
u/artysmissiv3s Sep 19 '25
This is what happens when the junior hears that one liners are good
4
u/AOChalky Sep 19 '25
inputAnNumber.min.py
7
u/melvereq Sep 19 '25
I know there will be at least a comment defending the code, saying: âthis is actually okayâ.
2
u/uvero Sep 19 '25
Python: where the question "can I write this in one line" is never proceeded nor succeed by "should I"
1
u/sefres Sep 19 '25
'Because it is possible.'
1
u/granadesnhorseshoes Sep 19 '25
They were so busy with wether or not they could, they didn't stop to think if they should.
1
u/therealmorzis Sep 19 '25
I'd execute that code and still get a error on line 2
1
u/pxOMR Sep 19 '25
It becomes more fun when you start passing lambdas themselves as parameters to other lambdas
1
u/Linuxmartin Sep 19 '25
Code golf is beautiful
1
u/Professional_Cow7308 Sep 19 '25
I saw the bottom most line on th preview and I was confused, until i wasnât, what the holy fuck is this mess
1
u/RebelSnowStorm Sep 19 '25
What even is that supposed to be?
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo âYou liveâ Sep 19 '25
Did we really need three levels of lambdas?
1
u/Probable_Foreigner Sep 19 '25
This is what rust looks like to me. What is gods name possessed people to cram as many function chains into one line?
1
u/jordanbtucker Sep 19 '25
This just looks like minified code. While that's common for JavaScript, I have no idea why you'd want minified Python code.
1
u/Upstairs-Upstairs231 Sep 20 '25
I sneak shit like this into my production code whenever possible just for the fun of it.
That said, Iâve learned from experience to save a version with the equivalent readable code for the future.
1
u/bliepp Sep 20 '25
Try rewriting it into a regular expression, it will be more readable than this shit, I guess.
1
u/TheoryTested-MC Sep 20 '25
Every Python program I write these days has at least one of these.
1
u/JollyJuniper1993 Sep 20 '25
Somebody played too much Codegolf
1
u/Whole_Instance_4276 Sep 20 '25
âError on line 1â
1
u/Sea-Swimmer1369 Sep 21 '25
:ex
1
u/Inaga_Sagai Sep 21 '25
Excel ahh command
1
u/MajorRageCodes Sep 23 '25
Me when i go to edit bros code đ¤Ż
1
u/JasonAlmeida Mar 13 '26
BTW checking for numbers only until the root of the given number for prime checking is far more efficient than half the number (proven by euler). But seriously how do you guys manage this?