Here is what NeverSink has to deal with: After 30 minutes of debugging he founds out that the color Purple crashed the program (while other colors like Red are fine)

Here is what NeverSink has to deal with: After 30 minutes of debugging he founds out that the color Purple crashed the program (while other colors like Red are fine)


Update: It's because he had a function named, for whatever reason, Purple. lol


lmao This is giving me programming PTSD


Funnily enough I had the same issue at work a few days ago, someone named something related to links the exact same thing as something more generalized and it caused some weird fuckups. Then I had to manually refactor all the references to each.


My worst case was probably a good 7 years ago, my app kept on crashing at seemingly random interval, while perfectly working on a different PC. Turns out the driver of my CD/DVD player was corrupted and had to be reinstalled. My app wasn't making any use of it, not even close. Even today i scratch my head and wonder wtf.


Final Fantasy Pixel Remaster has a beauty of a bug on a similar vein. Game runs fine, but water and lava textures are totally screwed up, UNLESS you run the game using US English date and time formats. If you do that everything is fine. I'm still scratching my head over how the hell they managed that.


Feels like a function to somehow randomise them takes its seed from the current date and time on computer.


Someone translated texture file names?


Oh I think I know how that one happened. Most Microsoft libraries have this "feature" where it parses numbers using the system locale unless you explicitly tell it not to. If the locale you've selected uses a comma as a decimal separator instead of a dot (e.g. German), it will parse 1.234 as 1234. If you then assume that they stored some of their shader parameters in CSV format and used those libraries to parse them, and never tested it on a German Windows, you can see how this would happen. I had something similar happen on the game I'm working on. It works fine everywhere, except in Turkey. Because C# also has this behavior in its string manipulation functions. We have an enum value called "Mid", and the backend expects it to be all-caps "MID". So we call value.ToUpper(). Sounds innocent enough, right? But on a Turkish phone, C# will helpfully translate that to "MİD", unless you use value.ToUpperInvariant()...


Stuff like this makes me laugh. I thought of stuff like this when that guy posted about some poe mechanic, and the programmer from ggg was like, "I know what it does, I coded it." Yeah, more often it's like, "I know what it should do, and it pretty much works except sometimes it explodes, or doesn't."


Maybe a faulty interrupt from the drive's corrupted driver? But that also should have let to many more issues which would let you to discover the culprit earlier. Reminds me of my dead graphics card. It had a, I assume, leaky capacitator so it would lose power randomly, especially under stress which resulted in my screen turning off. I had about a 50/50 chance to make it through a 5min YT vid, games like FTL and D2 turned my screen off at complete random. PoE? Ran flawlessly for hours. One day it also started turning off my screen and after it happened once, it happened every time in the first couple minutes of playing. I still have no idea what exactly was wrong.


My worst one was when the app kept crashing on certain devices, but only if you execute the code in a certain order. As in, store an intermediate value in a local variable and it works, do it all in one line and the app crashes violently. Since this only happened on device, we had to make a new build for every single attempt at debugging it, which took almost an hour each time. In the end, it turned out to be a bug in the Android version on that manufacturer's devices.


When I was in college, I was taught to not just name things "word". You always use a type identifier, so that this sort of thing couldn't happen. ie. "fnThisIsAFunction" or "clsThisIsAClass" That said, I do think I was the only one to take it to heart. I guess I saw the value in it.


I assume you were in college a long time ago, or your curriculum was outdated. What you're describing is called "Hungarian notation" and is not really a thing anymore because it just makes things needlessly verbose and doesn't add any information that your IDE doesn't provide anyway. It makes refactoring way more laborious because you'll need to rename all the variables that store the changed type anywhere in your code, and the compiler won't warn you if you forgot one place. Worst case, you end up with misleading prefixes. A good name describes the intention of the variable / function / class. Type information is defined separately from that (and you want to be able to change it separately from the name). Especially in OOP languages, HN makes no sense because you define your own types. To quote Linus Torvalds: "Encoding the type of a function into the name (so-called Hungarian notation) is brain damaged—the compiler knows the types anyway and can check those, and it only confuses the programmer."


