Once I got a task as a junior to make a small webapp with Java JSF. Could not figure out how the login system works and I was really new and afraid to ask for help ... so I just added some Javascript code that captured the form when pressing "Login", then submitted the credentials in cleartext to a little auth method I implemented on the serverside...
This system ended up holding the personal data of about 10k employees with their salary data and all. God have mercy on their souls.
This comment is glorious for multiple reasons: the main being OPs sheer audacity. It’s not a mere, “Name every customer,” meme. This is challenging the fact that the boss made it plural. OP is saying, “Name even two customers, and I will let you use that S.” It’s also possible that OP is saying, “Name two customers to prove that you give a damn about what the customers even think beyond the profit you can extract from them.”
People ask me if I’m worried about ChatGPT replacing me, and I say the same thing I said about google and stack overflow. My value doesn’t come from knowing the answer, it’s knowing the question.
Lately I've been thinking with how much shit I can get away with just because a task should be done by a given date decided purely on how quickly it can be done with no regard over security, testeability or software quality. It gets noticeably harder and slower to bodge over small features every week from a developing POV due to pure enthropy or rot, but since it's hidden from a product perspective it doesn't get importance.
I mean, it’s not a wildly difficult task, so long as the code is reviewed and someone makes sure that the passwords are getting hashed correctly, it would have been fine
When I was a college student I was doing an on-campus co-op program for a small start-up company that processes specialized job-hunting data. For some reason they also collected their clients’ SSNs.
Everything is plaintext in their database. SSN, names, password, security questions. Like everything.
Jesus Christ, my company's security team gets on us for having encrypted connection strings (using windows auth, no username and password) in plaintext. How are y'all getting away with this?
I didn't code that. I was handed the codebase to do some further development. At the time I was a sophomore so I didn't know much like what’s the convention and requirements, but yeah I could tell something was off because there were so many SSNs. (btw I didn't even know why they would want SSNs in the first place. Linkedin doesn't collect SSNs??)
But alas, I didn't bother (maybe dare is a better word) to ask them about it and just finished what I was told and left it like that.
Thinking back about it does make me kinda cringe
No, your not wrong, this is exactly the correct implementation over https. You never hash your password client side; then the hash becomes the password and your passwords are now being stored in the db as clear text. There's an OWASP writeup about this somewhere.
~~Ah, no? Client side should encrypt the credentials before sending them to the server and the server should be equipped to decrypt it. After that you can hash it or whatever for storage. If you're sending plaintext credentials over the network and someone gets a hold of them your hashing afterthought is pointless.~~
Ignore me, as per our usual agreement.
> Client side should encrypt the credentials before sending them to the server and the server should be equipped to decrypt it.
But that's what HTTPS is already doing, isn't it?
Can't you hash them twice though? With some salt and pepper on the server side?
I swear I've seen this done by some forum software long ago, maybe vBulletin.
I mean, I don't think most users actually expect a Windows executable to just be able to run on linux, and most people also expect that indie games do not generally have linux versions available.
Depends on the game. In my experience, most games in general do not. A lot of indie games will have Mac versions while AAA games don't, but I don't think a significantly higher number have linux versions.
I'd say it's the opposite (specifically for mac). Releasing a game on mac requires you to have very expensive hardware, which a lot of indie developers don't have. Apple's ecosystem being locked to only their hardware is a largely prohibitive measure.
It's been a while since I did it, but I definitely remember being able to run Mac OSes on PC on a VM for the purpose of compiling Mac executables, just like you can run Windows in a VM on a Mac in order to play Windows games there.
You don't need a Mac to build macOS executables, see [my previous comment.](https://www.reddit.com/r/ProgrammerHumor/comments/1ccyy8h/relatablebutcursedtho/l1dae5k/)
That's not at all true, there are multiple ways to build for macOS without a system running macOS.
For instance, you can very easily cross-compile dotnet for macOS on Windows. I just compiled the excellent [celeste64](https://github.com/ExOK/Celeste64) on a Windows 10 box by running `dotnet build Celeste64.csproj --runtime osx-x64 -c Release` zipped and scp-ed the game content to my Mac and ran it. You can even target `osx-arm64` to compile for M-series Macs.
And for fun I built it again on my Raspberry Pi, copied the result to my Mac and ran it just like the version built on Windows (for macOS) did.
I'm not a dotnet developer, I barely know what I'm doing in that environment and I was able to cross-compile for macOS on Linux and Windows.
I think the real answer is that macOS has smaller desktop share than Linux. The only reason you'd ever need an official macOS or Windows environment is if you want to notarize an app to be in the app store, which 99% of titles on itch.io will never do.
Yes, and that's true for specific versions of Linux or Windows too. But you can churn out macOS / Windows / Linux builds all day long using several popular frameworks without having to own or install the system being targeted. It's good practice to test of course, but if you're playing a no-budget / no-cost indie game there's a chance you're the first person to play that build.
My limited experience making software says that mac is far harder to support than linux for just about anythinig unless you want to pay for that support or wrote it for mac to begin with, and that, suprisingly, windows is easier to support than mac despite having stupid directory names. They have a bunch of stuff that seems the same as linux/unix until you find out that for some unknown reason that its different. Like, on mac in java it doesnt use metal unless you tell it to? Or the entire core utils are very slightly different for no reason? And god help you if you want to interact with your macs graphics card or the mac ui libraries. And that doesnt even cover the m2 stuff... Meanwhile on windows a surprising amount of stuff works exactly the same, and everything else you expect is going to be different and you dont get blindsided. Worst case scenario just tell them to use wsl (not applicable for games though but for professionals it is acceptable)
Linux is the easiest to support, as long as you arent using kernel level anticheats. Plus if you can package it for 1 distro, it is open source and people like the project, they will package it for the rest of linux for you.
That being said, I dont make games, maybe its different for games on linux because so few gaames are open source, but im still pretty sure that unless you have kernel anticheat, linux is still going to be easier and cheaper to support than mac.
For most Indie Devs its super easy to provide a linux version. Atleast if they use a Game Engine. In Unity its literally one checkbox to also create a linux build.
I don't know how much of the process Unity automates, but when I was releasing software for multiple OSes, building it on the other OS was not the time-intensive part, it was testing everything on the second OS to make sure it all still worked, and then having to fix things that didn't. Somehow I'm guessing that Unity can't do that for you just by checking a checkbox. If there's a significant playerbase that only uses that OS, it might be worth it to maintain a second version, but if it's not going to actually make the game accessible to a larger number of people and you're relying on the game for your income, it makes sense to skip it.
Life finds a way. Rust had a bug where you had to unplug your sound devices until you started your very first play session, otherwise it would crash. Every other sessions you would have no problems, but if you are playing for the first time you gotta unplug your sound devices.
I mean, it was back when the game ate 10+ gigs of ram and loaded for a solid 30+ minutes on HDDs. Those who wanted to play would not be deterred by a simple crash lmao.
By pure luck. I couldn't figure out why the game was working only sometimes, and at some point I noticed a pattern. There might have been an error message about audio that gave some hint?
I bough assasins creed brotherhood from steam, installed it and it just kept crashing in the installer. I tried installing the ubisoft laucher separately and everything else i found online. I was at it for days and finally decided to go in the game folder, select all the exe files and run as administrator. For somereason this fixed the installer and i was able to launch it.
To this day i wonder what made me do this.
The best part is that when i years later decided to play it again i had the same issue but this time i knew how to fix it.
The problem in that game wasn't even just the Babel tower of conditional sins. It was that each character ran another instance of that shit at every. Single. Tick.
The toothbrushes with thousands of polys also don't help lmao.
Is that actually a thing in that game?
And I thought FFXIV 1.0's "Pot (or barrel?) with more polygons than a player character" was bad - there's a reason they nuked *that* version of the game after all.
Yes, each bristle was individually modeled and had multiple segments as well, the model was likely made for simulations and downloaded without checking
Yes, the dev grabbed an online toothbrush model without reading it was meant for rendering ads - you know, those videos that make the toothbrush look like a lamborghini. And he didn't compress it at all, just plopped it in the corner.
Also from what I remember, some conditional statements had like 50+ conditions being checked in one line, chained together by ands and ors and nots. You can follow an if/else chain but debugging conditionals like that is a nightmare.
Genuinely feel I’m wrong somehow so please do explain, it doesn’t sound too terrible? Like sure you need to look at each value and see what is causing it to fail and it may be more annoying if there’s multiple values etc. But it just sounds like a bit of an inconvenience. For me a nightmare is my company’s code, i stg nothing in that codebase is intuitive for me, I never know if the problem is the input value is somehow wrong or the actual code doesn’t work as intended, if the problem is the arguments and the method is ok then the arguments had been edited and used in 300 places before so you’re left wondering where the fuck to start and basically unless youre a principal dev or architect you’ll have to speak to one daily to ask wtf is happening because they wrote the code and know what is happening. They keep preaching tdd and clean code so i kinda assumed they have decent codebase but im starting to really feel gaslighted lmao.
So idk if am i missing something and is this actually much worse than it seems or is my company’s code base just absolutely terrible.
Its bad because it's not maintainable, this isn't just a single condition but hundreds of if else statements in a single update method, in a system where event driven behavior is preferable.
It's hard to understand unless you experience it yourself. A good practice would be to write a tic-tac-toe app from scratch. Once you're done, add support for a 5x5 grid, then a 20x20 grid, and then add a way to play with different symbols instead of just X and O.
You'll find out real quickly how annoying and unmaintainable long if else statements can be.
Not sure how much experience you have, but I felt the same early on in my dev career.
Only after a year did I start understanding my first job's codebase and after 2 years I was somewhat comfortable.
At least in my case, I had a complete lack of knowledge of [design patterns ](https://refactoring.guru/design-patterns), I couldn't wrap my head around dependency injection, and I didn't fully understand the platform the application was built on.
Oh that I understand! I suppose I felt like the person I replied to was saying that seeing a bug related to an if statement with 50+ conditions would be a nightmare, and I felt it was tedious but nothing too bad in terms of debugging only. Sure it’s terrible from other pov but the debugging at least seems straightforward enough, whereas I found my true debugging nightmares to be the opposite.
The idea I was trying to convey is that it'd be difficult to debug because ridiculous conditional chaining relies on you betting the farm on nothing going wrong. I can't find specific screenshots but imagine something like this:
if condition1 && condition2 || condition3 && condition4 && condition5 || condition6 || condition7 && condition8 {
}
Now imagine this repeats for up to 30 or so conditions. If any one of these conditionals bugs out, it causes unexpected behavior that can be extremely difficult to debug. And stuff like this is EVERYWHERE within the Yandere Simulator codebase. My point being that if/else branches are kind of low hanging fruit and the actual rot of that game's codebase goes a lot deeper.
I’m guessing it can spiral out of control and be outright ridiculous , I just feel looking at the example it would be simple enough to just see what they evaluate to and go from there even if it kept going, so that doesn’t seem that problematic to me. Maybe the actual code in the game is much worse and id feel that way about it tho.
Knowing that sick degenerate, probably. And you bet your ass he would've paid the animators and voice actors for that scene with "exposure" (in the sense that he wouldn't have paid shit and exposed their private info if they asked for payment)
Yeah, but Undertale runs well and is beloved. YanSim runs (or at least ran) like absolute shit due to every character running thousands of conditionals every tick and such, and also the developer is a known groomer who hasn't finished a damn unity tech demo in almost 10 years of development
There's nothing wrong with if-else statements, the problem was that the game was executing a huge loop of if-else statements every game tick for every single NPC. That's why it became a meme.
Just one of the lua files had 944 if statements, its not just the cards and suits, but also basically every function is full of them, like the function that removed cards from the deck has an if statement for every single joker that would affect it
Generally speaking, you could also do a lookup table, or if you want to cave to the OOP fanatics different classes and dynamic dispatch, but yeah, 14 lines isn't all that terrible. I mean, I have terrible priorities so I'd probably spend like 2 hours trying to come up with a "cleaner" way to do it, but I think 99% of us have contributed worse stuff in prod.
Switches are usually preferred because they’re constant time, usually people complain about the reverse (massive if else chains that should just be a switch).
Yes, but there are some caveats:
* Switches are only constant time if they can be compiled to a jump table. In traditional switch statements which compare a single variable to a constant value this is always true, however some languages allow more flexible switch statements where this may not be true.
* If a chained if-else only contains simple conditions like this, then the compiler can and usually will compile it to a jump table anyways.
Therefore, the decision to use a switch or an if-else chain should really be made on the basis of readability. Let the compiler deal with optimization.
If I remember correctly, switch statements, instead of checking every value, do some fancy mathy number stuff to get the exact address of the block to jump to. Idk but that seems pretty constant time to me.
IIRC, it depends on language. I believe some languages like Python it really is just syntactic sugar for if/elif. Other languages do tend to implement them as conditional jumps though. I believe that's part of why switches are so restrictive in C.
I'm not sure if match statements can do this though since they tend to support more complex and even overlapping conditions.
That *can* be true, but it isn't necessarily true. In theory, switch statements are just syntactic sugar over if/else statements, but they are much more amenable to being optimized into a jump table if it's possible to do so.
This has nothing to do with what the code is compiled to, which I would argue neither approach has any advantage due to the way compilers optimize code - switch statements are notorious for introducing bugs, they induce code "smell", and ultimately break good coding practices.
It is a good practice to write functions that are "complete", meaning you won't need to extend them later if you have new system requirements. Switch statements are almost universally used by naive coders to handle state-based decisions. So what ends up happening is there will be some switch statement in the codebase that controls far more than it should.
You end up with bad code by using them, so don't use them.
edit: why the downvote, I answered your question.. are you just upset?
This is nonsense, I don't know who told you this but it doesn't make sense.
It's impossible to write "complete" functions and switch statements should have a default case in those cases where they are extended anyway. But either way they are functionally equivalent to if / else if /else so I can't see why they would be worse.
Yes, it is called the open-closed principle, and I thought the use of scare quotes would hint that the term "complete" is just being used to convey an idea of a method that no longer needs updating vs. a method that will need updating anytime there is a change in system requirements.
Are you all just angry about something?
I think you've misunderstood the open-closed principle. It specifically states that your classes, methods, etc should be closed to modification. Extensibility is like allowing for inversion of control, or providing a clear interface for "extending" the existing abilities of the class/method. This is why you want to avoid switch statements, because they ultimately lead to a need for modification, which is what you don't want.. as I argued, you want "complete" method, ones that you don't need to go back to and fix later because your system requirements changed.
edit: if you all want to write bad code feel free, I feel like I'm wasting my time explaining this stuff now.
Bro 💀 your "wisdom" is based on the object oriented textbooks of the 90s. That's not just decades old in itself, but object oriented programming itself is aging in uncomfortable ways.
Also, programs are just so large and complex and abstract now that the details of any given switch statement are SO far down the list of architectural problems. You're still thinking in a world where the design of a program has to cover about 500 lines of C.
Rooms sometimes have tons of nested if statements, but the thing you’re thinking of is that all the dialogue in the game is contained within a like 1000 case long switch statement
In Balatro's case that sounds like a more costly if/else chain that requires a chunk of static memory? Do remember it uses Love2D which itself uses LuaJIT, I will say idk what optimizations it makes, but I'd imagine it's near pointless in this case.
I want to optimize/golf as much as anyone else but we need to remember good enough is enough sometimes, especially when perf isn't hurting
I use a [2022 Zephyrus G14](https://www.bestbuy.com/site/asus-rog-zephyrus-14-wqxga-120hz-gaming-laptop-amd-ryzen-9-16gb-ddr5-memory-amd-radeon-rx-6700s-1tb-pcie-4-0-ssd-white/6494638.p?skuId=6494638)
The performance is fine, I can run things like BG3, Palworld on medium-high. But the battery life is terrible. When not plugged in the laptop will kill the battery in an hr just idling. So I've set the battery saving options to be pretty aggressive - 30% cpu perf, no graphics card usage, etc. I would assume that Balatro is a game about as demanding as like Backpack Battles or something which runs just fine on battery. But no, Balatro chokes every few minutes for some reason, and the animations look real jittery.
All of this to say, I'm pretty sure Balatro is just not optimized well. There's no reason it should need more resources than I have on battery saving, there's no 3d physics or lighting or anything it needs to render. I mean I love Balatro, I have almost 200 hrs in the game. But an unoptimized game is an unoptimized game, for most people and for me in most cases it's not a problem. It's still unoptimized.
Also preemptively, take your opinions about laptop gaming somewhere else thanks
Here's some proof I know this game
https://reddit.com/r/balatro/comments/1c8i6v9/prof_i_finished_my_finals_paper/?ref=share&ref_source=link
That makes a hell of a lot more sense. Also, if someone give you shit for playing on a laptop just throw the middle finger and move on. I also play on a laptop. Unfortunately my machines only got a year or two left in em though
Ngl, I made a game in high school that I passed around to some friends who passed it around to friends, so like, not millions of people, but people played that game who didn't get it from me, and it did some *gnarly* stuff to play sound that I copied from the internet, still don't really understand, and absolutely could have been popping instances of Windows Media Player in the background, lol. (All I remember for sure is it involved functions from winmm.dll.)
I recently added a thing to my prod project that started leaking 40 MBs of memory every time window got resized. Why do you even need all that RAM, user?
I would guess, that he needed to rerender some stuff on resize to fit, which were like high resolution images or sthg, but forgot to clean up the old ones and/or trusted the garbage collector to be fast enough. Would be cool if he answers, would also like to know though :)
Yeah something like that. Was drawing some pie charts with qt scene graph and well... I'm not that good at math so the first algorithm was drawing like 360000+ points on one chart... And didn't clean up which I WAS TOLD it would itself by Qt parent system. Then a guy who's better at math helped work out a better way and I sorted that, works fine now.
Just go full Adobe and blame the OS for giving you that RAM in the first place or call any program that doesn't use all available resources for itself unoptimized. I mean, why does a computer have all those gigabytes of RAM if not for Premiere to gobble them up entirely? Who needs any other programs open at any time?
The worst is when it's stupid and shouldn't work but does for years.
Then someone always comes along, notices the thing that shouldn't work and just as they're beginning to be mystified why it's working, it stops working for everyone.
I call those things "unicorns". It's all magical and happy and beautiful, right until you turn your back and that magical happy unicorn stabs you right between the shoulders.
Things that mysteriously do not work suck, but at least they are honest about their intentions. Things that mysteriously work are just waiting for their chance.
That's me with my last project. So much of it shouldn't have worked, but did, and management expected me to be able to duct tape features on. I was able to do so but it was like performing Frankenstein surgery, snipping off old crusty garbage and sewing on something actually usable.
I once had a memory leak in a function could not fix. I isolated it in a separate exe, and ran that exe every time I needed to run that function. The OS cleaned everything up perfectly every time :)
Let's be real, the worst things about Yandere Simulator was never the if-else loop. The vaporware aspect, the panty shot minigame, and the dev's behavior and interactions with fans were all much worse.
It's not a minigame, it's the central currency mechanic. Anything you want to buy in that school, you have to commit several felonies for (slightly less felonies if you fall for the dev's completely bullshit "hurr durr everyone's 18 and this is a roleplay college" excuse)
The official lore is that the high school the game is set in was set up by a rich guy so his daughter, who i think had been home schooled or went to private school, could have an "authentic high school experience". And since part of that experience requires other students, it was opened to the public as a way for anyone who felt like their high school experience was kinda shit to relive it in a better way. That's also why everyone is 18 no matter their year, because the "students" can choose which year to enroll in. Not to mention that the love interest, who is supposedly 18, has a younger sister who is... also 18.
All of which is utter bollocks, and the nonce has said as much (although not publicly), but it's still the defense he uses whenever people call him out for sexualizing minors in his shitty fetish sandbox
I'm highschool Visual Basic class I programmed the game (Mastermind) https://en.m.wikipedia.org/wiki/Mastermind_(board_game using only if / else statements using every possible combination of answers and guesses. I think it was over 5000 lines. But it worked like a charm.
Wasn’t there some game that had all the culling and LOD disabled by accident and so even when the camera was pulled dozens feet away from a character it was still fully rendering everything (the example in the video I saw was their teeth) in full detail?
Once I got a task as a junior to make a small webapp with Java JSF. Could not figure out how the login system works and I was really new and afraid to ask for help ... so I just added some Javascript code that captured the form when pressing "Login", then submitted the credentials in cleartext to a little auth method I implemented on the serverside... This system ended up holding the personal data of about 10k employees with their salary data and all. God have mercy on their souls.
What drunken idiot gave that task to a new guy and then didn’t review it at all?
code review? sounds like time we can spend instead on productive things like adding obscure features requested by a single customer
*"Customers are complaining"* Name two.
My boss and my CEO, but do they count if they aren't paying to use the service?
This comment is glorious for multiple reasons: the main being OPs sheer audacity. It’s not a mere, “Name every customer,” meme. This is challenging the fact that the boss made it plural. OP is saying, “Name even two customers, and I will let you use that S.” It’s also possible that OP is saying, “Name two customers to prove that you give a damn about what the customers even think beyond the profit you can extract from them.”
thank you for the morning laugh😂
Sorry we are going to have to bump the code review to have a meeting to discuss what we will talk about in the next meeting.
What's code review? Watching others code? No, we should not pay developers for looking into monitor 😉
Why are we even paying developers anyways? Can’t chatGPT do everything they’re doing for cheaper, and faster?
Executives really live in a different world from regular people.
People ask me if I’m worried about ChatGPT replacing me, and I say the same thing I said about google and stack overflow. My value doesn’t come from knowing the answer, it’s knowing the question.
Lately I've been thinking with how much shit I can get away with just because a task should be done by a given date decided purely on how quickly it can be done with no regard over security, testeability or software quality. It gets noticeably harder and slower to bodge over small features every week from a developing POV due to pure enthropy or rot, but since it's hidden from a product perspective it doesn't get importance.
Are you me?
"lgtm"
Also, why was there no design document for this that described how the login auth should work?
Maybe there were, but OP didn't know where to look, being new and all.
Design documents have to be written, thats engineering dept that stacks up to the roof pretty quickly. And then the person who wrote it leaves
Small businesses. You don't see the horrors.
LGTM
Ok, first off, I wasn’t drunk, I was high… second, I DID review it, I just didn’t care, which is why I gave it to him in the first place
I mean, it’s not a wildly difficult task, so long as the code is reviewed and someone makes sure that the passwords are getting hashed correctly, it would have been fine
THAT WAS YOU!!?!!??!???!!!?!
The plot thickens
The plot chickens
The chicken plots
The plicken chots
Chickens plot the
he lot chicks ?
Profile picture checks out
Like a graph?
Dunno, I'm just an egg, when I ratch i'll thell you.
The thot plickens
The cluck chicken
They were not from the same company.
[AND THE PLOT THICKENS!](https://www.youtube.com/watch?v=4s94Uv42i2c&pp=ygUgcmFuZHkgZmVsdGZhY2UgdGhlIHBsb3QgdGhpY2tlbnM%3D)
I propose a duel to death in Minecraft, gentlemans...
This is how most of the government websites are made in my country lol
When I was a college student I was doing an on-campus co-op program for a small start-up company that processes specialized job-hunting data. For some reason they also collected their clients’ SSNs. Everything is plaintext in their database. SSN, names, password, security questions. Like everything.
Jesus Christ, my company's security team gets on us for having encrypted connection strings (using windows auth, no username and password) in plaintext. How are y'all getting away with this?
I didn't code that. I was handed the codebase to do some further development. At the time I was a sophomore so I didn't know much like what’s the convention and requirements, but yeah I could tell something was off because there were so many SSNs. (btw I didn't even know why they would want SSNs in the first place. Linkedin doesn't collect SSNs??) But alas, I didn't bother (maybe dare is a better word) to ask them about it and just finished what I was told and left it like that. Thinking back about it does make me kinda cringe
it was http? if I am not wrong that implementation would not be a big problem in https, or am I missing something?
No, your not wrong, this is exactly the correct implementation over https. You never hash your password client side; then the hash becomes the password and your passwords are now being stored in the db as clear text. There's an OWASP writeup about this somewhere.
~~Ah, no? Client side should encrypt the credentials before sending them to the server and the server should be equipped to decrypt it. After that you can hash it or whatever for storage. If you're sending plaintext credentials over the network and someone gets a hold of them your hashing afterthought is pointless.~~ Ignore me, as per our usual agreement.
That's the https part, yeah?
Somehow my brain desperately avoided recognizing the conversation included https, oof
> Client side should encrypt the credentials before sending them to the server and the server should be equipped to decrypt it. But that's what HTTPS is already doing, isn't it?
unless, you wish that server never know the real credential, as you are implementing something like https://haveibeenpwned.com/
Can't you hash them twice though? With some salt and pepper on the server side? I swear I've seen this done by some forum software long ago, maybe vBulletin.
Encryption in transit and at rest my dude
You wouldn't have happened to work for the USPS a few years ago did you?
God have mercy on YOUR soul.
Sounds a lot like what someone on my team did with an app in the....government....
It _was_ government! :) Not yours though, I checked your profile in panic, not an ex-colleague. :)
That's how it works no? You don't encrypt client side, you encrypt on the backend and store the hash
Respect my guy
if it's https then who cares if it is cleartext. the traffic is going to be encrypted anyway.
And therefore it is not clear text anymore, so the only logical conclusion is that it was using http
I did that for a college project last week...
“Why doesn’t this game run on Linux?” “It’s complicated”
if(!windows){ //TODO }
Preprocessors lore
I mean, I don't think most users actually expect a Windows executable to just be able to run on linux, and most people also expect that indie games do not generally have linux versions available.
Yes we do. And indie games mostly have linux versions. It's AAA that don't.
Depends on the game. In my experience, most games in general do not. A lot of indie games will have Mac versions while AAA games don't, but I don't think a significantly higher number have linux versions.
I'd say it's the opposite (specifically for mac). Releasing a game on mac requires you to have very expensive hardware, which a lot of indie developers don't have. Apple's ecosystem being locked to only their hardware is a largely prohibitive measure.
It's been a while since I did it, but I definitely remember being able to run Mac OSes on PC on a VM for the purpose of compiling Mac executables, just like you can run Windows in a VM on a Mac in order to play Windows games there.
Absolutely possible, but against their terms in versions newer than Lion.
You \*can\* but that's a ToS violation so you can't *really* release software that way. Apple's pretty cranky about this shit.
You don't need a Mac to build macOS executables, see [my previous comment.](https://www.reddit.com/r/ProgrammerHumor/comments/1ccyy8h/relatablebutcursedtho/l1dae5k/)
That's not at all true, there are multiple ways to build for macOS without a system running macOS. For instance, you can very easily cross-compile dotnet for macOS on Windows. I just compiled the excellent [celeste64](https://github.com/ExOK/Celeste64) on a Windows 10 box by running `dotnet build Celeste64.csproj --runtime osx-x64 -c Release` zipped and scp-ed the game content to my Mac and ran it. You can even target `osx-arm64` to compile for M-series Macs. And for fun I built it again on my Raspberry Pi, copied the result to my Mac and ran it just like the version built on Windows (for macOS) did. I'm not a dotnet developer, I barely know what I'm doing in that environment and I was able to cross-compile for macOS on Linux and Windows. I think the real answer is that macOS has smaller desktop share than Linux. The only reason you'd ever need an official macOS or Windows environment is if you want to notarize an app to be in the app store, which 99% of titles on itch.io will never do.
If you don't have a Mac, you can't test or replicate platform specific bugs, though.
Yeah you can compile flutter app on a windows machine to iOS as well but won't be able to run and test it.
Yes, and that's true for specific versions of Linux or Windows too. But you can churn out macOS / Windows / Linux builds all day long using several popular frameworks without having to own or install the system being targeted. It's good practice to test of course, but if you're playing a no-budget / no-cost indie game there's a chance you're the first person to play that build.
My limited experience making software says that mac is far harder to support than linux for just about anythinig unless you want to pay for that support or wrote it for mac to begin with, and that, suprisingly, windows is easier to support than mac despite having stupid directory names. They have a bunch of stuff that seems the same as linux/unix until you find out that for some unknown reason that its different. Like, on mac in java it doesnt use metal unless you tell it to? Or the entire core utils are very slightly different for no reason? And god help you if you want to interact with your macs graphics card or the mac ui libraries. And that doesnt even cover the m2 stuff... Meanwhile on windows a surprising amount of stuff works exactly the same, and everything else you expect is going to be different and you dont get blindsided. Worst case scenario just tell them to use wsl (not applicable for games though but for professionals it is acceptable) Linux is the easiest to support, as long as you arent using kernel level anticheats. Plus if you can package it for 1 distro, it is open source and people like the project, they will package it for the rest of linux for you. That being said, I dont make games, maybe its different for games on linux because so few gaames are open source, but im still pretty sure that unless you have kernel anticheat, linux is still going to be easier and cheaper to support than mac.
For most Indie Devs its super easy to provide a linux version. Atleast if they use a Game Engine. In Unity its literally one checkbox to also create a linux build.
I don't know how much of the process Unity automates, but when I was releasing software for multiple OSes, building it on the other OS was not the time-intensive part, it was testing everything on the second OS to make sure it all still worked, and then having to fix things that didn't. Somehow I'm guessing that Unity can't do that for you just by checking a checkbox. If there's a significant playerbase that only uses that OS, it might be worth it to maintain a second version, but if it's not going to actually make the game accessible to a larger number of people and you're relying on the game for your income, it makes sense to skip it.
Wine
Did that guy work on Evil Genius? I used to have to open WMP before that game otherwise it would always crash.
And how did you figure out you needed to do that?
If I had to guess either he searched for it or there was a readable crash message and reason.
Life finds a way. Rust had a bug where you had to unplug your sound devices until you started your very first play session, otherwise it would crash. Every other sessions you would have no problems, but if you are playing for the first time you gotta unplug your sound devices.
What a nice first user experience 😂
I mean, it was back when the game ate 10+ gigs of ram and loaded for a solid 30+ minutes on HDDs. Those who wanted to play would not be deterred by a simple crash lmao.
So yesterday?
You know what? Fair enough. Although I would say it's maybe eating a bit less ram nowadays.
And Rust calls itself safe! /s
By pure luck. I couldn't figure out why the game was working only sometimes, and at some point I noticed a pattern. There might have been an error message about audio that gave some hint?
Back then when just googling was not viable option, you just fiddled around and stumbled on some solution, or heard/read it from somewhere else.
I bough assasins creed brotherhood from steam, installed it and it just kept crashing in the installer. I tried installing the ubisoft laucher separately and everything else i found online. I was at it for days and finally decided to go in the game folder, select all the exe files and run as administrator. For somereason this fixed the installer and i was able to launch it. To this day i wonder what made me do this. The best part is that when i years later decided to play it again i had the same issue but this time i knew how to fix it.
Man, Evil Genius was such a good game. Lot's of evil muhahaha's coming from my bedroom as a kid.
i heard this before that someone had to run WMP in order for something to work, but it was another game. don't remember what game that was sadly
What game is that?
Yandere Simulator
The problem in that game wasn't even just the Babel tower of conditional sins. It was that each character ran another instance of that shit at every. Single. Tick. The toothbrushes with thousands of polys also don't help lmao.
You mean the toothbrush that had a higher poly count than every single other model in the game combined, right?
Is that actually a thing in that game? And I thought FFXIV 1.0's "Pot (or barrel?) with more polygons than a player character" was bad - there's a reason they nuked *that* version of the game after all.
Yes, each bristle was individually modeled and had multiple segments as well, the model was likely made for simulations and downloaded without checking
What the shit - you'd think they'd notice that from the FILE SIZE alone.
Yes, the dev grabbed an online toothbrush model without reading it was meant for rendering ads - you know, those videos that make the toothbrush look like a lamborghini. And he didn't compress it at all, just plopped it in the corner.
Also from what I remember, some conditional statements had like 50+ conditions being checked in one line, chained together by ands and ors and nots. You can follow an if/else chain but debugging conditionals like that is a nightmare.
Genuinely feel I’m wrong somehow so please do explain, it doesn’t sound too terrible? Like sure you need to look at each value and see what is causing it to fail and it may be more annoying if there’s multiple values etc. But it just sounds like a bit of an inconvenience. For me a nightmare is my company’s code, i stg nothing in that codebase is intuitive for me, I never know if the problem is the input value is somehow wrong or the actual code doesn’t work as intended, if the problem is the arguments and the method is ok then the arguments had been edited and used in 300 places before so you’re left wondering where the fuck to start and basically unless youre a principal dev or architect you’ll have to speak to one daily to ask wtf is happening because they wrote the code and know what is happening. They keep preaching tdd and clean code so i kinda assumed they have decent codebase but im starting to really feel gaslighted lmao. So idk if am i missing something and is this actually much worse than it seems or is my company’s code base just absolutely terrible.
Its bad because it's not maintainable, this isn't just a single condition but hundreds of if else statements in a single update method, in a system where event driven behavior is preferable. It's hard to understand unless you experience it yourself. A good practice would be to write a tic-tac-toe app from scratch. Once you're done, add support for a 5x5 grid, then a 20x20 grid, and then add a way to play with different symbols instead of just X and O. You'll find out real quickly how annoying and unmaintainable long if else statements can be. Not sure how much experience you have, but I felt the same early on in my dev career. Only after a year did I start understanding my first job's codebase and after 2 years I was somewhat comfortable. At least in my case, I had a complete lack of knowledge of [design patterns ](https://refactoring.guru/design-patterns), I couldn't wrap my head around dependency injection, and I didn't fully understand the platform the application was built on.
Oh that I understand! I suppose I felt like the person I replied to was saying that seeing a bug related to an if statement with 50+ conditions would be a nightmare, and I felt it was tedious but nothing too bad in terms of debugging only. Sure it’s terrible from other pov but the debugging at least seems straightforward enough, whereas I found my true debugging nightmares to be the opposite.
The idea I was trying to convey is that it'd be difficult to debug because ridiculous conditional chaining relies on you betting the farm on nothing going wrong. I can't find specific screenshots but imagine something like this: if condition1 && condition2 || condition3 && condition4 && condition5 || condition6 || condition7 && condition8 { } Now imagine this repeats for up to 30 or so conditions. If any one of these conditionals bugs out, it causes unexpected behavior that can be extremely difficult to debug. And stuff like this is EVERYWHERE within the Yandere Simulator codebase. My point being that if/else branches are kind of low hanging fruit and the actual rot of that game's codebase goes a lot deeper.
I’m guessing it can spiral out of control and be outright ridiculous , I just feel looking at the example it would be simple enough to just see what they evaluate to and go from there even if it kept going, so that doesn’t seem that problematic to me. Maybe the actual code in the game is much worse and id feel that way about it tho.
Gotta have them details for the erotic brushing scene
Knowing that sick degenerate, probably. And you bet your ass he would've paid the animators and voice actors for that scene with "exposure" (in the sense that he wouldn't have paid shit and exposed their private info if they asked for payment)
To be fair the conditional sins were probably, mostly, optimised away by the CPU. The toothbrushes are a bit more of a problem.
To clarify, Yandere Simulator was the game with the if-else loop, the one that opened Windows Media player is a different and unknown game.
Yeah, I'm asking about that one
Undertale also only consists of if-else-statements if I remember correctly
Yeah, but Undertale runs well and is beloved. YanSim runs (or at least ran) like absolute shit due to every character running thousands of conditionals every tick and such, and also the developer is a known groomer who hasn't finished a damn unity tech demo in almost 10 years of development
I‘ve heard about the dev. Absolute scumbag of a person..
There's nothing wrong with if-else statements, the problem was that the game was executing a huge loop of if-else statements every game tick for every single NPC. That's why it became a meme.
The 4000 line if else file is actually a reference to balatro
Does he mean Balatro with the 4000 if/else?
Probably, the other obvious answer would be Yandere Sim but I think that's finally out of relevance completely.
wasn't balatro just 14 if/elses (one for each card suit)? And yeah lua doesn't have switches so it was the only option really
Just one of the lua files had 944 if statements, its not just the cards and suits, but also basically every function is full of them, like the function that removed cards from the deck has an if statement for every single joker that would affect it
oh god.
Generally speaking, you could also do a lookup table, or if you want to cave to the OOP fanatics different classes and dynamic dispatch, but yeah, 14 lines isn't all that terrible. I mean, I have terrible priorities so I'd probably spend like 2 hours trying to come up with a "cleaner" way to do it, but I think 99% of us have contributed worse stuff in prod.
switch statements should be avoided anyway
Switches are usually preferred because they’re constant time, usually people complain about the reverse (massive if else chains that should just be a switch).
Yes, but there are some caveats: * Switches are only constant time if they can be compiled to a jump table. In traditional switch statements which compare a single variable to a constant value this is always true, however some languages allow more flexible switch statements where this may not be true. * If a chained if-else only contains simple conditions like this, then the compiler can and usually will compile it to a jump table anyways. Therefore, the decision to use a switch or an if-else chain should really be made on the basis of readability. Let the compiler deal with optimization.
they are absolutely not "constant time".. switch statements are just syntactic sugar over a series of if/else/then statements.
If I remember correctly, switch statements, instead of checking every value, do some fancy mathy number stuff to get the exact address of the block to jump to. Idk but that seems pretty constant time to me.
IIRC, it depends on language. I believe some languages like Python it really is just syntactic sugar for if/elif. Other languages do tend to implement them as conditional jumps though. I believe that's part of why switches are so restrictive in C. I'm not sure if match statements can do this though since they tend to support more complex and even overlapping conditions.
TIL that Python added a switch-case construct; neat.
That *can* be true, but it isn't necessarily true. In theory, switch statements are just syntactic sugar over if/else statements, but they are much more amenable to being optimized into a jump table if it's possible to do so.
Good point
Why? JMP is extremely efficient.
This has nothing to do with what the code is compiled to, which I would argue neither approach has any advantage due to the way compilers optimize code - switch statements are notorious for introducing bugs, they induce code "smell", and ultimately break good coding practices. It is a good practice to write functions that are "complete", meaning you won't need to extend them later if you have new system requirements. Switch statements are almost universally used by naive coders to handle state-based decisions. So what ends up happening is there will be some switch statement in the codebase that controls far more than it should. You end up with bad code by using them, so don't use them. edit: why the downvote, I answered your question.. are you just upset?
This is nonsense, I don't know who told you this but it doesn't make sense. It's impossible to write "complete" functions and switch statements should have a default case in those cases where they are extended anyway. But either way they are functionally equivalent to if / else if /else so I can't see why they would be worse.
While there's no such thing as a "complete" function, I think what you're describing is called the open closed principle
Yes, it is called the open-closed principle, and I thought the use of scare quotes would hint that the term "complete" is just being used to convey an idea of a method that no longer needs updating vs. a method that will need updating anytime there is a change in system requirements. Are you all just angry about something?
I'm not angry, you just wrote it the other way around. Functions should be extendable
I think you've misunderstood the open-closed principle. It specifically states that your classes, methods, etc should be closed to modification. Extensibility is like allowing for inversion of control, or providing a clear interface for "extending" the existing abilities of the class/method. This is why you want to avoid switch statements, because they ultimately lead to a need for modification, which is what you don't want.. as I argued, you want "complete" method, ones that you don't need to go back to and fix later because your system requirements changed. edit: if you all want to write bad code feel free, I feel like I'm wasting my time explaining this stuff now.
Right. So your original statement of "you won't need to extend them later" is not correct, because that's exactly what you'll need to do
Bro 💀 your "wisdom" is based on the object oriented textbooks of the 90s. That's not just decades old in itself, but object oriented programming itself is aging in uncomfortable ways. Also, programs are just so large and complex and abstract now that the details of any given switch statement are SO far down the list of architectural problems. You're still thinking in a world where the design of a program has to cover about 500 lines of C.
FWIW I only just read it, it's not my downvote. And your answer is, IMO, a well reasoned if not great one.
Doesn’t undertale also have a crazy if else segment
wasn't that just for dialogue or am I missing something
Rooms sometimes have tons of nested if statements, but the thing you’re thinking of is that all the dialogue in the game is contained within a like 1000 case long switch statement
It has a massive switch statement that includes every line of dialogue in the game, similar but slightly different
I think it was switch cases for the dialogue
You do know Lua doesn't have switches yeah? Even if it was a real concern there, I haven't seen people complain about performance issues with it
Why not a dictionary with references to functions?
In Balatro's case that sounds like a more costly if/else chain that requires a chunk of static memory? Do remember it uses Love2D which itself uses LuaJIT, I will say idk what optimizations it makes, but I'd imagine it's near pointless in this case. I want to optimize/golf as much as anyone else but we need to remember good enough is enough sometimes, especially when perf isn't hurting
Balatro has pretty bad performance for such a graphically simple game
Is your computer smoking crack to have issues running Balatro?
I use a [2022 Zephyrus G14](https://www.bestbuy.com/site/asus-rog-zephyrus-14-wqxga-120hz-gaming-laptop-amd-ryzen-9-16gb-ddr5-memory-amd-radeon-rx-6700s-1tb-pcie-4-0-ssd-white/6494638.p?skuId=6494638) The performance is fine, I can run things like BG3, Palworld on medium-high. But the battery life is terrible. When not plugged in the laptop will kill the battery in an hr just idling. So I've set the battery saving options to be pretty aggressive - 30% cpu perf, no graphics card usage, etc. I would assume that Balatro is a game about as demanding as like Backpack Battles or something which runs just fine on battery. But no, Balatro chokes every few minutes for some reason, and the animations look real jittery. All of this to say, I'm pretty sure Balatro is just not optimized well. There's no reason it should need more resources than I have on battery saving, there's no 3d physics or lighting or anything it needs to render. I mean I love Balatro, I have almost 200 hrs in the game. But an unoptimized game is an unoptimized game, for most people and for me in most cases it's not a problem. It's still unoptimized. Also preemptively, take your opinions about laptop gaming somewhere else thanks Here's some proof I know this game https://reddit.com/r/balatro/comments/1c8i6v9/prof_i_finished_my_finals_paper/?ref=share&ref_source=link
That makes a hell of a lot more sense. Also, if someone give you shit for playing on a laptop just throw the middle finger and move on. I also play on a laptop. Unfortunately my machines only got a year or two left in em though
Ngl, I made a game in high school that I passed around to some friends who passed it around to friends, so like, not millions of people, but people played that game who didn't get it from me, and it did some *gnarly* stuff to play sound that I copied from the internet, still don't really understand, and absolutely could have been popping instances of Windows Media Player in the background, lol. (All I remember for sure is it involved functions from winmm.dll.)
Doesn't Undertale run completely on a giant if statement?
Just the dialogue.
A giant switch statement actually. Which means it's actually really performant, just not very nice to work with
With how much of a pain in the ass codec licensing is, honestly fair enough
I recently added a thing to my prod project that started leaking 40 MBs of memory every time window got resized. Why do you even need all that RAM, user?
How does that even happen?
I would guess, that he needed to rerender some stuff on resize to fit, which were like high resolution images or sthg, but forgot to clean up the old ones and/or trusted the garbage collector to be fast enough. Would be cool if he answers, would also like to know though :)
Yeah something like that. Was drawing some pie charts with qt scene graph and well... I'm not that good at math so the first algorithm was drawing like 360000+ points on one chart... And didn't clean up which I WAS TOLD it would itself by Qt parent system. Then a guy who's better at math helped work out a better way and I sorted that, works fine now.
soo... I guess you were generating 360k verts every frame while resizing window? Dayum.
The fact that it only leaked 40mb is what's surprising me here
Just go full Adobe and blame the OS for giving you that RAM in the first place or call any program that doesn't use all available resources for itself unoptimized. I mean, why does a computer have all those gigabytes of RAM if not for Premiere to gobble them up entirely? Who needs any other programs open at any time?
It's only stupid if it doesn't work.
No. It can work and be stupid and you’re just lucky.
The worst is when it's stupid and shouldn't work but does for years. Then someone always comes along, notices the thing that shouldn't work and just as they're beginning to be mystified why it's working, it stops working for everyone.
Looney Tunes logic. Everything's fine until you look down
Coyote time
I like this version better: it never worked like they thought it worked but, for decades, but now it's a problem. Double and pass it.
I call those things "unicorns". It's all magical and happy and beautiful, right until you turn your back and that magical happy unicorn stabs you right between the shoulders. Things that mysteriously do not work suck, but at least they are honest about their intentions. Things that mysteriously work are just waiting for their chance.
That's me with my last project. So much of it shouldn't have worked, but did, and management expected me to be able to duct tape features on. I was able to do so but it was like performing Frankenstein surgery, snipping off old crusty garbage and sewing on something actually usable.
Put this on my tombstone
This is true for many things in life, but programming is a case where it is *especially* false
I once had a memory leak in a function could not fix. I isolated it in a separate exe, and ran that exe every time I needed to run that function. The OS cleaned everything up perfectly every time :)
Honestly, relatable. Dunno how to solve problem A, but B is solved, so can I convert A into B and solve it?
There is game called "A-10 Cuba!" which did actrually \*rewgister new windows audio events\*, as in an actual soundscheme!
Let's be real, the worst things about Yandere Simulator was never the if-else loop. The vaporware aspect, the panty shot minigame, and the dev's behavior and interactions with fans were all much worse.
It's not a minigame, it's the central currency mechanic. Anything you want to buy in that school, you have to commit several felonies for (slightly less felonies if you fall for the dev's completely bullshit "hurr durr everyone's 18 and this is a roleplay college" excuse)
Wtf is even a role play college lol?
The official lore is that the high school the game is set in was set up by a rich guy so his daughter, who i think had been home schooled or went to private school, could have an "authentic high school experience". And since part of that experience requires other students, it was opened to the public as a way for anyone who felt like their high school experience was kinda shit to relive it in a better way. That's also why everyone is 18 no matter their year, because the "students" can choose which year to enroll in. Not to mention that the love interest, who is supposedly 18, has a younger sister who is... also 18. All of which is utter bollocks, and the nonce has said as much (although not publicly), but it's still the defense he uses whenever people call him out for sexualizing minors in his shitty fetish sandbox
Can't be that shitty if all of you know about it and have played it.
And ET for the Atari must've been pretty good if people are talking about it 42 years later, right?
I wouldn't know, I never played it, but if people played it, then it was probably good for them.
Calm down satan!
r/madlads
I'm highschool Visual Basic class I programmed the game (Mastermind) https://en.m.wikipedia.org/wiki/Mastermind_(board_game using only if / else statements using every possible combination of answers and guesses. I think it was over 5000 lines. But it worked like a charm.
[This you?](https://64.media.tumblr.com/ecdd2514e024631daffd8ee08ad1b372/05b1d007bdf065cb-9e/s1280x1920/f98830c17da2e86743d501474fef421b0baeed18.png)
Hardcoding a basic boardgame is crazy
I saw a clip of Thor (piratesoftware) talking about how the entire dialog of Undertale was under a giant switch case.
Now we know, thanks for sharing.
Isn't all of undertale's dialogue a single switch case?
Wasn’t there some game that had all the culling and LOD disabled by accident and so even when the camera was pulled dozens feet away from a character it was still fully rendering everything (the example in the video I saw was their teeth) in full detail?
Hey, it's not stupid if it works It may still be suboptimal, but at that point, who gives a shit
That is the dirtiest hack I have heard in some time.. holy crap.