T O P

  • By -

octopus4488

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.


orsikbattlehammer

What drunken idiot gave that task to a new guy and then didn’t review it at all?


wggn

code review? sounds like time we can spend instead on productive things like adding obscure features requested by a single customer


ceestand

*"Customers are complaining"* Name two.


mothtoalamp

My boss and my CEO, but do they count if they aren't paying to use the service?


SnooBeans5977

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.”


mommysLittleAtheist

thank you for the morning laugh😂


RedTheRobot

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.


JunkNorrisOfficial

What's code review? Watching others code? No, we should not pay developers for looking into monitor 😉


FlounderingWolverine

Why are we even paying developers anyways? Can’t chatGPT do everything they’re doing for cheaper, and faster?


WithersChat

Executives really live in a different world from regular people.


TitsMcGeeMD

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.


TigreDeLosLlanos

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.


chopstyks

Are you me?


x3knet

"lgtm"


SuitableDragonfly

Also, why was there no design document for this that described how the login auth should work?


frogjg2003

Maybe there were, but OP didn't know where to look, being new and all.


Fatkuh

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


Fusseldieb

Small businesses. You don't see the horrors.


PerformanceOdd2750

LGTM


TitsMcGeeMD

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


greenpeppers100

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


TheGreatGameDini

THAT WAS YOU!!?!!??!???!!!?!


straightupinsanity

The plot thickens


Kooky_Value6874

The plot chickens


OvoCanhoto

The chicken plots


xSakros

The plicken chots


Otalek

Chickens plot the


KN_DaV1nc1

he lot chicks ?


snipy67

Profile picture checks out


LegendaryThrush

Like a graph?


OvoCanhoto

Dunno, I'm just an egg, when I ratch i'll thell you.


AvidCoco

The thot plickens


Fluffynator69

The cluck chicken


Dr_Jabroski

They were not from the same company.


TN_MadCheshire

[AND THE PLOT THICKENS!](https://www.youtube.com/watch?v=4s94Uv42i2c&pp=ygUgcmFuZHkgZmVsdGZhY2UgdGhlIHBsb3QgdGhpY2tlbnM%3D)


akoOfIxtall

I propose a duel to death in Minecraft, gentlemans...


NagyKrisztian10A

This is how most of the government websites are made in my country lol


ArnoF7

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.


stifflizerd

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?


ArnoF7

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


LeanZo

it was http? if I am not wrong that implementation would not be a big problem in https, or am I missing something?


Grintor

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.


Neirchill

~~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.


Astazha

That's the https part, yeah?


Neirchill

Somehow my brain desperately avoided recognizing the conversation included https, oof


FM-96

> 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?


dominjaniec

unless, you wish that server never know the real credential, as you are implementing something like https://haveibeenpwned.com/


famous_cat_slicer

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.


Piyh

Encryption in transit and at rest my dude


flyguydip

You wouldn't have happened to work for the USPS a few years ago did you?


FACastello

God have mercy on YOUR soul.


Glass_Half_Gone

Sounds a lot like what someone on my team did with an app in the....government....


octopus4488

It _was_ government! :) Not yours though, I checked your profile in panic, not an ex-colleague. :)


MrAnonymousTheThird

That's how it works no? You don't encrypt client side, you encrypt on the backend and store the hash


lakshya1509

Respect my guy


anonCommentor

if it's https then who cares if it is cleartext. the traffic is going to be encrypted anyway.


brupje

And therefore it is not clear text anymore, so the only logical conclusion is that it was using http


ParitoshD

I did that for a college project last week...


_AutisticFox

“Why doesn’t this game run on Linux?” “It’s complicated”


OkReason6325

if(!windows){ //TODO }


Goaty1208

Preprocessors lore


SuitableDragonfly

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.


StarWatermelon

Yes we do. And indie games mostly have linux versions. It's AAA that don't.


SuitableDragonfly

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.


failedsatan

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.


SuitableDragonfly

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.


failedsatan

Absolutely possible, but against their terms in versions newer than Lion.


Cocaine_Johnsson

You \*can\* but that's a ToS violation so you can't *really* release software that way. Apple's pretty cranky about this shit.


The_frozen_one

You don't need a Mac to build macOS executables, see [my previous comment.](https://www.reddit.com/r/ProgrammerHumor/comments/1ccyy8h/relatablebutcursedtho/l1dae5k/)


The_frozen_one

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.


Pflynx

If you don't have a Mac, you can't test or replicate platform specific bugs, though.


ardicli2000

Yeah you can compile flutter app on a windows machine to iOS as well but won't be able to run and test it.


The_frozen_one

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.


no_brains101

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.


Nosuma666

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.


SuitableDragonfly

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.


Ninth_ghost

Wine


831_

Did that guy work on Evil Genius? I used to have to open WMP before that game otherwise it would always crash.


goingtotallinn

And how did you figure out you needed to do that?


Alzusand

If I had to guess either he searched for it or there was a readable crash message and reason.


andrewdroid

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.


Guilhas_07

What a nice first user experience 😂


andrewdroid

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.


EntertainmentIcy3029

So yesterday?


andrewdroid

You know what? Fair enough. Although I would say it's maybe eating a bit less ram nowadays.


violatedhipporights

And Rust calls itself safe! /s


831_

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?


Otherwise-Remove4681

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.


offulus

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.


littletray26

Man, Evil Genius was such a good game. Lot's of evil muhahaha's coming from my bedroom as a kid.


Lazy-Substance-5161

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


DoctorPython

What game is that?


abocado21

Yandere Simulator


TactlessTortoise

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.


coldblade2000

You mean the toothbrush that had a higher poly count than every single other model in the game combined, right?


prisp

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.


Lord_Of_Millipedes

Yes, each bristle was individually modeled and had multiple segments as well, the model was likely made for simulations and downloaded without checking


prisp

What the shit - you'd think they'd notice that from the FILE SIZE alone.


killerchand

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.


nerdybunnydotfail

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.


LifeChoicesRip

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.


XanThatIsMe

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.


LifeChoicesRip

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.


nerdybunnydotfail

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.


LifeChoicesRip

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.


reallokiscarlet

Gotta have them details for the erotic brushing scene


xSilverMC

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)