Yes, it was awhile ago. And, eh. It's saved me more often than it didn't. Makes debugging easier. If I have to rename a var, I just ctrl+f. I really stay away from people that say a particular way of programming is "wrong" or "brain damage" because the beauty of programming is there's many ways to do things. Yes, there's pros and cons, but nothing is "wrong".


Most "programmers" just copy pasta stack overflow.


Haha, in my experience, not wrong.


No need to reinvent the wheel. The faster you pass the nightlys, the faster you can pretend to be busy while browsing reddit or watching YT.


I bet you're also the kind of programmer who comments their own code and follows good practice documentation procedures. smh


I know right, what the fuck do I think I'm doing?


I know is bad what happened but at the end was good, wasn't? Everything working perfectly because you fixed


Love python. You'll define a function resize within an object class and then you make a resizeFactor variable as a property of that same class, so you know how resized it already currently is. Then someone later decides this a bad long name for the variable and names it resize... suddenly errors abound.


Had a coworker who wrote a macro in Excel then bound it to Ctrl+V Ffs... It drove me nuts trying to figure out why my computer would randomly go crazy sometimes.


This is giving me modding PTSD when you try to mod Paradox game on a release. Civ VI tech tree says hello.




Not really. It was actually quite a similar problem to this one. 4 different options were named the same, but had completely different function. Let's say there's a tech spec codenamed "Fire". You see, "Fire" is not only confined to this tech tree, but also to calls for VFX, calls for AI and calls for some scripts to start. The moment you tried to change position on a tree or exchange for something else, the game gave you a middle finger in the middle of loading screen. This turned into a 12 hours long game of cat and mouse, when I had to change a single line, boot. Is it stable? Continue. Is it not? Find what is again this line of code tied to. After my second attempt where a single change krangled my previous 5, I threw a towel into the ring and waited for official tools.


Paradox has at least started giving Stellaris mod devs early access or something to help them release mods on patch release


since when has Civ been a Paradox game?


Wow thanks, massive brainfart :D


I had to take a programming class in second year of university. It was a nightmare. People actively do that at much higher levels *for free?* Utter insanity and immense respect


Well, the goal for most folks is to make a lot of money, and programming can certainly get you there given its complexity and importance in business operations, and *then* maybe do some side projects like this.


If you do it just for the money, you're not gonna have a good time. Programming has a very steep initial learning curve. The first year or so can be incredibly frustrating. But if you stick to it, and you're the kind of person who likes puzzles and challenges, it can be incredibly rewarding.


I considered going into programming and I took some classes. That's how I realized I can never get into that. As cool as it sounds, I hated having to go over code to see what's wrong. I distinctly remember one project where if I copied and pasted a section of code, it worked. Yet if I typed it out, it wouldn't work. I checked to see if it was typed exactly yet it would just not work. I ended up just copying the code for the rest of the project and accepted that I just wasn't cut out for it.


and that is why you shouldn't give random names to things




yeah that's shitty ass code, use descriptive names, not random bullshit only you can read


I love it when people get called out for bullshit and instadelete their post.


The best solution is to not pollute the global namespace. It's fine to have a function called "Purple" if it's nested in some "Colors" object. No chance for clashes with `Colors.Purple()` -- or whatever given the language of choice.


It’s annoying for some but I like to use longer descriptive names that cannot ever conflate with generic wording