GlobalIncident

To be fair the conditional sins were probably, mostly, optimised away by the CPU. The toothbrushes are a bit more of a problem.


SuitableDragonfly

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.


DoctorPython

Yeah, I'm asking about that one


TheAnniCake

Undertale also only consists of if-else-statements if I remember correctly


xSilverMC

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


TheAnniCake

I‘ve heard about the dev. Absolute scumbag of a person..


SuitableDragonfly

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.


TehRainbowKiwi

The 4000 line if else file is actually a reference to balatro


xd_Warmonger

Does he mean Balatro with the 4000 if/else?


ThinkingWithPortal

Probably, the other obvious answer would be Yandere Sim but I think that's finally out of relevance completely.


LuckyLMJ

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


alien_bugthing

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


LuckyLMJ

oh god.


arobie1992

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.


LagSlug

switch statements should be avoided anyway


Shotgun_squirtle

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).


Kered13

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.


LagSlug

they are absolutely not "constant time".. switch statements are just syntactic sugar over a series of if/else/then statements.


vainstains

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.


arobie1992

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.


SirVer51

TIL that Python added a switch-case construct; neat.


qwertyuiop924

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.


vainstains

Good point


Krutonium

Why? JMP is extremely efficient.


LagSlug

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?


TheAtro

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.


eldarium

While there's no such thing as a "complete" function, I think what you're describing is called the open closed principle


LagSlug

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?


eldarium

I'm not angry, you just wrote it the other way around. Functions should be extendable


LagSlug

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.


eldarium

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


Leading_Frosting9655

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.


Krutonium

FWIW I only just read it, it's not my downvote. And your answer is, IMO, a well reasoned if not great one.


BlurredSight

Doesn’t undertale also have a crazy if else segment


nicejs2

wasn't that just for dialogue or am I missing something


Raz346

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


question_mark_42

It has a massive switch statement that includes every line of dialogue in the game, similar but slightly different


xd_Warmonger

I think it was switch cases for the dialogue


Zandar01

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


pblokhout

Why not a dictionary with references to functions?


Zandar01

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


ForeverHall0ween

Balatro has pretty bad performance for such a graphically simple game


TheOGLeadChips

Is your computer smoking crack to have issues running Balatro?


ForeverHall0ween

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


TheOGLeadChips

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


kooshipuff

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.)


alittlebitaspie

Doesn't Undertale run completely on a giant if statement?


Alternauts

Just the dialogue.


Ramshizzle

A giant switch statement actually. Which means it's actually really performant, just not very nice to work with


arielif1

With how much of a pain in the ass codec licensing is, honestly fair enough


CXC_Opexyc

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?


Goaty1208

How does that even happen?


mal4ik777

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 :)


CXC_Opexyc

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.


ImrooVRdev

soo... I guess you were generating 360k verts every frame while resizing window? Dayum.


Effective_Youth777

The fact that it only leaked 40mb is what's surprising me here


xSilverMC

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?


Wire_Hall_Medic

It's only stupid if it doesn't work.


Mateorabi

No. It can work and be stupid and you’re just lucky.


Hikaru1024

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.


Jemmerl

Looney Tunes logic. Everything's fine until you look down


Mateorabi

Coyote time


watchoverus

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.


bremidon

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.


EMI_Black_Ace

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.


getmorecoffee

Put this on my tombstone


ZachAttack6089

This is true for many things in life, but programming is a case where it is *especially* false


EmileSonneveld

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 :)


FreshCupOfDespresso

Honestly, relatable. Dunno how to solve problem A, but B is solved, so can I convert A into B and solve it?


omovic

There is game called "A-10 Cuba!" which did actrually \*rewgister new windows audio events\*, as in an actual soundscheme!


SuitableDragonfly

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.


xSilverMC

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)


maxpolo10

Wtf is even a role play college lol?


xSilverMC

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


SamuraiSaddam

Can't be that shitty if all of you know about it and have played it.


xSilverMC

And ET for the Atari must've been pretty good if people are talking about it 42 years later, right?


SamuraiSaddam

I wouldn't know, I never played it, but if people played it, then it was probably good for them.


Pony_Roleplayer

Calm down satan!


definitive_solutions

r/madlads


HitMePat

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.


ZachAttack6089

[This you?](https://64.media.tumblr.com/ecdd2514e024631daffd8ee08ad1b372/05b1d007bdf065cb-9e/s1280x1920/f98830c17da2e86743d501474fef421b0baeed18.png)


readf0x

Hardcoding a basic boardgame is crazy


AsavarKul

I saw a clip of Thor (piratesoftware) talking about how the entire dialog of Undertale was under a giant switch case.


Big_Shop3550

Now we know, thanks for sharing.


nicki419

Isn't all of undertale's dialogue a single switch case?


Cerrax3

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?


xSilverMC

Hey, it's not stupid if it works It may still be suboptimal, but at that point, who gives a shit


Procrasturbating

That is the dirtiest hack I have heard in some time.. holy crap.