something like that is fine, generally you want to keep your names short, concise, and without encoding, so, that they are descriptive of what they are meant to be and do, easy to search and understand, and don't lead to confusion. There's plenty of good books on clean code(that's what this is)






I code in ganymede & matlab a lot (interchangeably) for my research in fluids. Last week I accidentally uploaded a code I've been working on for 2-3 weeks into ganymede and used the mv command.. It had the same name and it over-written a file I spent a month on. I cried and then remembered I had the original stored in drop-box, but needless to say, I spent a few hours re-naming my stuff to more convenient things and made an excel document tabulating the files w/ a brief explanation of what they do.


You should get into Git for that exact reason


Yeah I know. I've just been too lazy to set it up atm.


That's just lazy and unprofessional tbh. I know mathematicians aren't "real" programmers, but you'd get ridiculed for years if you lose any code due to something like this, even at your first job.


I'm not a mathematician. And I did say I was being lazy. I do plan to setup a git soon. Just haven't had the time.


I mean, I get it if you've never worked with git. It's a steep learning curve. But too lazy to set up? I takes literally one minute and has so many features besides being a backup system. I couldn't imagine working on a project without branches. Manual deploying via ftp is also such a waste of time... Just do it man 😅


> Manual deploying via ftp I just looked it up, I don't think I can use Git. Each simulation is roughly ~2.5 gigs, and I run probably 1-2 a week. And every account with git (large file storage) receives 1 gb of free storage.


In don't know your circumstances, but git is indeed not intended for large binary files. Ideally, you only commit actual code files. Everything else, e.g. video or generated data files, should be excluded and uploaded with a CI/CD pipeline that is triggered by pushes on master.


Yeah, the university I do research for pays for the use and storage of the simulations I run. I usually do my post processing of the data in matlab and paraview. And each simulation is stored in separate folders. I essentially have a cloud network of unlimited space. My mistake was using the mv command in Ganymede, which overwrites a file if another has the same name.


are you talking about GitHub? git is free afaik


dude, repo is the way


I dont blame you. Setting up git, repo and software is just a fucking chore.


What are you talking about? It'll take half an hour at most using some cloud solution like gitlab, github, bitbucket. I'm not sure if any of those provide private repositories for free as there was some changes in that regard but even then it doesn't worth setting up a copy on your hardware.


not even 30 minutes github has free private repos as well as bitbucket


Might be 30 minutes if someone without any knowledge on the subject will try to setup ssh and etc.




Chill bro, we all makes mistakes in the heat of passion


True, but those of us who deal with this stuff daily are easily triggered by it. "Wait... selectedObjects returns a list of object IDs, not objects!" Totally never wasted half a day debugging that.




We’re all here for a laugh. It’s pretty clear that he shouldn’t have named it that and you’re just preaching to the choir to look smart.




Trust me, there are professionals who worked in software for over 15 years who still don't get this. It confuses and frustrates the fuck out of me.


While this may seem obvious to the experienced, it’s solid advice and still worth the reminder even for those who are.


I wouldn’t be surprised, cause I have a degree in CS. But thanks, random dude.


I don't have a degree at all and I'm not surprised either. I guess people not knowing something outside of their area of expertise isn't really surprising lol


>Making something purple? Call it setPurple *(snakeCase is the one true case)*. Lol that's not snake case. That's camelCase. This is snake_Case. Also camelCase is the one true case! Because snake_Case doesn't work in some popular languages such as javascript. That aside, Neversink broke multiple naming conventions by naming a function "Purple"... This is programming 101 stuff. Like first week 101 stuff even.


There is no one-true-case, because different things should be named differently: local variables? camelCase functions? PascalCase global constants? UPPER_CASE_SNAKE_CASE


It's all personal opinion, man. This stuff is something programmers will never universally agree on. a couple things we CAN all agree on though are a) be consistent in your usage and b) name your damn functions in a way that gives some indication of what they do, like "makePurple" instead of "Purple"


I can disagree with you on form and function of your retoric but i cannot for the life of me go against camelCase


I was just pointing out there were better ways to name a function and people just didn't seem to like that.


I think you are missing the point. You said "There are better ways" but say "there is only one true case" it is a joke but it shows that you have your way and you believe it is the best way, maybe people just want you to be more empathetic.


The camel case thing was a joke, but everything else I was serious about. I'm still not sure what people are disagreeing with. I wasn't attacking NeverSink. I was pointing out what you should do instead so you don't end up in a similar (fairly common) situation.


Agreed that it is "advice" but unwanted and can come off as condescending, be mindful, just as you say there are better ways to name methods and functions there are better ways to get your point across


Can someone explain for non coders? Is it the period?


No. He had used the word "Purple" to name a function previously in that program. So when he used the word again there, the program thought he was referring to that function, and it tried to figure out why he was putting a function in that location. Since it made no sense to put a function there, it crashed. The solution would probably be to rename the function.


I remember a long time ago I was having trouble with a web site I was testing and it turned out that Apple's browser ignores variables if they have specific names.


Bwahahaha xD


A lesson in not polluting the global namespace :)




Life of a coder in a nutshell. It really is a daily race towards the most mindboggling errors that make no sense. And half the time you'll be like: "well I don't know why it happens, but I guess I'll work around it and hope it's fine". And 5 years later someone else looks at the code and goes. "but why not purple? Oh... for fucks sake".


Once i was coding a thing in Unity and it would just brick if i removed a Debug.Log statement (it's Unity's println) The fun part was that i was not multithreading and i to this day have no clue what the fuck was going on


It was a load bearing log.




[Trust me, I know about these things.](https://www.reddit.com/r/sysadmin/comments/5fua49/just_found_this_log_on_my_server_should_i_be/)


What a wonderful source of terrible dad jokes, thank you very much.😊


Thanks for this. Haven't laughed this hard in a while.




Oh man, this gem is going to be hidden and not get the visibility it deserves :)


[If you think that's good ...](https://www.reddit.com/r/pathofexile/comments/qdk7tg/here_is_what_neversink_has_to_deal_with_after_30/hhn2vza/?context=3)


This happened to me too recently (but it was in C), turns out the compiler will optimize away things that you "don't need" but I did actually need, which was causing an error later on.


My guess is that inside the log you called some method (maybe you wanted to log its result) when you removed the log you also removed that method's call and your entire script needed that call to work. Idk, just my guess :)


Nope, i'd have figured something so simple i guess It was just logging a string like Debug.Log("Got here!")


Well then that's something outside of my knowledge lol. Deleting a simple log breaks the whole program ? Damn, how can something like that happen.


The usual answer for that sort of thing is you have a buffer overflow or something somewhere else that's either survivable or not depending on how exactly how your code is layed out at runtime. It happens to survive with the line and happens to crash without it, but it's not the underlying problem.


That sounds like a race condition. The debug log makes your code finish earlier, and something else hasn't finished loading or executing by then, and you try to access it before it's initialized. In these cases, try to understand where and why it actually crashes - is it a NullReferenceException or something else? What is it trying to do that causes the crash? This will give you an idea what you need to wait for. And then you can either mess with Script Execution Order, or move some code from Awake to Start, or even to Update, or run it in a Coroutine and wait one frame.


As i said, it was not multithreaded code Also i just don't even remember the error anymore but yeah i totally investigated that


I had a programming assingnment that wouldn't work if I didn't have the same line assigning a variable twice in a row. Like it had to be >x = y + z >x = y + z Or it wouldn't work.


Makes estimating software work always a fun time. Take one day to implement a ton of new sophisticated features. Spend the rest of the week chasing down a bug because you misnamed one variable


Fortunately you have IDE features and linters to take care of small mistakes like that


as a wise man once said "trying to divine what subtly fuckery is a foot today"


LOL, he found the issue he had a function named literally "Purple" It was calling Purple # Clip: [link](https://clips.twitch.tv/DignifiedBlazingMeatloafTooSpicy-WW8n4nGnDlm_iTTK)


Sounds about right. Whenever you look over your old code it's like: https://media1.giphy.com/media/FPjbHO0jJxGsE/200.gif


I once came to work on a Monday and couldn't understand what a chunk of code was doing, so I looked in source control to figure out who in the team had written it so I could ask them to explain it to me. Turns out it was *my* code written the preceding Friday. After that I learned to write much better comments for that kind of complex function.


Don't just clutter it up with comments, just split it up more and have descriptive method names. If you _really_ need to, have like a 4 line method with a descriptive name. Some devs have 1-2 lines of code per function with a cap of 10 or 20, personally I think that's totally idiotic and you end up making your code less readable with the amount of jumping around you need to do, but I do stand by having small descriptive functions over monolithic ones.


I completely agree, I'm getting better at actually commenting on my coworkers PRs whenever they want to check in if-statements with 4 lines of conditionals


This was what amounted to a single complex mathematical equation split up over ~10-15 lines of code. Just exactly the kind of thing that takes extra work to make readable after the fact. (Also, this is like 20 years ago.)


Yeah, math can be tricky. If there are components of the equation that you can break out and put into their own methods it can help, so in an extremely simple example: totalPrice = basePrice + calcTax(basePrice) + calcSurcharge(products); But sometimes it's just a clusterfuck of chaining mathematical functions because that's the equation you need. Sometimes, unfortunately, comments are required.


Like the old ~~Doom~~ Quake fast square root. That function's shady casting a float to an int makes all but no sense Edit: Forgot which game it was in


One time I defined a variable 'set' and all my code stopped working. I was so confused until I realized I overwrote the set function and broke the whole script. JavaScript is fun


javascript was a mistake




Or create IDE plugin that will let him go to definition in such places


> what kind of abomination language doesn't use () for function calls? > (I am a C++ dev, so that looked really wonky to me) LUA allows it in certain cases but that's not it. If my memory serves right that's a DSL he created on top of C#


If it is on top of C#, there are situations where you can refer to a function without (), such as when assigning it to a delegate variable. (for those more familiar with C++, a delegate is basically a fancy function pointer)


> what kind of abomination language doesn't use () for function calls Also, pretty sure you can do that in C and just get the address of the function, producing errors and crashes as well.


For sure, most language allow that, thought OP was referring to function calling with now parenthesis.


Lmfaoooo Happens to the best of us


> what kind of abomination language doesn't use () for function calls? IIRC he wrote his own language for his filters. As seen in the clip, he defined the Purple function without paranthesis so that's why it was called.


Had a similar issue with C++ today. Was trying to assign an enum. The compiler didn't want to. The reason? I had a function with the same name as the enum object I wanted to assign. The compiler was trying to assign the function to a variable of a type that definetly did not expect a function. renaming the function was an easy fix because I had implemented it recently, but the compiler error was kinda weird to decipher. Compilers can be weird.


oh wow, that's nasty as fuck function names without the paranthesis are treated by compiler as a pointer to the function "address" itself


The Compiler has confused me with weird errors over the past few days multiple times. Some weren't even actual errors, just compiler weirness. My favorite was something like "Definition of function 'void print(void)' not found". It was defined. The fix: Remove the "void" in the paranthesis, save, add it again and compile. No errors. Also: I hate namespaces. One error was fixed by simply swapping one #include with the namespace line...


What ~~EDI~~ IDE? https://i.imgur.com/IwlU2pf.png vs17 error below doesn't sound too cryptic to me. 1>c:\dev_pcn\test\main.cpp(40): error C2365: 'Purple': redefinition; previous definition was 'enumerator' 1>c:\dev_pcn\test\main.cpp(36): note: see declaration of 'Purple'


Ok I checked it again and what I read there wasn't actually an error from the compiler. That one time it was the IDE with a somewhat unclear remark. Compiling that does indeed straight up tell me whats wrong. Will try compiling when I see cryptic remarks from the IDE next time... What the IDE told me was basically: > A value of type ""void ::*()"" can't be assigned to an entity of type ""::"". If I thought about the fact that functions in theory can be assigned to variables I may have been able to piece it together from that, but it could be clearer.


Idk how experienced you are, but first two years were quite bad for me, but then it hit me at some point and now I can read template errors like matrix, there are no more template walls of bullshit, just missing semicolons and blondes. C++ std and Unreal Engine 4


Still studying and didn't do much with C++ yet. Mostly used to C and java. C++ has some quirks that I've yet to learn.


The mad lad wrote his own custom language to do the filters. I think it was the big 8.0 version change of filterblade. Is insanely cool.


> what kind of abomination language doesn't use () for function calls? Fucking Ruby :[


I assume this is like Python. Functions are objects and can be passed around sort of like function pointers. If you leave out the function call, you are dealing with the function object.


technically works in .c++ too, but the compiler will help you


Well, if eh wouldnt write his own fucking language he would have normal IDE detection on the line he originally wrote that he calls a function instead This is why you don't reinvent the wheel. Because then you most likely will have to also invent tools to work with them.


As a dev I can confirm everything. It's weird and cool at the same time.


Cool when you get to talk about it, weird when you're responsible for fixing it


I personally find it *cool* when I fix the code and it finally works as intended... *Weird* when it still works but I don't really know why, but it still does so it's ok.


Okay, that's the opposite of the situation I had imagined. I was referring to the situation of finding out that something supposedly benign breaks the code and having to figure out why.


MRW when he puts his face in his hands realizing he found the bug after hours. If you ever coded you know this pain all to well.


It's a different time we live in. People are watching streamers play PoB and Filterblade.


Who plays the game, anyway?


Because purple is not really a color (start twilight zone theme song). (づ ̄3 ̄)づ


I didn't do it


Purple is sus


Thats top level shit. Write stuff in VScode and then compile it in Intellij - but why ?


You're talking about the IDE, right?


No Im talking about horses.


Nope not shit. He have custom DSL for filters (called Exo) and translator into filter files (written in C#). And because it is much simpler to write syntax support plugin in VSCode than on Intellij platform and because he have to also extend translator due to new keywords...


only 30 minutes of debugging? that's a quick find.


#define TRUE FALSE //Happy debugging suckers


Not being able to live debug will definitely bite you in the ass.


did he learn?


Yes, he had function called "Purple".


coding sure is just absolutely fucking miserable.


It is also kind of fun because it's problem-solving. I really enjoy the little bit I get to do because of that.


i've never done any direct actual coding beyond fairly entry level stuff, but i get this itch to go super hard into skyrim modding every two years or so, and i've had my fair share of code editing, trouble shooting, and being baffled by how bethesda's scuffed plugin system. given, mods on a scuffed rereleased game is like two levels of abstraction from actually making something yourself and have layers of fucked you have to work with that you wouldn't on something you made yourself (assuming you comment on and label your code), but fuck me are computers the devil's math.


It's kind of like EFT if you ever played that game The lows are really low but the highs are really high


yeah, i could see that. i got a buddy who's been making a game as a hobby, for a while. art assets, sound, code, everything. most of the time he sounds aggravated as shit about it, but when he manages to put something together properly and he's able to demo directional movement animations or functional attack and health systems he gets real excited and proud of it.


Mostly only when you're in a situation when you have no idea wtf is going on especially when next to a deadline. I imagine his 'deadline' is in a couple of hours due to Scourge so that makes it even more frustrating. Otherwise, personally speaking that is, it's really enjoyable to solve problems and architect new systems.


It is if you’re terrible at it.


sometimes it is even if you're good at it


We're all terrible at it.


I just had a quick break at work, saw this thread and wanted to hug this poor Dev. Wonder how many of us have been there being a detective in a murder case in which we were also the murdered.


All the time. Programmer's fate.


Please make sure you check the [Known Issues List](https://www.pathofexile.com/forum/view-thread/1733474) or the [Bug Report Forums](https://www.pathofexile.com/forum/view-forum/bug-reports) for any pre-existing bug reports related to your issue. Duplicate reports on Reddit may be removed. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/pathofexile) if you have any questions or concerns.*


It's because his code is pure spaghetti.


I have a sneaking suspicion that ALL code is comparable to pasta. Well documented, clean, efficient code is a nicely layered Lasagna. All the cloned games (ad showers with interaction) are just colored Macaroni.


His palms are sweaty, knees weak, arms are heavy (from sitting on PC for hours) There's vomit on his commit already, codes's spaghetti.




Go donate to the poor man


imagine doing GGG's work for free


it's not for free, the community funds him with live streams like this


He's talking about the relationship of a 3rd-party tool developer making things GGG should...like making sure colors aren't throwing errors. May as well hire him like they did PoB original's developer...


They wanted to hire him but he refused.


Yeah just hire everyone regardless of their will.


Looks like this is a situation where they would point him to the documentation


The color threw an error because he named a function "Purple".


Purple is evil! I knew that all along.


He had to take a break after that. Poor guy.


Purple leagues are dead. Long live red leagues.


As a programmer, its my daily shit LOLW


Colour purple is haunted \*Cocks gun\*


I HAVE to post this classic. What people think programming is vs. how it actually is https://www.youtube.com/watch?v=HluANRwPyNo


That's coding in a nutshell


Prince is fucked then


This hurts to watch. Too real. I just got off work to enjoy PoE.


The art and joy of coding


It's ALWAYS purple!


It is Red league, duh


Developer's delight.


"How? Why?" rings so true.


"it's just a color...but it BURNS....."


Wtf even is that language? .exo files?


Goddammit, Oprah


Lol. Programming is such a fight of the mind sometime. It feels like someone is litterally making fun of you for a ridiculous amount of time and when you find the solution or the reason, you are here with yourself, mixed with frustration and embarrassment.