Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "variable name"
-
This code review gave me eye cancer.
So, first of all, let me apologize to anyone impacted by eye cancer, if that really is a thing... because that sounds absolutely horrible. But, believe me, this code was absolutely horrible, too.
I was asked to code review another team's script. I don't like reviewing code from other teams, as I'm pretty "intense" and a nit-picker -- my own team knows and expects this, but I tend to really piss off other people who don't expect my level of input on "what I really think" about their code...
So, I get this script to review. It's over 200 lines of bash (so right away, it's fair game for a boilerplate "this should be re-written in python" or similar reply)... but I dive in to see what they sent.
My eyes.
My eyes.
MY EYES.
So, I certainly cannot violate IP rules and post any of the actual code here (be thankful - be very thankful), but let me just say, I think it may be the worst code I've ever seen. And I've been coding and code-reviewing for upwards of 30 years now. And I've seen a LOT of bad code...
I imagine the author of this script was a rebellious teenager who found the google shell scripting style guide and screamed "YOU'RE NOT MY REAL DAD!" at it and then set out to flagrantly violate every single rule and suggestion in the most dramatic ways possible.
Then they found every other style guide they could, and violated all THOSE rules, too. Just because they were there.
Within the same script... within the SAME CODE BLOCK... 2-space indentation... 4-space indentation... 8-space indentation... TAB indentation... and (just to be complete) NO indentation (entire blocks of code within another function of conditional block, all left-justified, no indentation at all).
lowercase variable/function names, UPPERCASE names, underscore_separated_names, CamelCase names, and every permutation of those as well.
Comments? Not a single one to be found, aside from a 4-line stanza at the top, containing a brief description of that the script did and (to their shame), the name of the author. There were, however, ENTIRE BLOCKS of code commented out.
[ In the examples below, I've replaced indentation spacing with '-', as I couldn't get devrant to format the indentation in a way to suitably share my pain otherwise... ]
Within just a few lines of one another, functions defined as...
function somefunction {
----stuff
}
Another_Function() {
------------stuff
}
There were conditionals blocks in various forms, indentation be damned...
if [ ... ]; then
--stuff
fi
if [ ... ]
--then
----some_stuff
fi
if [ ... ]
then
----something
something_else
--another_thing
fi
And brilliantly un-reachable code blocks, like:
if [ -z "$SOME_VAR" ]; then
--SOME_VAR="blah"
fi
if [ -z "$SOME_VAR" ]
----then
----SOME_VAR="foo"
fi
if [ -z "$SOME_VAR" ]
--then
--echo "SOME_VAR must be set"
fi
Do you remember the classic "demo" programs people used to distribute (like back in the 90s) -- where the program had no real purpose other than to demonstrate various graphics, just for the sake of demonstrating graphics techniques? Or some of those really bad photo slideshows, were the person making the slideshow used EVERY transition possible (slide, wipe, cross-fade, shapes, spins, on and on)? All just for the sake of "showing off" what they could do with the software? I honestly felt like I was looking at some kind of perverse shell-script demo, where the author was trying to use every possible style or obscure syntax possible, just to do it.
But this was PRODUCTION CODE.
There was absolutely no consistency, even within 1-2 adjacent lines. There is no way to maintain this. It's nearly impossible even understand what it's trying to do. It was just pure insanity. Lines and lines of insanity.
I picture the author of this code as some sort of hybrid hipster-artist-goth-mental-patient, chain-smoking clove cigarettes in their office, flinging their own poo at their monitor, frothing at the mouth and screaming "I CODE MY TRUTH! THIS CODE IS MY ART! IT WILL NOT CONFORM TO YOUR WORLDLY STANDARDS!"
I gave up after the first 100 lines.
Gave up.
I washed my eyes out with bleach.
Then I contacted my HR hotline to see if our medical insurance covers eye cancer.32 -
One of our web developers reported a bug with my image api that shrunk large images to a thumbnail size. Basically looked like this img = ResizeImage(largeImage, 50); // shrink the image by 50%
The 'bug' was when he was passed in the thumbnail image and requesting a 300% increase, and the image was too pixelated.
I tried to explain that if you need the larger image, use the image from disk (since the images were already sized optimally for display) and the api was just for resizing downward.
Thinking I was done, the next day I was called into a large conference room with the company vice-president, two of the web-dev managers, and several of the web developers.
VP: "I received an alarming email saying you refused to fix that bug in your code. Is that correct?"
Me: "Bug? No, there is no bug. The image api is executing just as it is supposed to."
MGR1: "Uh...no it isn't. Images using *your* code is pixelated and unfit for our site and our customers."
MGR2: "Yes, I looked at your code and don't understand what the big deal is. Looks like a simple fix."
<web developers nodding their heads>
Me: "OK, I'll bite. What is the simple fix?"
<MGR2 looks over at one of the devs>
Dev1: "Well, for example, if we request an image resize of 300, and the image is only 50x50, only increase the size by 10. Maybe 15."
Me: "Wow..OK. So what if the image is, for example, 640x480?"
MGR1: "75. Maybe 80 if it's a picture of boots."
VP: "Oh yes, boots. We need good pictures of boots."
Me: "I'm not exactly sure how to break this to you, but my code doesn't do 'maybe'. I mean, you have the image from disk.
You obviously used the api to create the thumbnail, but are trying to use the thumbnail to go back to the regular size. Why not use the original image?"
<Web-Dev managers look awkwardly towards the web devs>
Dev3: "Yea, well uh...um...that would require us to create a variable or something to store the original image. The place in the code where we need the regular image, it's easier to call your method."
Me: "Um, not really. You still have to resolve the product name from the URL path. Deriving the original file name is what you are doing already. Just do the same thing in your part of the code."
Dev2: "But we'd have to change our code"
Mgr2: "I know..I know. How about if we, for example, send you 12345.jpg and request a resize greater than 100, you go to disk and look for that image?"
<VP, mgrs, and devs nod happily>
Me: "Um, no that won't work. All I see is the image stream. I have no idea what file is and the api shouldn't be guessing, going to disk or anything like that."
Dev1: "What if we pass you the file name?"
<VP, mgrs, and devs nod happily again>
Me: "No, that would break the API contract and ...uh..wait...I'm familiar with your code. How about I make the change? I'm pretty sure I'll only have to change one method"
VP: "What! No...it’s gotta be more than that. Our site is huge."
<Mgrs and devs grumble and shift around in their chairs>
Me: "I'm done talking about this. I can change your code for you or you can do it. There is no bug and I'm not changing the api because you can't use it correctly."
Later I discovered they stopped using the resize api and wrote dynamic html to 'resize' the images on the client (download the 5+ meg images, and use the length and width properties)22 -
Being paid to rewrite someone else's bad code is no joke.
I'll give the dev this, the use of gen 1,2,3 Pokemon for variable names and class names in beyond fantastic in terms of memory and childhood nostalgia. It would be even more fantastic if he spelt the names correctly, or used it to make a Pokemon game and NOT A FUCKING ACCOUNTANCY PROGRAM.
There's no correspondence in name according to type, or even number. Dev has just gone batshit, left zero comments, and now somehow Ryhorn is shitting out error codes because of errors existing in Charmeleon's asshole.
The things I do for money...24 -
So... I just remembered a story that's perfect for devrant.
My brother got into engineering in university, and during the second semester they had their introductory class to programming. They had weekly homeworks that the lecturer would check and give grades accordingly.
The factors that could influence the grading were: execution (meaning that the code would excecute as intended), efficiency and readabilty. The weeks passed and everyone was doing well, getting fairly good grades. Everyone was happy.
Until one day a random guy we'll call bob got the worst grade possible. Bob wasn't a bad student. He had over-the-average grades in all the weekly homeworks and even impressed the professor in some. Naturally, he was baffled when he saw his grade on the google spreadsheet. He was pretty sure his code ran well. He always tested it on different machines and OSs. So, at the end of the class, he went straight to the helper of the class, in a pretty imperative manner, to demand to know how the fuck he got that grade. It's impossible he got excecution, efficiency and readabilty, wrong. All three wrong? Impossible. Even the stupidiest kid in the class had some points on readabilty.
"Oh, so you are Bob. Huh?" said the helper in a laid-back attitude. "Come with me. Prof. X is waiting for you in his office."
This got Bob even more confused. As they approached the office, the courage he had in a first moment banished and gave way for nervousness and fear.
The helper nocks the door. "Prof., Bobs here"
As soon as Bob sits in the chair in front of Prof. X's, he knew something bad was coming.
"In all these years of teaching..." said Prof. X hesitantly. "In all these years of teaching I have not come even close to see something similar to what you've done. You should be ashamed of yourself." Needless to say, Bob was panicked.
"In all these years I have not seen such blatant mockery!" added the professor. "HOW THE FUCK DID YOU EVEN DARE TO SEND A HOMEWORK WITH SUCH VARIABLE NAMING" That's when Bob realised the huge mistake he made. "NEVER IN ALL THESE YEARS I HAVE SEEN SOMEONE NAME HIS VARIABLES *opens the file on his desktop *: PENIS, SHIT, FUCKSHIT, GAYFUCKING<insert Prof. X's name>MAN, GOATSE, VAGINAVAR, CUMFUNCTION, [...]" The list of obcenities went on and on. In each word, the professor hit the table harder than the last time.
Turns out Bob felt so in comfort with the ease of the course he decided to spice things up by using "funny naming conventions" while coding, and then tidying everything up before uploading the homework. This week he forgot, and fucked it big time.
So remember folks, always check your code before committing/giving it in/production. And always adhere to naming conventions.9 -
It happened again.
This time my colleague, is abbreviating "cumulative" as "cum" in a variable name, and now I have to control my 6th grade humor...23 -
git status
git add .
git commit -m "Minor changes.."
git push
...
git status
*closes terminal*
...
"Fuck that char in that variable name isn't meant to be a capital!"
*makes change*
git status
git add .
git commit -m "Minor changes.."
git push
...
git status
*closes terminal*10 -
We have a new developer working in our office. He is fairly new, which is understandable, so he asks for help regularly(which I actually appreciate). This time however, he asked for help, and every step of the way argued it. He said he needed help making a small circle(it's just an indicator on a table).
I told him if there is a mat-icon it would be simple, but if not it would still be pretty simple with CSS. He argued that those two options seem messy. I pointed out they are extremely clean actually, and showed him how it was only about 4 lines of css. and 1 if there was a material icon. He agreed it was pretty easy, and then went with a complicated way to have green or red. I let him know that was really trivial, and even gave him the exact code he needed for it(at this point, he could have copy and pasted, adjusted the conditional to the name of his variable, and be done).
He proceeds to take 3 more days to complete this task, making a new component for a colored circle, using templates and nested css in the html, and hard coding the color as opposed to using the material colors we use site wide. All in all 100+ lines of code. And he felt my solution with fewer than 10 lines was messy.14 -
*Before learning to code*
Me: It's going to be easy. 😎
*After learning to code*
Me: Ahh,What should I name this variable.😟😟6 -
That moment when you've spent 3 hours debugging only to realise you weren't wrong. You were just debugging the wrong variable name...
I can stop questioning my life choices now.2 -
This is what I found in the logs:
3280546 I had a cup of tea and now it's fixed
9daaf6c copy and paste is not a design pattern
958ca5b It compiles! Ship it!
a9edf8d LAST time, Masahiro, /dev/urandom IS NOT a variable name generator...
438072f 640K ought to be enough for anybody
1fb839b Too lazy to write descriptive message
4d70890 ...
d6ce0c8 Ugh. Bad rebase.
a00b544 Programming the flux capacitor
49715cb Fix my stupidness
4babf07 Do things better, faster, stronger
49b3a7b SEXY RUSSIAN CODES WAITING FOR YOU TO CALL
12c7b55 formatted all
2658c87 and so the crazy refactoring process sees the sunlight after some months in the dark!
2376c89 - Temporary commit.
a83220a I honestly wish I could remember what was going on here...
3347007 work in progress
3382b4c well crap.
109748a Glue. Match sticks. Paper. Build script!
c3f025e Useful text
70394e7 Who knows WTF?!
0d78f14 breathe, =, breathe
5344e39 removed tests since i can't make them green
8a3a6bf better grepping
2777cc4 first blush
cf620ff Continued development...
9591c19 Too lazy to write descriptive message
767e0cd Some shit.
763602a Yes, I was being sarcastic.
8d7a602 /sigh
c6296e5 rats4 -
It's so hard to pick a good variable/class name, how the hell will I be able to pick a good name for my future kid?5
-
"You should name a variable using the same care with which you name a first-born child." - James O. Coplien9
-
Someone asked for an RSS feed for the security/privacy blog, I thought?
Well, hereby! There are three feeds:
https://much-security.nl/main.xml - a feed which is updated with both blog posts and external links relating to privacy/security I find interesting/useful.
https://much-security.nl/own.xml - a feed only containing the blogs posts themselves. For people who are only interested in that part.
https://much-security.nl/external.x... - a feed only containing external links. For people who'd like to stay updated on recent cyber security/privacy thingies.
Tracking: every time a feed is visited, a redis value for that feed get's incremented. No time, ip addresses, user agent or whatsoever is saved. Just one variable getting increased once.
New domain name will also be revealed soon (probs tomorrow, going to bed soon as I've just been sick) :D.
Oh and just a warning, the main/external feed are the only ones populated with exactly one item right now :P30 -
Coworker 1: Ugh, what name should I give this variable? Any idea?
Coworker 2: Doesn't matter that much. Just give it a name.
Coworker 1: ** Types in "albert" **6 -
note to self : don't be too humble.
Why?
I just got Roasted in front of Advanced Programming class by a person who got an A in previous class by 100% copying other's work and change all variable and function name to differ.10 -
I wonder how the secret service comes up with all these cool names for secret operations they do when i am sitting here thinking what to name one variable for last 30mins. I should probably hire someone from there as a variable namer dev..7
-
Guy I work with: Hey can I borrow you for a minute
Me: sure. What do you need?
Him: so this is a project me an the other dev worked on
Me thinking: Well I know he did it all and sent you the project so don't tell me you worked on it
Him: so we use it to do this and this and send an email to this new account I made because (2 minute explanation)
Me thinking: I don't care. Just tell me what your issue is! I already know what it is and does from what you told me the last time when you showed me. Which took an hour of my time.
Him: so he sent me this code which is called <Descriptive name> and in the method we have variables call <descriptive name> and it returns a <variable name>
Me thinking: You mother fucker! I don't give a shit what your method is named, what it the variable names are, and you don't need to read through every line of code to me! Just from the descriptive name you just said I know what it does! What the fuck is your issue!?
Him: we also have these other methods. This one is called <Descriptive name> which does...
Me: are you fucking seriously going to read me your code line by line and tell me what you named your variables AGAIN!?
Him: and we named this one <descriptive name>
Me: you mother fucker...
Him: and it calls this stored procedure. (Literally opens the stored procedure and shows me) and it is called...which has parameters called... And it is a select query that inserts
45 minutes later after he finishes explaining all 3 pages of his code and his 5 stored procedures that the other dev wrote...
Him: So anyway, back to this method. I need to know where to put this method. The other dev said to put it in this file, but where do you think I should put it in here? Should I place it after this last one or before it?
Me thinking: You fucking wasted my fucking time just to ask where to place your mother fucking method that the other dev sent to you in a project with only 3 files, all less than 500 lines of code with comments and regions that actually tell you what you should put there and 5 small stored procedures that were not even relevant to your issue! Why the fuck did you need to treat me as a rubber ducky which would fly away if you did have one because you didn't have an issue, you just didn't know where to put your fucking code! FUCK YOUR METHOD!
Me: Where ever you want
Him: Well I think it won't work if I placed it before this method.
I walked away after that. What a waste of time and an insult to my skills and really unchallenging. He's been coding for years and still can't understand anything code related. I'm tired if helping him. Every time he needs something he always has to read through and explain his shit just to ask me things like this. One time he asked me what to name his variable and another his project. More recently he asked why he couldn't get his project he found online to work. The error clearly stated he needed to use c# 7. His initial solution was to change his sql connection string. 😑
He should just go back to setting up computers and fixing printers. At least then he would never be in the office to bug me or the other dev with things like this.7 -
Just got picked up for a project. 20,000+ code base, no comments, no docs, variable names like x, xx, xxx, no function name conventions, and a mishmash of Czech, French and English class names.
I thought this job was too good to be true. #fml4 -
Proud dev moment : as I was following the variable naming conventions from my company, I got to name a variable "l_o_tr" 💪9
-
Been reviewing ALOT of client code and supplier’s lately. I just want to sit in the corner and cry.
Somewhere along the line the education system has failed a generation of software engineers.
I am an embedded c programmer, so I’m pretty low level but I have worked up and down and across the abstractions in the industry. The high level guys I think don’t make these same mistakes due to the stuff they learn in CS courses regarding OOD.. in reference how to properly architect software in a modular way.
I think it may be that too often the embedded software is written by EEs and not CEs, and due to their curriculum they lack good software architecture design.
Too often I will see huge functions with large blocks of copy pasted code with only difference being a variable name. All stuff that can be turned into tables and iterated thru so the function can be less than 20 lines long in the end which is like a 200% improvement when the function started out as 2000 lines because they decided to hard code everything and not let the code and processor do what it’s good at.
Arguments of performance are moot at this point, I’m well aware of constraints and this is not one of them that is affected.
The problem I have is the trying to take their code in and understand what’s its trying todo, and todo that you must scan up and down HUGE sections of the code, even 10k+ of line in one file because their design was not to even use multiple files!
Does their code function yes .. does it work? Yes.. the problem is readability, maintainability. Completely non existent.
I see it soo often I almost begin to second guess my self and think .. am I the crazy one here? No. And it’s not their fault, it’s the education system. They weren’t taught it so they think this is just what programmers do.. hugely mundane copy paste of words and change a little things here and there and done. NO actual software engineers architecture systems and write code in a way so they do it in the most laziest, way possible. Not how these folks do it.. it’s like all they know are if statements and switch statements and everything else is unneeded.. fuck structures and shit just hard code it all... explicitly write everything let’s not be smart about anything.
I know I’ve said it before but with covid and winning so much more buisness did to competition going under I never got around to doing my YouTube channel and web series of how I believe software should be taught across the board.. it’s more than just syntax it’s a way of thinking.. a specific way of architecting any software embedded or high level.
Anyway rant off had to get that off my chest, literally want to sit in the corner and cry this weekend at the horrible code I’m reviewing and it just constantly keeps happening. Over and over and over. The more people I bring on or acquire projects it’s like fuck me wtf is this shit!!! Take some pride in the code you write!16 -
When you spend 15 minutes writing the code, and 4 hours coming up with the perfect name for the class/method/variable5
-
A day of an iOS developer life:
1. XCode crashed
2. XCode freeze
3. XCode "Jump to Definition" takes me to a different file that has the exact same variable name instead of jumping to the top of the file
4. XCode Storyboard designer throwing 1000000000 as UIStackView width on a newly created UIView
5. Heart attack
6. Lots of depression
** Note:
just noticed devRant web has xcode as placeholder in the tags box lol devRant knows my pain T_T8 -
I was given a work to refactor one of my colleagues code and found that there was a variable named 'anal'. I was quite surprised seeing it as the colleague was a soft spoken and well behaved guy in office. After scratching my head for 15mins I came to know that he was storing analytics data in that variable. Hence the name! :-D8
-
Special Awards: In a previous life, I employed a South African gentleman by the name of Jack Howell. He had a thing about finding other South African ex-pats, and could often be heard asking people on the phone “Are you by any chance from South Africa?”.
Jack Howell would also do very stupid things. Like forget to come to work. When asked, he’d come up with random excuses - “It was my wife Gwyneth’s fault”, or “I was confused, I took wrong turnings”. Generally, he was a bit of a twat, and had a weird kind of smile he’d give you.
After he left the company, we came up with the idea of having an award for whoever acted the most like Jack Howell on a given day, or week. It was known as The Jack Howell Award. The award itself was whatever shitty thing we could find at the time - a construction made of folded paper and paper clips, or a weird 3 inch statue from a charity shop, or whatever really naff-beyond-belief item we could find at the time.
Where I work now, we have a shitty 12 inch statue of a woman with a dog that turned up in our office, courtesy of our Maintenance Manager. This is the new Jack Howell award. Currently awarded to a senior dev colleague who spent a day chasing a missing variable.3 -
Me : *wants to refactor a variable*
Visual Studio : Ok! Type the new name of the variable
Me : *backspace one time to remove a char*
VS : *erases ALL the name of the variable and ALL the usages of the variable, and no possibility to undo*
Me : ..... that was a dick move you know.9 -
The code is a freaking mess. Shared behavior, terrible variable/method naming, misleading module naming, dynamic polymorphic spaghetti, whitespace errors, no consistency, confusing even if you understand what the code is doing, ... . It should never have passed code review. It probably wasn't code reviewed.
The comments are sparse and useless. Quality level: // This is bridge.
The documentation does not exist.
Testing steps for QA are missing several steps, including setup, so actually using the feature is bloody challenging. If one thing is wrong, the feature just doesn't show up (and ofc won't tell you why).
The specs for the feature are outdated and cover only 4 of 19+ cases. And are neigh useless for those 4.
The specs for the report I'm fixing don't even check the data on the report; it just checks for one bit of data on each row it creates -- a name -- which is also the same on each row. gg.
The object factories (for specs) are a mess, and often create objects indirectly, or in backwards order with odd post-create overwriting to make things work. Following the factories is a major chore, let alone fixing or extending them.
The new type has practically zero test coverage.
The factory for the new type also only creates one variant -- and does so incorrectly.
And to top it all off: the guy who wrote the feature barely ever responds. If he does, he uses fewer words than my bird knows, then stops responding. I've yet to get a useful answer out of him. (and he apparently communicates just fine, according to my micromanager.)
But "it's just fixing a report; it'll be easy!"
Oh, fuck off.8 -
Stop using anal as a variable or function name wherever I look I see anal_this and anal_that please stop. Use analyze, analyzer or whatever and not anal_insert ( ) or anal_check ()13
-
I absolutely hate when people name local variables something like temp or tmp. I was working on a project with a guy who did this with almost every local variable and it was really confusing to have like 7 variables with the same name in the same class.
Please use informative names!7 -
This F***ing government college faculty crossed my complete answer of a F***ing bubble sort in 3rd year of Mathematics & Computing by saying and I quote, " Why is this i loop inside of j loop?" and after getting again on my feet after listening and understanding this absurd statement, I tried to explain to which he asked ne to show any book where it is written like this.
To i loop and j loop he meant the variable name in for loops, 🤬🤬🤬🤬
these f***ing reserved government professors in elite institutions like IITs15 -
Back in the day, I joined a little agency in Cape Town, small team small office with big projects, projects they weren’t really supposed to take on but hey when the owner of a tech business is not a tech person they do weird things.
A month had passed and it was all good, then came a project from Europe, Poland to be specific. The manager introduced me to the project, it was a big brand - a segment of Lego, built on Umbraco (they should change the name to slowbraco or uhmmm..braco somewhere there) the manager was like so this one is gonna be quite a challenge and I remember you said you are keen on that, I was like hell yeah bring it on (genuinely I got excited) now the challenge was not even about complexity of the problem or code or algorithms etc you get my point… the challenge was that the fucking site was in polish - face palm 1 - so I am like okay code is code, its just content, and I already speak/familiar with 13 human languages so I can’t fail here ill get around it somehow. So I spin up IIS, do the things and boom dev environment is ready for some kick ass McCoding. I start to run through the project to dig into the previous dev’s soul. I could not relate, I could not understand. I could not read, I could not, I could not. - face palm 2 - This dude straight up coded this project in polish variable names in polish, class names in polish, comments in freaking polish. Look, I have no beef with the initial guy, its his language so why not right? sure. But not hey this is my life and now I should learn polish, so screw it, new tab - google translate, new notes, I create a dictionary of variables and class etc 3 days go by and I am fucking polish bro. Come at me. I get to read the previous devs soul through his comments, what a cool dude, his code wasn’t shit either - huge relief. So I rock on and make the required changes and further functionality. The project manager is like really, you did it? I am like yeah dude, there it is. Then I realise I wasn’t the first on this, this dude done tried others and it didn’t go down well, they refused. - face palm 3 -
Anyway, now I am a rock star in the office, and to project managers this win means okay throw him in the deep - they move me to huge project that is already late of course and apparently since I am able to use google translate, I can now defeat time, let the travelling begin. - face palm 4 - I start on the project and they love me on it as they can see major progress however poland was knocking on the door again, they need a whole chunk of work done. I can’t leave the bigger project, so it was decided that the new guy on Monday will start his polish lessons - he has no idea, probably excited to start a new job, meanwhile a shit storm is being prepared for him.
Monday comes, hello x - meet the team, team meets x
Manager - please join our meeting.
I join the meeting, the manager tells me to assist the new dev to get set up.
Me: Sure, did you tell him about he site?
Manager: Yes, I told him you knocked it out the park and now we just need to keep going
Me: in my head (hmm… that’s not what I was asking but cool I guess he will see soon enough -internal face palm 5 - ) New dev is setup, he looks at the project, I am ask him if he is good after like an hour he is like yeah all good. But his face is pink so I figured, no brother man is not okay. But I let him be and give him space.
Lunch time comes, he heads out for lunch. 1hr 15mins later, project manager is like, is the new dude still at lunch.
We are all like yeah probably. 2hrs pass 3hrs pass Now we are like okay maybe something happened to him, hit by a car? Emergency? Something… So I am legit worried now, I ask the manager to maybe give him a ring. Manager tries to call. NOTHING, no response. nada.
Next day, 8am, 9am, 10am no sign of the dude. I go to the manager, ask him what’s up. Manager: he is okay. However he said he is not coming back.7 -
Found a "great" variable name while maintaining legacy code:
{
...
Report goodbye = Report::first($id);
goodbye->delete();
...
}
Goodbye report! 😂😂😂 -
God, I love when people name stuff right. Now I'm reading through an open source project, trying to find out how they solved a critical issue I'm facing now. It's not a small one but navigating through it is a breeze. Look through variable/function names and I don't even really need to read the code. Meanwhile, last assignment, there was "yangDataHandler" and "yangDataManager" that, obviously, had nothing to do with each other in either interoperability or functionality - and then half of the variables would get aliased to abbreviations. Uh, yes, sure it's obvious what
𝚋𝚣𝚋𝚠𝚒 variable means. Just let me run it through 𝚒𝚍𝚣𝚍() function.10 -
Well... I had in over 15 years of programming a lot of PHP / HTML projects where I asked myself: What psychopath could have written this?
(PHP haters: Just go trolling somewhere else...)
In my current project I've "inherited" a project which was running around ~ 15 years. Code Base looked solid to me... (Article system for ERP, huge company / branches system, lot of other modules for internal use... All in all: Not small.)
The original goal was to port to PHP 7 and to give it a fresh layout. Seemed doable...
The first days passed by - porting to an asset system, cleaning up the base system (login / logout / session & cookies... you know the drill).
And that was where it all went haywire.
I really have no clue how someone could have been so ignorant to not even think twice before setting cookies or doing other "header related" stuff without at least checking the result codes...
Basically the authentication / permission system was fully fucked up. It relied on redirecting the user via header modification to the login page with an error set in a GET variable...
Uh boy. That ain't funny.
Ported to session flash messages, checked if headers were sent, hard exit otherwise - redirect.
But then I got to the first layers of the whole "OOP class" related shit...
It's basically "whack a mole".
Whoever wrote this, was as dumb and as ignorant to build up a daisy chain of commands for fixing corner cases of corner cases of the regular command... If you don't understand what I mean, take the following example:
Permissions are based on group (accumulation of single permissions) and single permissions - to get all permissions from a user, you need to fetch both and build a unique array.
Well... The "names" for permissions are not unique. I'd never expected to be someone to be so stupid. Yes. You could have two permissions name "article_search" - while relying on uniqueness.
All in all all permissions are fetched once for lifetime of script and stored to a cache...
To fix this corner case… There is another function that fetches the results from the cache and returns simply "one" of the rights (getting permission array).
In case you need to get the ID of the other (yes... two identifiers used in the project for permissions - name and ID (auto increment key))...
Let's write another function on top of the function on top of the function.
My brain is seriously in deep fried mode.
Untangling this mess is basically like getting pumped up with pain killers and trying to solve logic riddles - it just doesn't work....
So... From redesigning and porting from PHP 7 I'm basically rewriting the whole base system to MVC, porting and touching every script, untangling this dumb shit of "functions" / "OOP" [or whatever you call this garbage] and then hoping everything works...
A huge thanks to AURA. http://auraphp.com/
It's incredibily useful in this case, as it has no dependencies and makes it very easy to get a solid ground without writing a whole framework by myself.
Amen.2 -
That's it, I'm done. My sincere condolences go to the poor soul that will have to maintain this complete and utter crap of code, as I have been doing the past 2 weeks.
3-4 big 4K+ lines files of completely unindented, practically undocumented, interspersed HTML, PHP, JavaScript and CSS! All in the same file.
All the function and variable names are complete nonsense. You might as well have smashed your head against the keyboard and let whatever came out be the names.
You took all the naming conventions that you could find and unleashed your seriously damaged imagination. lowerCamelCase, UpperCamelCase, snakecase, everything in the same fucking function name.
I really needed the money from this project. But I'm done. My mental sanity is more important that try to figure out how to make a decent and usable webpage of THIS COMPLETE DISASTER.
You, the one before me. If you wanted to make sure that no one else besides you could work with this crap, then congrats, YOU FUCKING DID IT WITH HONORS. FUCKING SUMMA CUM LAUDE. PhD and all.4 -
http://mindprod.com/jgloss/...
Skill in writing unmaintainable code
Chapter : The art of naming variables and methods
- Buy a copy of a baby naming book and you’ll never be at a loss for variable names. Fred is a wonderful name and easy to type. If you’re looking for easy-to-type variable names, try adsf or aoeu
- By misspelling in some function and variable names and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques.
- Use acronyms to keep the code terse. Real men never define acronyms; they understand them genetically.
- Randomly capitalize the first letter of a syllable in the middle of a word. For example: ComputeRasterHistoGram().
- Use accented characters on variable names.
- Randomly intersperse two languages (human or computer). If your boss insists you use his language, tell him you can organise your thoughts better in your own language, or, if that does not work, allege linguistic discrimination and threaten to sue your employers for a vast sum.
and many others :D -
I'm bored af so I'm creating a language based on images.
In one day I instantiated my first variable :D
Basically, the first pixel defines the action type (in this case, red = initialize variable), the second one defines the variable color (aka name), and the rest defines the value using grey scale (0-255, every r/g/b is a character).
I know this is soooooooo useless but I just want to do something particular.
*Epic music* this is the birth of JPxl *stop epic music*!9 -
Just why????
long d = date(toDate) - date(fromDate); // days
Please just name the variable days............2 -
Today I discovered what slowed my productivity the most: variable naming.
In a project I was naming many variables 'dirname' in different parts of the my code, but it represented 3 things: only the name of the directory, relative path + directory, and absolute path + directory.
I wasted to much time just figuring out which was which everytime until I finally decided to organize variables names better and see the wonders of the world. Result:
- dirname: only the name
- reldirname: relative path + dir
- absdirname: absolute path + dir
Such simple solution, yet took me years to actually see the benefits, my god
(First devRant post btw :3)7 -
personalproject C++ codebase:
- Clean code,
- 1 class per file,
- naming conventions
- comments .
- No more than 10 files per folder
Work C++ codebase:
- 22 classes per file.
- Classname not the same as file name
- weird variable names CmdStng
- All files in one source folder.
- Source control from 20 years ago
Me every time I cannot find anything I wondering why it is in a different file on line 3574 inside another class with an unrelated filename6 -
Why yes, it makes total sense for a variable called `$connectionString` to only accept either booleans or integers ... wat
Also beware the beauty on how well that names conveys the variable's intent.
FML3 -
I just wasted my 2 hours debugging the code with a misspelled variable name, "separate" instead of "seperate".
Fcuk !8 -
I was helping my girlfriend's sister on her programming homework yesterday. But the thing is that she missed a lot of classes to be with her boyfriend. So now she has a reasonably advanced task, without knowing the basics.
Her assignment was to open a file, extract it's text, and count how many times an user-given word appeared on it. So here's how it went:
- so you use the input function to ask the user to type the word.
- ok, but where do I type the word?
- in that black screen, on the bottom of visual code
~ changes name of the variable that receives the input()~
-like that?
- no, that is just the variable name. You should type in that black screen AT THE BOTTOM OF VISUAL CODE
- oh, ok.
~ changes name of .py file ~14 -
Syntax for my proposed "unsure" programming language.
Variable declaration:
let's just say that <variable name> = <value>
Function declaration:
hypothetically, we could <function name> (<args>){}
Try/ catch:
it's possible that
{
}
...or not (<ex>)
{
}3 -
Today on "How the Fuck is Python a Real Language?": Lambda functions and other dumb Python syntax.
Lambda functions are generally passed as callbacks, e.g. "myFunc(a, b, lambda c, d: c + d)". Note that the comma between c and d is somehow on a completely different level than the comma between a and b, even though they're both within the same brackets, because instead of using something like, say, universally agreed-upon grouping symbols to visually group the lambda function arguments together, Python groups them using a reserved keyword on one end, and two little dots on the other end. Like yeah, that's easy to notice among 10 other variable and argument names. But Python couldn't really do any better, because "myFunc(a, b, (c, d): c + d)" would be even less readable and prone to typos given how fucked up Python's use of brackets already is.
And while I'm on the topic of dumb Python syntax, let's look at the switch, um, match statements. For a long time, people behind Python argued that a bunch of elif statements with the same fucking conditions (e.g. x == 1, x == 2, x == 3, ...) are more readable than a standard switch statement, but then in Python 3.10 (released only 1 year ago), they finally came to their senses and added match and case keywords to implement pattern matching. Except they managed to fuck up yet again; instead of a normal "default:" statement, the default statement is denoted by "case _:". Because somehow, everywhere else in the code _ behaves as a normal variable name, but in match statement it instead means "ignore the value in this place". For example, "match myVar:" and "case [first, *rest]:" will behave exactly like "[first, *rest] = myVar" as long as myVar is a list with one or more elements, but "case [_, *rest]:" won't assign the first element from the list to anything, even though "[_, *rest] = myVar" will assign it to _. Because fuck consistency, that's why.
And why the fuck is there no fallthrough? Wouldn't it make perfect sense to write
case ('rgb', r, g, b):
case ('argb', _, r, g, b):
case ('rgba', r, g, b, _):
case ('bgr', b, g, r):
case ('abgr', _, b, g, r):
case ('bgra', b, g, r, _):
and then, you know, handle r, g, and b values in the same fucking block of code? Pretty sure that would be more readable than having to write "handeRGB(r, g, b)" 6 fucking times depending on the input format. Oh, and never mind that Python already has a "break" keyword.
Speaking of the "break" keyword, if you try to use it outside of a loop, you get an error "'break' outside loop". However, there's also the "continue" keyword, and if you try to use it outside of a loop, you get an error "'continue' not properly in loop". Why the fuck are there two completely different error messages for that? Does it mean there exists some weird improper syntax to use "continue" inside of a loop? Or is it just another inconsistent Python bullshit where until Python 3.8 you couldn't use "continue" inside the "finally:" block (but you could always use "break", even though it does essentially the same thing, just branching to a different point).19 -
When you're naming variables, it is not acceptable for them to be one character, especially when that character bares no relevance to the information it stores.
'f' is not a good variable name for an array of strings now, is it...9 -
So I just spent 3 hours trying to fix a bug in my game, only to realize the root of the issue was that I was using a variable name that I had already used somewhere else, and then deleting it and crashing. Ah computers...1
-
Ffs, I've finally finished a project where I worked with a guy who was the laziest coder I have ever worked with.
He didn't even try to come up with meaningful variable names😒.
Instead of naming a variable label1 (which is already kinda s***) he tried lbl1 but still made a typo so the actual name was ibl1.
AND HE LEFT IT LIKE THAT FOR THE REST OF THE PROGRAM!4 -
Have you ever been pair coding with someone who uses shotgun debugging? I am about to claw my eyes out! What is shotgun debugging you ask?
Code doesn't work... What do we do?
I start thinking about possible flow, how to go back to what works, where to insert debugging statements. My partner interrupts my thought and says - what if we change this variable name?
...uh what?
What if that fixes it
It won't!
Well how do you know if you don't try?
I change the variable name - of course nothing works and now I forgot the possible solution I was thinking about...
Starting over... I again start coming close to the idea... Interrupts me again. What if we comment out this random line?
Why what's your reasoning?
Answer: *Shrug* idk might work...
...rinse and repeat
WHAT IS WRONG WITH YOU???!
I literally started muting my computer sound so I can not hear him while I think and that helps tremendously. This is programming not magic, people!!! Stop throwing random "what if" suggestions!13 -
Worst documentation I've seen?
Our "Coding Standards" 20+ page document. The team who put it together got so detailed, there wasn't much 'wiggle room' for natural deviations in a developer's coding style. For example, a section devoted to no abbreviations. So if you had a variable 'invoiceId', they complained you violated 'standards', even though 'invoiceId' matched a field name in a database table. Using Dapper or another ORM that relied on the 1:1 name match? Nope, you were still forced to inject your own mappers so the code didn't violate standards.
As you can probably guess, such a long, detailed document would have contradictions. I pointed out one of the contradictions. Example:
Page 5: Section B, sub-section B-5, paragraph 3 : "To minimize network traffic, when querying the database, request all the data necessary for the application."
Page 8: Section K, sub-section K-2, paragraph 4 : "For maximum performance, when querying the database, request only the most minimum amount of data necessary for the application ."
In a review I pointed out this contradiction (there were several more)
Me: "If we satisfy A, one could say the code is in violation of B. Which is it?"
<Pointy-Hair-Boss throws his pencil on the table>
PHB: "WHAT IS YOUR PROBLEM WITH STANDARDS! It couldn't be more clear! We are a company of standards because without standards <blah blah..straw man argument..blah blah>"
<deciding not to die on that hill, I move on>
Me: "On page 12, paragraph 9 code is in violation if a method has more than 3 parameters. That seems a little restrictive given our interaction with 3rd party products."
PHB: "There you go again. As stated in the document, ALL code used by the company will comply to our standards. What part of 'ALL' do you not understand?"
Was he bluffing about requiring 3rd party vendors complying with our standards? Heck no. That's a story for another day.10 -
If you know you're writing code that other people will have to work off of and you refuse to comment, can you at least have descriptive variable names so I don't have to spend an hour trying to figure out wtf something is. One letter does not make a variable name.8
-
Developers who think using cryptic variable names (like acronyms) is better than long descriptive variable names.....but then feel the need to document/comment the variable name rather than just naming the variable properly in be first place.
// Current CGRect to draw into
let ccgrd = self.currentCGRect()
Instead of just
let currentRectForDrawing = self.currentCGRect()4 -
I don't want to sound ethnocentric but is anyone else annoyed by having to correct the spelling of variable, class, table name, and other code after it was built overseas? I'm in a third round of combing consecutively deeper into the code to ferret out these misspellings so they don't go into production. Is it too much to ask that the freelancer who says he speaks and writes native English not then turn that work over to a subcontractor who clearly does not?4
-
Go fuck yourself make.
Don't tell me you haven't got a build rule for a .hex file because I'm fucking looking at it. I added a single file name to a variable and now magically you can't find any of my fucking build rules.
NOT FUCKING HELPFUL MAKE.3 -
When you need to change a variable's value, but can't find the variable name since you're spelling it right.3
-
A rant on my feed reminded me of this
I once saw someone prefix his variables with the initials of his name. I was speechless.
Every goddamn variable in the entire project was named like that.6 -
Please and please, if you cannot take the time out to create new classes do not copy and paste another without editing it properly! I noticed you do a find and replace and then leave 50% of variable names un-edited because all errors are gone. I am begging you in the name of Zeus edit your shit!
Here is one dick head:1 -
this is my legacy code, it's stupid, Change my mind.
a large number of lecturer and friends are against my thought. personally, i think this kind of code is told to be an OOP yet this is against the OOP concept. why ? first you assign the field to be private, but you implement Getter and Setter method later on, this is the same if you assign the field to be public in the first place.
another minor thing; yes this is old me, i use Bahasa Indonesia as a variable name.31 -
These are the programmers who I had encountered and detest intensely:
1. Programmers who addicted to take other programmers' failure as an achievement.
2. Programmers who are overly arrogant. (Hey just because you know something , that don't make you a God)
3. Programmers who stealing my code without crediting me, and yet he got paid.
4. Programmers who discourage new developers.
5. Programmers who can't take criticism (Once I told a dev that his code is not clean as he decided to name the variable like __fuckingFuckingFuckningVar = "Fuck"; , he yelled at me that i am a MF. Which it's completely childish in my opinion, as a software engineer, I think programme a clean code for easy maintain and understandable for others, it is a responsibility.)
6. Programmers who compare me with others.
7. Programmers who are not friendly. (Don't be like Stackoverflow).13 -
Pythons tkinter library has a module called "N". Just N. That's it.
So whenever you type "N" and want to autocomplete some local variable or class name, the IDE will instead import that module!
Who the fuck thought N would be a good name??? Some people have some serious issues...9 -
I swear to God, Days i feel stupid i Look at my PM's code changes and laugh.
What kind of Fuck Tard creates an api call just to return JSON(true)
And to top it off I pulled the latest after his poisonous stench was added and gave me a broken build!
Serious! D ass clown put in a variable with the same name twice, does this buck not build before he commits?
Im starting to believe that this is a hidden camera show where they pulled a fucking mental patient out fking looney toon land and gave him a PM job in a tech company!5 -
> Am writing code
> Life is good
> Add debugger keyword
> Script pauses
> Type in var name... Undefined.
> ...What?
> Check out local scope. It's there. What the fuck?
> Add console.log(myVariable)
> Refresh
> Logs variable no problem. Cool.
> Type in my var name
> Undefined
FFFUUUUUUU-7 -
So I had this classmate of mine and we agreed to be partners in a project.
She told me she'll take care of the project and let me just do my other stuffs.
We had the highest grade for the project presentation and she boasted how she made that project of ours to the class.
Some students from other class wants to have a copy of our project as their reference (since our class is the first to present) but my partner declined to give them some. She said it was her who made the project from the scratch.
I had my friends from other class and I decided to help them. We had our overnight the next day searching for at least the concept of our project and guess what?
I stumbled upon a certain site and found the source code of our project. Her code and the code from the site are almost the same!
Think she just changed the variable name HAHAHAHA2 -
python machine learning tutorials:
- import preprocessed dataset in perfect format specially crafted to match the model instead of reading from file like an actual real life would work
- use images data for recurrent neural network and see no problem
- use Conv1D for 2d input data like images
- use two letter variable names that only tutorial creator knows what they mean.
- do 10 data transformation in 1 line with no explanation of what is going on
- just enter these magic words
- okey guys thanks for watching make sure to hit that subscribe button
ehh, the machine learning ecosystem is burning pile of shit let me give you some examples:
- thanks to years of object oriented programming research and most wonderful abstractions we have "loss.backward()" which have no apparent connection to model but it affects the model, good to know
- cannot install the python packages because python must be >= 3.9 and at the same time < 3.9
- runtime error with bullshit cryptic message
- python having no data types but pytorch forces you to specify float32
- lets throw away the module name of a function with these simple tricks:
"import torch.nn.functional as F"
"import torch_geometric.transforms as T"
- tensor.detach().cpu().numpy() ???
- class NeuralNetwork(torch.nn.Module):
def __init__(self):
super(NeuralNetwork, self).__init__() ????
- lets call a function that switches on the tracking of math operations on tensors "model.train()" instead of something more indicative of the function actual effect like "model.set_mode_to_train()"
- what the fuck is ".iloc" ?
- solving environment -/- brings back memories when you could make a breakfast while the computer was turning on
- hey lets choose the slowest, most sloppy and inconsistent language ever created for high performance computing task called "data sCieNcE". but.. but. you can use numpy! I DONT GIVE A SHIT about numpy why don't you motherfuckers create a language that is inherently performant instead of calling some convoluted c++ library that requires 10s of dependencies? Why don't you create a package management system that works without me having to try random bullshit for 3 hours???
- lets set as industry standard a jupyter notebook which is not git compatible and have either 2 second latency of tab completion, no tab completion, no documentation on hover or useless documentation on hover, no way to easily redo the changes, no autosave, no error highlighting and possibility to use variable defined in a cell below in the cell above it
- lets use inconsistent variable names like "read_csv" and "isfile"
- lets pass a boolean variable as a string "true"
- lets contribute to tech enabled authoritarianism and create a face recognition and object detection models that china uses to destroy uyghur minority
- lets create a license plate computer vision system that will help government surveillance everyone, guys what a great idea
I don't want to deal with this bullshit language, bullshit ecosystem and bullshit unethical tech anymore.11 -
Aren't you, software engineer, ashamed of being employed by Apple? How can you work for a company that lives and shit on the heads of millions of fellow developers like a giant tech leech?
Assuming you can find a sounding excuse for yourself, pretending its market's fault and not your shitty greed that lets you work for a company with incredibly malicious product, sales, marketing and support policies, how can you not feel your coders-pride being melted under BILLIONS of complains for whatever shitty product you have delivered for them?
Be it a web service that runs on 1980 servers with still the same stack (cough cough itunesconnect, membercenter, bug tracker, etc etc etc etc) incompatible with vast majority of modern browsers around (google at least sticks a "beta" close to it for a few years, it could work for a few decades for you);
be it your historical incapacity to build web UI;
be it the complete lack of any resemblance of valid documentation and lets not even mention manuals (oh you say that the "status" variable is "the status of the object"? no shit sherlock, thank you and no, a wwdc video is not a manual, i don't wanna hear 3 hours of bullshit to know that stupid workaround to a stupid uikit api you designed) for any API you have developed;
be it the predatory tactics on smaller companies (yeah its capitalism baby, whatever) and bending 90 degrees with giants like Amazon;
be it the closeness (christ, even your bugtracker is closed and we had to come up with openradar to share problems that you would anyway ignore for decades);
be it a desktop ui api that is so old and unmaintained and so shitty, but so shitty, that you made that cancer of electron a de facto standard for mainstream software on macos;
be it a IDE that i am disgusted to even name, xcrap, that has literally millions of complains for the same millions of issues you dont even care to answer to or even less try to justify;
be it that you dont disclose your long term plans and then pretend us to production-test and workaround-fix your shitty non-production ready useless new OS features;
be it that a nervous breakdown on a stupid little guy on the other side of the planet that happens to have paid to you dozens of thousands of euros (in mandatory licences and hardware) to actually let you take an indecent cut out of his revenues cos there is no other choice in a monopoly regime, matter zero to you;
Assuming all of these and much more:
How can you sleep at night with all the screams of the devs you are exploiting whispering in you mind? Are all the money your earn worth?
** As someone already told you elsewhere, HAVE SOME FUCKING PRIDE, shitty people AND WRITE THE FUCKING DOCS AND FIX THE FUCKING BUGS you lazy motherfuckers, your are paid more than 99.99% of people on earth, move your fucking greasy little fingers on that fucking keyboard. **
PT2: why the fuck did you remove the ESC key from your shitty keyboards you fuckshits? is it cos autocomplete is slower than me searching the correct name of a function on stackoverflow and hence ESC key is useless? at least your hardware colleagues had the decency of admitting their error and rolling back some of the uncountable "questionable "hardware design choices (cough cough ...magic mouse... cough golden charging cables not compatible with your own devices.. cough )?12 -
This Safari Bug is sooo bad, really hard to find it. (It initializes new variables with the element where id and variable name is the same, why?)10
-
I'm in the 7th circle of hell. Building out an authentication system using a 3rd party vendor into our company's application.
Developing in PHP, running inside a docker container, using a Windows PC. Absolutely everything has gone wrong that could go wrong but PHPCS whining about a missing space between the "!" and variable name was the last straw.2 -
So about two months ago in my consulting firm I was asked to replace a colleague on a project (node and Angular). The project is only a few months old but it’s already a total clusterfuck. DB is very poorly designed. It’s supposed to be a relational database but there’s not a trace of a foreign key or any key for that matter and I’ve seen joins like tableA.name = tableB.description (seriously, that’s your relation??). The code is a mess with entire blocks of code copied from another project and many parts of the code aren’t even used. He didn’t even bother renaming variables so they would make sense in the context they were shamelessly thrown into. The code is at best poorly typed if not typed at all.
During our dailies I sometimes express my frustration with my other colleagues as I very politely allude to my predecessor’s code as being hard to work with. (They are all “good friends" with him). I always get the same response from my colleagues: "yeah but you’ve gotta understand Billybob was under a lot of pressure. The user stories were not well defined. He didn’t have time to do a proper job". That type of response just makes me boil inside.
Because you think I have time to deal with this shit? You don’t think I’m working with the same client and his user stories that are barely intelligible? How long does it take to write type definitions for parameters going into a function? That’s right, 30 seconds at most? Maybe a minute if it’s a more elaborate object? How much time do you think you’ll save yourself with a properly typed function or better yet an interface? Hard to tell but certainly A LOT MORE than those 30 seconds you lost (no, the 30 seconds you INVESTED) in writing that interface!!!
FUCK people with their excuses! Never tell me you don’t have time to do a proper job! You’ve wasted HOURS of my time just because you were too fucking lazy to type your functions, too lazy to put just a little more thought into designing your tables, too lazy to rename a variable so that it’s name actually makes sense where it’s being used. It’s not because you were short on time. You’re just lazy!
FUCK!!!!!!3 -
When you debug a piece of code for a good half an hour and then realise you forgot to change the name of some variable when copying code from earlier bits.3
-
Unsure , if I should name my variable name as 'info' or 'infoFromDbAboutUser_RequiredForSessionValidation' for a method named 'functionToValidateUserAndCheckSessionIdOrAssignSessionIdIfNotAssigned'
Please help, I am unable to decide. :/10 -
For a long time I was of the opinion that pointer variables in C/C++ should have the asterisk immediately after the type name (e.g. int* foo).
Eventually I became convinced that it makes more sense to have it before the variable (e.g. int *foo).
Now I find routines that return pointers look weird, e.g.: void *allocate_something() so I am considering adopting the original style I used.
The only advantage of having the asterisk before the variable name I am aware of is that it is easier to remember to add an asterisk if you define more than one pointer on that line.
Anyone else find it hard to settle on code style guidelines for their own personal projects?12 -
First-time goona work on frontend(my worst nightmare).
That too Angular.
That too on a file containing 900 LOC.
That too with no proper naming, variable names x,e, obj.
That too with no comment.
Cant take help as I am the lead(name-sake, small team, I have 6month more experience than others)
I have 2 days(thank god for the weekends).
Fuck...Fuck...I missed writing CLI apps.7 -
Saw a counting variable in code. It was a necessary counting variable, so that is not what this is about.
However, this is a US based company that has a somewhat PC (no cursing) and professional cultural facade.
This variable was called "cnt". How the hell did that one not get caught in peer review? I have gotten dinged for having "possibly offensive" variable names (think Point5Hit though I have never written that as a variable name). It was funny. But I have changed it because that's just lazy.9 -
Oh my god, GDScript is the single biggest piece of shit scripting language I have ever witnessed. It somehow manages to combine the very worst things of dynamic typing with the downsides of static typing, all in one bundle of utter shit
Imagine you have two game object scripts that want to reference each other, e.g. by calling each others methods.
Well you're outta fucking luck because scripts CANNOT have cyclic references. Not even fucking *type hints* can be cyclic between scripts. Okay no problem, since GDScript is loosely based of Python I can surely just call my method out of the blue without type hints and have it look it up by name. Nope! Not even with the inefficient as fuck `call` method that does a completely dynamic-at-runtime fuck-compile-time-we-script-in-this-bitch function call can find the function. Why? Because the variable that holds a reference to my other script is assumed to be of type Node. The very base class of everything
So not only is the optional typing colossal garbage. You cant even do a fucking dynamic function call because this piece of shit is just C++ in Pyhtons clothing. And nothing against C++ (first time I said that). At least c++ lets me call a fucking function8 -
I have a local variable that is completely unused, can be of any name or type as long as it's assigned.
Yet, if I delete it the program no longer works.
Huh?8 -
Never call a variable 'r' while debugging in python console.
I was trying to fix my code but for some reason the program didn't follow the code flow. I hate it when it happens because you can't pinpoint the source of the problem. I restarted the kernel, nothing, then I rebooted the IDE, nothing. The code behaved weirdly, the only thing I was doing was assigning a value to a temp variable called 'r' and then displaying it. The console kept telling me "--Return--", I didn't understand... Why, my old friend, are you telling me you're returning? Then I changed the variable name to old 'tmp' and it all worked. I finally realized that 'r' is a pdb command... I was angry at the console for obeying my own order... I'm sorry console1 -
Has anyone tried Fetlang? Very interesting syntax and pretty funny :)
https://github.com/Property404/...
Code:
(This program lists all arguments passed to the executable)
(Variables:
Amy - iterator through argv
Betty - Temporary variable to record each argument
Carrie - '\0'
Saint Andrew's Cross - Fetlang's argv wrapper
)
Make Betty moan
Worship Carrie's feet
Bind Amy to Saint Andrew's Cross
Have Amy hogtie Betty
If Amy is Carrie's bitch
Make Slave scream Betty's name
Make Betty moan2 -
I really hate PHP frameworks.
I also often write my own frameworks but propriety. I have two decades experience doing without frameworks, writing frameworks and using frameworks.
Virtually every PHP framework I've ever used has causes more headaches than if I had simply written the code.
Let me give you an example. I want a tinyint in my database.
> Unknown column type "tinyint" requested.
Oh, doctrine doesn't support it and wont fix. Doctrine is a library that takes a perfectly good feature rich powerful enough database system and nerfs it to the capabilities of mysql 1.0.0 for portability and because the devs don't actually have the time to create a full ORM library. Sadly it's also the defacto for certain filthy disgusting frameworks whose name I shan't speak.
So I add my own type class. Annoying but what can you do.
I have to try to use it and to do so I have to register it in two places like this (pseudo)...
Types::add(Tinyint::class);
Doctrine::add(Tinyint::class);
Seems simply enough so I run it and see...
> Type tinyint already exists.
So I assume it's doing some magic loading it based on the directory and commend out the Type::add line to see.
> Type to be overwritten tinyint does not exist.
Are you fucking kidding me?
At this point I figure out it must be running twice. It's booting twice. Do I get a stack trace by default from a CLI command? Of course not because who would ever need that?
I take a quick look at parent::boot(). HttpKernel is the standard for Cli Commands?
I notice it has state, uses a protected booted property but I'm curious why it tries to boot so many times. I assume it's user error.
After some fiddling around I get a stack trace but only one boot. How is it possible?
It's not user error, the program flow of the framework is just sub par and it just calls boot all over the place.
I use the state variable and I have to do it in a weird way...
> $booted = $this->booted;parent::boot();if (!$booted) {doStuffOnceThatDependsOnParentBootage();}
A bit awkward but not life and death. I could probably just return but believe or not the parent is doing some crap if already booted. A common ugly practice but one that works is to usually call doSomething and have something only work around the state.
The thing is, doctrine does use TINYINT for bool and it gets all super confused now running commands like updates. It keeps trying to push changes when nothing changed. I'm building my own schema differential system for another project and it doesn't have these problems out of the box. It's not clever enough to handle ambiguous reverse mappings when single types are defined and it should be possible to match the right one or heck both are fine in this case. I'd expect ambiguity to be a problem with reverse engineer, not compare schema to an exact schema.
This is numpty country. Changing TINYINT UNSIGNED to TINYINT UNSIGNED. IT can't even compare two before and after strings.
There's a few other boots I could use but who cares. The internet seems to want to use that boot function. There's also init stages missing. Believe it or not there's a shutdown and reboot for the kernel. It might not be obvious but the Type::add line wants to go not in the boot method but in the top level scope along with the class definition. The top level scope is run only once.
I think people using OOP frameworks forget that there's a scope outside of the object in PHP. It's not ideal but does the trick given the functionality is confined to static only. The register command appears to have it's own check and noop or simply overwrite if the command is issued twice making things more confusing as it was working with register type before to merely alias a type to an existing type so that it could detect it from SQL when reverse engineering.
I start to wonder if I should just use columnDefinition.
It's this. Constantly on a daily basis using these pretentious stuck up frameworks and libraries.
It's not just the palava which in this case is relatively mild compared to some of the headaches that arise. It's that if you use a framework you expect basic things out of the box like oh I don't know support for the byte/char/tinyint/int8 type and a differential command that's able to compare two strings to see if they're different.
Some people might say you're using it wrong. There is such a thing as a learning curve and this one goes down, learning all the things it can't do. It's cripplesauce.12 -
Just spent 20 minutes figuring out why my .filter() wasn't working. I thought I was going crazy or the universe had shifted around me.
Nope, I was just using class as the variable name.
How's your Monday going?5 -
Just use proper variable name and class architecture and header file and viola you don't need documentation.
In the worst case to understand class heirchy use the graphviz of doxygen and you are done.7 -
NullPointerException: Object reference not set to an instance of an object.....ummm what was null?
How much longer must we wait for a language that tells you the variable name that was null?2 -
The hardest decision right after "how to name this variable?":
Where to put free lines?
(Should there be one after the colon!?)7 -
I need some opinions on Rx and MVVM. Its being done in iOS, but I think its fairly general programming question.
The small team I joined is using Rx (I've never used it before) and I'm trying to learn and catch up to them. Looking at the code, I think there are thousands of lines of over-engineered code that could be done so much simpler. From a non Rx point of view, I think we are following some bad practises, from an Rx point of view the guys are saying this is what Rx needs to be. I'm trying to discuss this with them, but they are shooting me down saying I just don't know enough about Rx. Maybe thats true, maybe I just don't get it, but they aren't exactly explaining it, just telling me i'm wrong and they are right. I need another set of eyes on this to see if it is just me.
One of the main points is that there are many places where network errors shouldn't complete the observable (i.e. can't call onError), I understand this concept. I read a response from the RxSwift maintainers that said the way to handle this was to wrap your response type in a class with a generic type (e.g. Result<T>) that contained a property to denote a success or error and maybe an error message. This way errors (such as incorrect password) won't cause it to complete, everything goes through onNext and users can retry / go again, makes sense.
The guys are saying that this breaks Rx principals and MVVM. Instead we need separate observables for every type of response. So we have viewModels that contain:
- isSuccessObservable
- isErrorObservable
- isLoadingObservable
- isRefreshingObservable
- etc. (some have close to 10 different observables)
To me this is overkill to have so many streams all frequently only ever delivering 1 or none messages. I would have aimed for 1 observable, that returns an object holding properties for each of these things, and sending several messages. Is that not what streams are suppose to do? Then the local code can use filters as part of the subscriptions. The major benefit of having 1 is that it becomes easier to make it generic and abstract away, which brings us to point 2.
Currently, due to each viewModel having different numbers of observables and methods of different names (but effectively doing the same thing) the guys create a new custom protocol (equivalent of a java interface) for each viewModel with its N observables. The viewModel creates local variables of PublishSubject, BehavorSubject, Driver etc. Then it implements the procotol / interface and casts all the local's back as observables. e.g.
protocol CarViewModelType {
isSuccessObservable: Observable<Car>
isErrorObservable: Observable<String>
isLoadingObservable: Observable<Void>
}
class CarViewModel {
isSuccessSubject: PublishSubject<Car>
isErrorSubject: PublishSubject<String>
isLoadingSubject: PublishSubject<Void>
// other stuff
}
extension CarViewModel: CarViewModelType {
isSuccessObservable {
return isSuccessSubject.asObservable()
}
isErrorObservable {
return isSuccessSubject.asObservable()
}
isLoadingObservable {
return isSuccessSubject.asObservable()
}
}
This has to be created by hand, for every viewModel, of which there is one for every screen and there is 40+ screens. This same structure is copy / pasted into every viewModel. As mentioned above I would like to make this all generic. Have a generic protocol for all viewModels to define 1 Observable, 1 local variable of generic type and handle the cast back automatically. The method to trigger all the business logic could also have its name standardised ("load", "fetch", "processData" etc.). Maybe we could also figure out a few other bits too. This would remove a lot of code, as well as making the code more readable (less messy), and make unit testing much easier. While it could never do everything automatically we could test the basic responses of each viewModel and have at least some testing done by default and not have everything be very boilerplate-y and copy / paste nature.
The guys think that subscribing to isSuccess and / or isError is perfect Rx + MVVM. But for some reason subscribing to status.filter(success) or status.filter(!success) is a sin of unimaginable proportions. Also the idea of multiple buttons and events all "reacting" to the same method named e.g. "load", is bad Rx (why if they all need to do the same thing?)
My thoughts on this are:
- To me its indentical in meaning and architecture, one way is just significantly less code.
- Lets say I agree its not textbook, is it not worth bending the rules to reduce code.
- We are already breaking the rules of MVVM to introduce coordinators (which I hate, as they are adding even more unnecessary code), so why is breaking it to reduce code such a no no.
Any thoughts on the above? Am I way off the mark or is this classic Rx?16 -
I need guidance about my current situation.
I am perfectionist believing in OOP, preventing memory leak in advance, following clean code, best practices, constantly learning about new libraries to reduce custom implementation & improve efficiency.
So even a single bad variable name can trigger my nerves.
I am currently working in a half billion $ IT service company on a maintenance project of 8 year old Android app of security domain product of 1 of the top enterprise company of the world, which sold it to the many leading companies in the world in Govt service, banking, insurance sectors.
It's code quality is such a bad that I get panic attacks & nightmares daily.
Issues are like
- No apk obfuscation, source's everything is openbook, anybody can just unzip apk & open it in Android Studio to see the source.
- logs everywhere about method name invoked,
- static IV & salt for encryption.
- thousands of line code in God classes.
- Irrelevant method names compared to it's functionality.
- Even single item having list takes 2-3 seconds to load
- Lag in navigation between different features' screens.
- For even single thing like different dimension values for different density whole 100+ lines separate layout files for 6 types of densities are written.
- No modularized packages, every class is in single package & there are around 100+ classes.
Owner of the code, my team lead, is too terrified to change even single thing as he don't have coding maturity & no understanding of memory leak, clean code, OOP, in short typical IT 'service' company mentality.
Client is ill-informed or cost-cutting centric so no code review done by them in 8 years.
Feeling much frustrated as I can see it's like a bomb is waiting to blast anytime when some blackhat cracker will take advantage of this.
Need suggestions about this to tackle the situation.10 -
When my teacher says that you have to produce variable lists for each variable in your program, stating the name, type and what they're used for, if you're coding in Java, you know you're fucked with 16 classes of swing GUI...1
-
When you spent two hours of debugging because that one variable somehow has the value of NULL which can't be because it is initialized with another value and you realized you mistyped the name on one of your procedures, so VBA automatically instantiates a new variable and initializes it
-
Any other language: Hey fuckface, you can't name this variable by a single letter, tf is wrong with you? use some descriptive shit.
Golang: lmao fuck u
I really find it interesting how we use short variable names for items in golang. Kinda makes sense when you think of it. Most of these items come up in short methods for which the mental model lets you know and remember what you are doing, they even make sense when going through the std lib in which that shit is all over the place. YET years of going by other languages has made me squint my eyes a bit in frustration every time I see it.
Say for example that a function is implementing io.Writer. What would you call the method parameter? you could argue that writer would be sensible since it has it in the signature, but what about when the io.Writer in itself is a file or a socket or whatever? writer would be funny or strange? nah fuck it just w, it makes sense, but x wouldn't. I find these points to make sense even if i don't like them.
Would, now, this practice be acceptable in C? you are supposed to write the same modular code with C in which you compose large functionality in separated units of code, yet I am sure this practice of single name variables is something that C engineers dislike greatly.
Are go devs just doing this out of blind love for their preference in languages? and how would this work if mfkers add generics to go(I hope not, Go is simple enough to understand in order to extend functionality through the empty interface, but that is a preference of mine as well)
The more I use Go the more I like it to be honest, I think the code looks ugly syntactically, but that is subjective as all hell and based on my constant preference for a language to look like Ruby, which even though it might not be everyone's cup of tea it remains to my eyes as the most beautiful language in existence, again, an obvious personal preference.18 -
Why why why the fuck would you assign the same variable name at the start of a function to completely different data? These aren't params, but variables being assigned different things, no comments, no documentation, crucial in the operation, but assigned wildly different values with different behaviors through the code.
-
Got commissioned to write a simple js function. Drafted in python. Changed up some variable names while translating, but forgot to change one, and changed another to the old name... Spent a week trying to find the bug in a 30 line piece of js that worked perfectly in python. FML1
-
Why some single letter variable names looks ugly to me, for example: c, i and j (and even k) are the most used (mostly in for loops) but does not look ugly.. why?
Ugly
for (int a = 0; a < 10; ++a)
Not ugly
for (int i = 0; i < 10; ++i)24 -
It would have to be variable names for classes. I mainly use C#, but I'm sure this applies to other languages. You need a name for the instance variables, the parameters for the constructor, and properties.
-
When me and my friends were working on a school project where we have to do a C++ bus reservation system (that will accept reservation and name of the person who reserved the seat / that will show a list of reserved persons / that will show a graphic design of a bus with seats that will be changed in design if reserved.). At first I can't comprehend the problem and develop a solution, but when my friend told me that "let's think that the value is a poop and the toilet is the variable, when we flush it, it will be sent to the sea/ocean/river and it will serve as a new element in the array" that is when I knew how I will do the damn project, then we passed it the night when the project was given, and we got recognition from our professor.
*my friend is already feeling the call of nature*
++ for my friend2 -
Started working as a "working student" in an it company to write unit tests. (which then will be executed automatically - so automated unit tests)
Realised that I write more or less the same code just changing the names and some parameters (sometimes more if it's not an number but a bool for example but it's pretty much the same scheme)
So I bought a tool for 1$ to use "auto complete" on custom templates.(I type testgetbool and the tool replaces this to the test case only asking for the variable name.)
So now I'm writing automated automated tests 😁😅
(which is btw pretty boring but cost & time effective)2 -
Being victim of an arbitrary worplace's culture on dev experience and documentation makes me a very frustrated dev.
Often I do want to document, and by that, I don't mean laying an inline comment that is exactly the function's name, I mean going full technical writer on steroids. I can and WILL get very verbose, yes, explaining every single way you can use a service - no matter how self explanatory the code might look.
I know developers (and me included) can, and sometimes will, write the best variable and function names at the time, wondering if they reached the peak of clean, DRY code that would make Robert Martin have a seizure and piss himself, only to find weeks later after working on something else that their work is unreadable. Of course.
I know the doc's public, it's me, and I've done this.
But then again explain for the people in the back how the FUUUUCK are we meant to suggest improvements, when we are not the ones who are prioritising features and shit WITH the business?
Just email me when the fucking team recycles, and no new team member knows how to even setup the IDEs because this huge piece of monumental shit called CompanyTM is also run by VPN. Fuck, no one wants to access that garbage, you have no docs.
I once tried setting up a culture for documentation. I did an herculean amount of work studying what solutions were internally homologated, how steep the learning curve would be from what we had at the moment (NOTHING, WE HAD FUCKING NOTHING, jesus christ, I even interviewed SEVENTEEN other squads to PROVE they FUCKING NEED
DOCS
TO WORK
You know what happened to that effort?
It had a few "clap" reactions on a Teams meeting and it never reached the kanban.
It didn't even made it to backlog.
I honestly hope that, someday, an alien fenomenon affects the whole company, making their memories completely reset, only to have the first one - after the whole public ordeal on why our brains became milkshake -, to say: "oh, boy, I wish we had documented this".
Then I will bring them to the back and shoot them. -
C++ Really confuses me... I mean why when defining an array variable is the array notation on the variable name rather than the variable type?1
-
We're talking about coding standards and someone on our team wants us to avoid the protected keyword because it allows for variable shadowing.
The lead architect wants to avoid levels of inheritance whenever possible; trying to keep only Interfaces and Implementations (and he names all of the Implementations with the same class name plus "Impl").6 -
The fact that you have to write "__" at the start of a variable name of a class to make it private (IntelliSense is not able to parse that. So you just "cannot see" that thing, but you can use ist) tells you everything about a language that you need to know...
-
can we agree that T is a dumb variable name?
I mean I totally know what it means in that instance, but why do people keep writing math stuff like they'd skribble it on paper?8 -
Developing a chrome extension during the last days. Got up today worked on it and got stuck 2 hours because of a variable being affected to another instead of having that variable as a name.
var myvar= othervar
Instead of
var myvar = "othervar"
Thanks code 😓 -
Anybody else really dislike jQuery coding standards? Like who decided $ was a nice & informative variable name?2
-
When you spend 3h trying to fix a procedure on MySQL and the problem was a f***** variable name. I felt so bad and sad :'(1
-
So I found a variable in some leagcy code with the name "abcdefghij".
I mean wtf, I could've understood qwerty or something, but, abcdefghij, real creative...😤 -
I wasn't happy with one of our UI views for editing a database query that consisted of about 50 fields ("editing" being the operative term here, not just viewing. It had to be two-way). Everything was hardcoded and defined manually, with each block of ~10 lines being repeated and mostly identical apart from the occasional double inline field and name of the variable. It had "just ended up that way" over time due to the variable names in the UI being different than the names of the variables that came from the API.
I decided to overhaul it all where I defined the different input components and which fields should be included, then made a function which would generate the page based on these definitions. It was about 500 lines of modularized functions and classes where the class for the actual view was about 50 lines- compared to the 1400+ lines of the previous version.
But, it didn't work. It should, but it "just didn't". There was no error. All I got was a blank, solid white page. I could make a drastic change or try something completely different and I would get the same error, same blank page. API fetch succeeded, value assignments succeeded, the object exists, but if you iterated it it was... empty.
I started getting really discouraged that I had made it too abstract. Maybe I actually made it more complex and unreadable than before. Maybe just hardcoding it all was the better solution after all. Maybe I had gone against KISS and overdesigned it.
I was up pretty late and everyone had gone home. When the last guy left there was that mood where "yeah if I can't make this work we'll just use the current version...".
Turns out I had tried iterating over a property of the set of fields to render, rather than the entire collection. In the old method the variables were a member of an object, but now they were its own object, a change I had made to isolate the set of values which were to be viewed/edited and make them easier to pass back and forth. This member existed since I hadn't cleaned it out yet, but it was empty.
I had been banging my head against this for a whole day and I was ready to admit I had made a mistake and wasted my time before discarding it all, but then I backspaced this one property and the interface went from empty to rendering perfectly and with all functionality intact. I swear god rays were coming out of my screen. -
How to deal with "Code Nazis" ?
Don't know how you call this guys that see each and every PR as a possibility to annoy everyone else
Team of 4 Devs, all with lots of experience
But there is a special one, that spams each PR with an incredible amount of comments
Most of them are non-sense like "formatting of comments" or "inlining things makes everything unreadable" or "call this variable this and that" although a reasonable name was their
Rest of team including myself is pretty pissed of by him
How to get over that?5 -
YGGG IM SO CLOSE I CAN ALMOST TASTE IT.
Register allocation pretty much done: you can still juggle registers manually if you want, but you don't have to -- declaring a variable and using it as operand instead of a register is implicitly telling the compiler to handle it for you.
Whats more, spilling to stack is done automatically, keeping track of whether a value is or isnt required so its only done when absolutely necessary. And variables are handled differently depending on wheter they are input, output, or both, so we can eliminate making redundant copies in some cases.
Its a thing of beauty, defenestrating the difficult aspects of assembly, while still writting pure assembly... well, for the most part. There's some C-like sugar that's just too convenient for me not to include.
(x,y)=*F arg0,argN. This piece of shit is the distillation of my very profound meditations on fuckerous thoughtlessness, so let me break it down:
- (x,y)=; fuck you in the ass I can return as many values as I want. You dont need the parens if theres only a single return.
- *F args; some may have thought I was dereferencing a pointer but Im calling F and passing it arguments; the asterisk indicates I want to jump to a symbol rather than read its address or the value stored at it.
To the virtual machine, this is three instructions:
- bind x,y; overwrite these values with Fs output.
- pass arg0,argN; setup the damn parameters.
- call F; you know this one, so perform the deed.
Everything else is generated; these are macro-instructions with some logic attached to them, and theres a step in the compilation dedicated to walking the stupid program for the seventh fucking time that handles the expansion and optimization.
So whats left? Ah shit, classes. Disinfect and open wide mother fucker we're doing OOP without a condom.
Now, obviously, we have to sanitize a lot of what OOP stands for. In general, you can consider every textbook shit, so much so that wiping your ass with their pages would defeat the point of wiping your ass.
Lets say, for simplicity, that every program is a data transform (see: computation) broken down into a multitude of classes that represent the layout and quantity of memory required at different steps, plus the operations performed on said memory.
That is most if not all of the paradigm's merit right there. Everything else that I thought to have found use for was in the end nothing but deranged ways of deriving one thing from another. Telling you I want the size of this worth of space is such an act, and is indeed useful; telling you I want to utilize this as base for that when this itself cannot be directly used is theoretically a poorly worded and overly verbose bitch slap.
Plainly, fucktoys and abstract classes are a mistake, autocorrect these fucking misspelled testicle sax.
None of the remaining deeper lore, or rather sleazy fanfiction, that forms the larger cannon of object oriented as taught by my colleagues makes sufficient sense at this level for me to even consider dumping a steaming fat shit down it's execrable throat, and so I will spare you bearing witness to the inevitable forced coprophagia.
This is what we're left with: structures and procedures. Easy as gobblin pie.
Any F taking pointer-to-struc as it's first argument that is declared within the same namespace can be fetched by an instance of the structure in question. The sugar: x ->* F arg0,argN
Where ->* stands for failed abortion. No, the arrow by itself means fetch me a symbol; the asterisk wants to jump there. So fetch and do. We make it work for all symbols just to be dicks about it.
Anyway, invoking anything like this passes the caller to the callee. If you use the name of the struc rather than a pointer, you get it as a string. Because fuck you, I like Perl.
What else is there to discuss? My mind seems blank, but it is truly blank.
Allocating multitudes of structures, with same or different types, should be done in one go whenever possible. I know I want to do this, and I know whichever way we settle for has to be intuitive, else this entire project has failed.
So my version of new always takes an argument, dont you just love slurping diarrhea. If zero it means call malloc for this one, else it's an address where this instance is to be stored.
What's the big idea? Only the topmost instance in any given hierarchy will trigger an allocation. My compiler could easily perform this analysis because I am unemployed.
So where do you want it on the stack on the heap yyou want to reutilize any piece of ass, where buttocks stands for some adequately sized space in memory -- entirely within the realm of possibility. Furthermore, evicting shit you don't need and replacing it with something else.
Let me tell you, I will give your every object an allocator if you give the chance. I will -- nevermind. This is not for your orifices, porridges, oranges, morpheousness.
Walruses.16 -
get a high priority bug , look at code changes, a variable name getting refactored apparently created a class cast exception
something about this hypothesis doesn't seem right
i hate my job, welcome back from vacation2 -
Xcode Lockup #35: Changing Variable Names
You right click on a variable and get the opportunity to change the name throughout the project. Yea!
It does this funky visual collapse thing which is rather nice, showing you everywhere it is used. Fancy. And the world needs more fancy, doesn't it.
For some reason instead of letting me change the variable, I get the Beach Ball Of Death and Xcode unceremoniously quits. BUT NOT BEFORE THE FUCKER SAVED THE PROJCT FILE STATE. What?
Now I re-open the project and yep, we are back into the variable name change fancy interface and Beach Ball Of Death. Looks like the project file is now fucked.
But it was oh so important to give me the fancy folding interface... we (Xcode dorks) will fix the defects later.
Time to do some research and find an Xcode manager mailing address... cuz I'm really tired of this shit...
https://www.ipoopyou.com/orders/new3 -
#DailyRant
I don't like Laravel Livewire and the architectural aspect of it. Every key stroke is a call to the server. The freedom of designing the minute behaviours are taken away. (e.g. border-bottom on a certain div). The maintain ability is not good either. Change one variable name and the whole thing breaks and it's difficult to pinpoint where it broke exactly. And the most of all, it's not beginner friendly.
My chest feels lighter now. Thanks. -
To my vigilant code review overlords, yes, I appreciate the scrutiny, but must we nitpick every variable name? I've been told my camelCase is more like llamaCase.
Let's focus on real bugs, not whether my indentation is an affront to nature.
Remember, the perfect code doesn't exist – unless you're coding on a cloud XD4 -
In high school for an assessment we all had to make a simple game and we to plan it first and then program it. In the planning stage we had to list variables and functions used and whatnot I'm my planning sheet I was given I had "variables modified by user" which basically meant data inputted buy the user stored in a variable with only one player name variable listed in it and everything else in my game was being computed another runtime and my CS teacher told me I didn't have enough user inputted variables and I explained that it didn't need any more she said "so you're telling me the user enters their name and the the game just plays itself?!!! " :|3
-
What do you think about different English variants in code/docs ?
How you would name variable in UK company?
color ?
colour ?
Why ?14 -
Oh the joy of multi-site working and design reviews in bigger corporations...
I try to propose if we could do it on-line with BitBucket commenting etc. Just put your comments there, we discuss it there, each in our own time, and get things closed.
But no. It's nicer to arrange 2-3h conf calls. So that we can really discuss items (and the reviewers don't have to do anything before the call). Nothing can be done beforehand. And the reviewers get to comment not only on design matters, but on system level things too. Like "I wonder if this would be better in place X". Well sure, maybe, but that's system level decision and would require architects etc. And all that work was done 2 years ago, we're supposed to now just check the source code (which you guys wanted me to change).
Ok, so I will arrange a conf call. Our time zones are not the same, so one guy is coming to the office when another is almost leaving. One wants to have Wednesdays meeting free. One has lunch at 11, another at 13. For fucks sake. Some guys have filled their calendar with meetings, most of them which they will not attend anyway, but Outlook shows them as "reserved".
So I spend my day trying to find a free spot that everyone could join. Half of the guys won't read the code and won't give any comments, but still need to be there. And then there are those comments saying "I'd like this variable name to be different" and "it would be cleaner if this was done like I do". Same people produce unreadable mess themselves, but somehow always manage to dodge all reviews of their own stuff. -
I love it when Friday is actually a good day..
Going through some Java code now (which is not normally fun for me), I stumbled onto a brilliant little variable name: `busyComming`.
😅😂🤣1 -
I can't name just the one annoying coworker, because I've never had this one person I really, really couldn't stand being around. But there are plenty of coworkers that have crossed my path over the years with features that have slowly driven me towards madness.
Like the team leader with psychopathic traits and a brown nose stomping downwards and pleasing upwards.
Like the one fellow who set variable values multiple times to really, really be certain it was set.
Like the girl who sat next to me every now and then, and always started humming and singing only when she sat next to me. Always just loud enough for me to hear.
The dickhead coworkers that has been bullying me, excluding me, neglecting me over the years.
The managers who apparently never learned managing nor people skills.
Every jackass that thought it was a good idea to come stand next to me so they could have a nice conversation on the phone without being disturbed. Well, you disturbed me!
The manager who was whistling and singing so loud from his office that I had to get a Bose QuietComfort headset to get him out of my head.
Every fucking one contributing to the dinosaurism haunting the office.1 -
OCD driven development
- level of recursion determined by how much the algorithm bothers you
- too much and nothing is ever finished
- not enough and code is shitty and unmaintainable
- can result is longer variable names
- takes longer to name a variable
- text slightly misaligned requires hours of debugging time
- balanced by "OMFG that will take forever to fix" Sometimes...
- can lead to unobjective code reviews1 -
Does anyone else get frustrated when your co-worker goes behind you and changes the name of a particular variable? Changing the word "repo" to "repository" does not clarify a fucking thing! You're not going to confuse it with something else. I've never once seen the word and thought "Damn, that guy meant reposition and I just fucked everything up." It would be one thing if our lead Dev told me to not use the word, but he could not care less.
Am I in the wrong?1 -
The other day I was debugging an internal app we have which is used to develop screens for an embedded device and noticed a function which enumerated the widgets on a particular screen. One would think this would be a simple task of having a local variable to keep count, assign the widgets a number, index itself, and continue. But no. The previous (and no longer employed) developer for some awful reason, created a TStringList, got the name of the widget, added it to the stringlist, used the result of the add function which returned the index, and used that result to assign widgets their index. All while creating the object and freeing it within the same function. WTF.2
-
Why Dart was designed with idiocy:
1) naming conventions are idiotic
Most other languages are smart enough to not throw errors when the variable name matches its type. And lots of others, for any lexemme - only 1 naming kind is allowed.
Fine. Oh wait, there's that thing called existing databases and GraphQL & other APIs, should they all adapt to this? No, because 2) is the bonus
2) String keys in objects. Unless it's a class with boilerplate, you write them as strings and access them as strings.
So here's the solution when you want to integrate Dart with existing services: write a lot of JSONSerializable decorators to fit with dart's pissy naming requirements.3 -
!rant, but funny
tl;dr I made something that was to protect me in case the customer doesn't pay, wanted to check if it's still there, messed up a little :D
>do an Android app project for almost 6 months
>issues with payment for it
> =.=
>firebase
>"Add new application"
>Remote Config
>add single integer variable
>back to app code
>if (integerFromFirebase != 0) navigateTo(new Fragment())
>mwahahahaha
>but they ended up paying me in the end
>huh...
>see another post on how to secure yourself if customer doesn't want to pay
>well, consider yours as more sophisticated
>hmm... wonder if they removed it
>firebaseconsole.exe
>change "enableJavaScript" (needed a legit name, so it can't be easily backtracked) to 1
>publish changes
>app still works fine
>mhhh... they removed it? really?
>can't fking believe it
>apkpure.com
>search for the app
>download apk
>unzip
>decompile dex file
>find the fragment
>can't find the code that navigates to blank fragment, but the config fetch is still there
>wtf
>look at the app
>restart it
>SHIT ITS NOT WORKING NOW XDDDDD
>changed the variable back to 0
>found out that the lambda in which I navigate to the blank fragment is in other .java file. New thing learned :v
>idk if I'm in trouble but I highly doubt it (console shows max 10 active users atm)
Was fun tho :v3 -
One of those "you have got to be kidding me moments":
struct Speaker: UnitNode, MemBufferBase {
typedef UnitNode super;
…
}
And then elsewhere:
#define Node UnitNode
#define Speaker AudioSpeaker
Never seen anyone typedef base class as super in C++ nor use a #defined variable as a class name. And of course elsewhere in the code class names are normal literal a but are referenced via a #define (and sometimes not via the #define)... The same obfustication done two different ways! -
Top 12 C# Programming Tips & Tricks
Programming can be described as the process which leads a computing problem from its original formulation, to an executable computer program. This process involves activities such as developing understanding, analysis, generating algorithms, verification of essentials of algorithms - including their accuracy and resources utilization - and coding of algorithms in the proposed programming language. The source code can be written in one or more programming languages. The purpose of programming is to find a series of instructions that can automate solving of specific problems, or performing a particular task. Programming needs competence in various subjects including formal logic, understanding the application, and specialized algorithms.
1. Write Unit Test for Non-Public Methods
Many developers do not write unit test methods for non-public assemblies. This is because they are invisible to the test project. C# enables one to enhance visibility between the assembly internals and other assemblies. The trick is to include //Make the internals visible to the test assembly [assembly: InternalsVisibleTo("MyTestAssembly")] in the AssemblyInfo.cs file.
2. Tuples
Many developers build a POCO class in order to return multiple values from a method. Tuples are initiated in .NET Framework 4.0.
3. Do not bother with Temporary Collections, Use Yield instead
A temporary list that holds salvaged and returned items may be created when developers want to pick items from a collection.
In order to prevent the temporary collection from being used, developers can use yield. Yield gives out results according to the result set enumeration.
Developers also have the option of using LINQ.
4. Making a retirement announcement
Developers who own re-distributable components and probably want to detract a method in the near future, can embellish it with the outdated feature to connect it with the clients
[Obsolete("This method will be deprecated soon. You could use XYZ alternatively.")]
Upon compilation, a client gets a warning upon with the message. To fail a client build that is using the detracted method, pass the additional Boolean parameter as True.
[Obsolete("This method is deprecated. You could use XYZ alternatively.", true)]
5. Deferred Execution While Writing LINQ Queries
When a LINQ query is written in .NET, it can only perform the query when the LINQ result is approached. The occurrence of LINQ is known as deferred execution. Developers should understand that in every result set approach, the query gets executed over and over. In order to prevent a repetition of the execution, change the LINQ result to List after execution. Below is an example
public void MyComponentLegacyMethod(List<int> masterCollection)
6. Explicit keyword conversions for business entities
Utilize the explicit keyword to describe the alteration of one business entity to another. The alteration method is conjured once the alteration is applied in code
7. Absorbing the Exact Stack Trace
In the catch block of a C# program, if an exception is thrown as shown below and probably a fault has occurred in the method ConnectDatabase, the thrown exception stack trace only indicates the fault has happened in the method RunDataOperation
8. Enum Flags Attribute
Using flags attribute to decorate the enum in C# enables it as bit fields. This enables developers to collect the enum values. One can use the following C# code.
he output for this code will be “BlackMamba, CottonMouth, Wiper”. When the flags attribute is removed, the output will remain 14.
9. Implementing the Base Type for a Generic Type
When developers want to enforce the generic type provided in a generic class such that it will be able to inherit from a particular interface
10. Using Property as IEnumerable doesn’t make it Read-only
When an IEnumerable property gets exposed in a created class
This code modifies the list and gives it a new name. In order to avoid this, add AsReadOnly as opposed to AsEnumerable.
11. Data Type Conversion
More often than not, developers have to alter data types for different reasons. For example, converting a set value decimal variable to an int or Integer
Source: https://freelancer.com/community/...2 -
My colleague, while debugging a bug:
If (var == 3)
{
printf("colleague name var=%d",var);
//existing piece of code
}
I asked why are you printing the variable value here.
He: "just in case"
He is 3 months more experienced and got promoted last December. Mine is delayed. I met my PM.
PM: You aren't this, You aren't that...
What I heard:
*You aren't licking my boots*1 -
C/C++ considers pointers to be declared next to the variable name rather than the type name (int *x, *y vs int* x, y).
I know this but I still consider * to be more associated with the type. Therefore I'm one of those people who declare each variable in its own line and group the type and * together. (int* x; int* y)5 -
i'm the only one thinking naming variable can and could be something a little bit subjective? or are everybody else can find the perfect name that make it crystal clear for any person reading it?6
-
Debugging API created by developer, who left the company few days back, and he didn't write documentation of it and worse part is variable name used by him doesn't make sense according to context.
LMF!!2 -
Me trying to name a variable...
Spent over 15 minutes wondering if it should be "volume" or "volumn" and almost forgot there was something called google because chatgpt was down.2 -
Working on a multi-year college project, going through tests from previous team.
Every test is not working quite right. They're almost all intermittent failures.
The reason? Every single test class extends some test class, which usually extends from some primary test class.
That primary test class opens up their whole UI, and outside of their UI test package, the only thing that gets used is a variable named session (a string), which isn't even specific.
WHY THE FUCK WOULDN'T YOU JUST MAKE THE SESSION NAME STRING A VARIABLE IN THE TEST FILES YOU DUMB FUCKS
THE ARGUMENT VALIDATION TESTS DO NOT NEED TO OPEN THE UI, LET ALONE CREATE THE WHOLE FUCKING DATABASE JUST TO VALIDATE ARGUMENTS, WHICH YOU DO APPLICATION SIDE
(Also they made it so every session has their own tables as opposed to having session IDs. E.g., "person_sessionID1" and "person_sessionID2" exist.) -
imagine building an app using javascript(react-native) that get list of skills which will be displayed to the user to select and the same list displayed as interest for the user to do the same if you try to treat them seperately but from the same source you get a shit result e.g
const list = responseFromApi;//array of object
let skills = list;;
let interest = list;
skills.checked = true;
interest is changed and the list constant variable is changed the values change were ever the list variable is assign to a variable and the variable is tempered.
the above code was the fustration i got with javascript when i didnt know of the mutation guy.
Mutation is a nightmare never knew javascript object are passed by reference which make them mutable this sucks....
another crazy behavior below though the same;
const person = {name:'Dan',age:43} //object
let person0 = person;
let person1 = person;
person1.name = 'David'
the value of both person0 and person get change.
this is madness .3 -
I am not a programmer, but I know a little bit of Python, C# and C++, but mostly basic syntax of latest two. Nevertheless it gives me higher ground, why?
I develop way od thinking which maker my life easier. I Havel intershop in Pharmacy and they print small papers with number which you show to get remaining drugs. Currently is number, 17592 which makes someone to type almost 40k numbers and erase also this amount. I use variable function in Libreoffice Writer and you have to type one number and it autonumber 64 (easily to expand but unnecessary) and save fucktone of time 😃 And this is why I thing that teaching programming is beneficial, because it develops mindset of resolving problems in easier way.
On the other hand in a few hours I wrote program for my girlfriend to draw randomly picture of herbal material (leaf, root, fruit etc) and ask for Latin name of this material, check if is correct and display necessary information. Programming was quick, most of time I prepare data for this software and this feels so fuxkibg awesome that I could use my knowledge to help my girlfriend and make something useful which makes me proud (code looks like blue waffle, but it works 😃). Fucking deadlines, but at least I could finish it 😃 -
Ok, so currently in my Java course on Udemy we are going more in-depth into scope and visibility, and I'm currently doing the challenge for it.
So I'm doing it and the challenge is to have every single name of a variable or method be called 'x' (just to better understand scope and vis, he mentions how this is not a good practice AT ALL) with the exceptions of the classes and scanner var (but there is an optional challenge to also make them named x).
Now that I progressed into it, I noticed something. This challenge is literally making me make my code so DRY and outside-the-box-thinking that, what if, this could be a practice?
Not the naming everything in your code the same var name, but doing that at the start and then renaming the variables after coding. Because right now, I feel as though I am using SO MUCH less code than if I had the liberty of naming my classes, methods, and variables different things, it's actually kinda cool.
I'll attach my code from the challenge to this after by it really amazed me how well my code looked compared to my previous challenges and even personal projects!1 -
!rant One of the better refactoring insights I've heard today: "With great power comes great responsibility".
Just because a language may not care about certain constructs, doesn't mean you should be relaxed about them (e.g. weak/dynamic typing/not caring about (variable name) consistency).3 -
So, I just (few hours ago)made a new variable that's either brilliant or innately flawed... not sure yet. It's an oddly unique var...
__bs__
So far I only made it in python and windows env (i script like the methodology of css).
I bet you're wondering how I've defined __bs__ and the practicality of it.
__bs__ is derived from a calculated level of bullshit that annoys me to tolerate, maintain, etc. as well as things that tend to throw nonsensical errors, py crap like changing my strings to ints at seemingly random times/events/cosmic alignments/etc or other things that have a history of pulling some bs, for known or unknown reasons.
How/why did this come about now?
Well I was updating some symlinks and scripts(ps1 and bat) cuz my hdd is so close to death I'm wondering if hdd ghosts exist as it's somehow still working (even ostream could tell it should be dead, by the sound alone).
A nonsense bug with powershell allowing itself to start/run custom ps1scripts with the originating command coming from a specific batch script, which worked fine before and nothing directly connected to it has changed.
I got annoyed so took an ironic break from it to work on python crap. Python has an innately high level of bs so i did need to add some extra calculations when defining if a py script or function is actually __bs__ or just py.
The current flavour of py bs was the datetime* module... making all of my scripts using datetime have matching import statements to avoid more bs.
I've kept a log of general bs per project/use case. It's more like a warning list... like when ive spent hours debugging something by it's traceback, meticulous... to eventually find out it had absolutely nothing to do with the exception listed. Also logged aliases i created, things that break or go boom if used in certain ways, packages that ive edited, etc.
The issue with my previous logging is that it's a log... id need to read it before doing anything, no matter how quick/simple it should be, or im bound to get annoyed with... bs.
So far i have it set to alert if __bs__ is above a certain int when i open something to edit. I can also check __bs__ fot what's causing the bs. I plan to turn it into a warning and recording system for how much bs i deal with and have historical data of personal performance vs bs tolerance. There's a few other applications i think ill want to use it for, assume it's not bs itself.
*in case you prefer sanity and haven't dealt with py and datetime enough, here's the jist:
If you were to search any major forum like StackOverflow for datetime use in py, youd find things like datetime.datetime.now() and datetime.now() both used, to get the same returned value. You'll also find tons of posts for help and trying to report 'bugs', way more than average. This is because the datetime package has a name conflict... with itself. It may have been a bug several years ago, but it beeb explicitly defined as intentional since.2 -
R
Dot can be used for variable name just like underscore. And to confuse, R has object oriented also2 -
so I have been trying to make migrations on centos 7 for a while now on my virtual env i keep getting this error
## Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/srv/switch/env/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/srv/switch/env/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/srv/switch/env/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/srv/switch/env/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/srv/switch/env/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/srv/switch/env/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/srv/switch/env/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/srv/switch/app/switch/urls.py", line 10, in <module>
url(r'^administration/', include('primary.core.administration.urls')),
File "/srv/switch/env/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/srv/switch/app/primary/core/administration/urls.py", line 2, in <module>
from primary.core.administration.views import *
File "/srv/switch/app/primary/core/administration/views.py", line 5, in <module>
from primary.core.api.views import *
File "/srv/switch/app/primary/core/api/views.py", line 8, in <module>
from primary.core.bridge.views import *
File "/srv/switch/app/primary/core/bridge/views.py", line 11, in <module>
from primary.core.bridge.backend.loggers import Loggers
File "/srv/switch/app/primary/core/bridge/backend/loggers.py", line 2, in <module>
from primary.core.bridge.backend.wrappers import Wrappers
File "/srv/switch/app/primary/core/bridge/backend/wrappers.py", line 6, in <module>
import pytz, time, json, pycurl
ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
even after uninstalling pycurl and exporting the pycurl variable to my environment can I get any help4 -
not understanding javascript scope
trying to pass in variable with same name as for variables of a consumer to be used
sameName : sameName
doesn't like it, change the name of one of them welp2 -
OMG I want to throw my monitor out of my window right now!
Someone just went through my entire project and un-cuddled all of my braces, AND THEN STARTED ALL MY FUCKING VARIABLE NAMES WITH AN UNDERSCORE!!! Are you kidding me??? People actually do that??? That's literally worse than php's brilliant idea of starting every variable name with a dollar sign!
I can't even read my own code anymore...2 -
Yesterday I spent hours searching for obscure references on where some function evaluates because my loop didn't work. After lunch I realized I used the same variable name twice, changed that, everything worked....2
-
Imagine that I have written 1000 lines of code and imported many libraries. Sometimes I get confused when trying to use a name I defined earlier. In my mind is this name a class or a method, is it a local or global variable, is this a constant. So I came up with a way and it totally works, although my ide complains, but who cares, I use it anyway.
I use PascalCase for class.
camelCase for methods.
snake_case or lowercase for global variables.
kebab-case I don't use this
UPPER_CASE for constants
snake_caseL or lowercaseL with a capital letter L at the ending for local variable.
I hope this is helpful 😊🤔11 -
Do you guy know that there is a lot of short query name like "f" in web development?
We are discourage from using single character variable name and the query key is too short. Is there any specific reason for using short query name?6 -
Does anyone know if there's a list or something with examples of bad variable names? As in ones that shouldn't be used because they're already used namespaces and such?
It would be awfully convenient in situations where you're not sure if it's an okay name or not. :/ -
Just like we have code developers there serious code breakers (if all is well, they atleast change the variable name)
-
I am unable to understand the naming convention. I SUCK IN IT.. CAN'T I JUST NAME MY VARIABLE AND OTHER THINGS LIKE SIMPLY, WHY I HAVE TO USE UNDERSCORE AND ACCURATE NAME FOR IT.
I mean , my variable does tell what is it for then why I need to do that?5 -
Okay, I hope a few people can help me with this; what are the benefits/reasons to use MS technologies? I'm talking about .NET, ASP, Windows Server, Powershell...
I've never understood it. I love Nodejs because you don't have any packages unless you ask for them. Alpine Linux is amazing! It runs on 8MB of RAM from fresh and doesn't need much more space to install.
You want .NET core? 140MB download. You're configuring database connection strings? Feel free to type in whatever you like, it'll parse and replace with some magic variables that have come from some other random file.
I was using Powershell recently, needed to set an env variable. Bash is happy with "export name=value". You want to do that in Powershell? I just googled it and found an entire 40-minute read discussing how to set env vars. Why?! It should be one command, and I don't know who thought that "Get-ChildItem" was _obviously_ referring to env variables.
It seems to me that everywhere MS has got their hands on development-wise, it inherits the typical sales bullshit. No no, you can't call them "websockets", they have to be branded "SignalR" and add tons of overhead. You can't say "disable notifications" it has to be "focus assist". I'm really surprised something as simple as a keyboard hasn't become a "varied user input device" or something of the like.
Am I alone in thinking this?4 -
WTF?
W_T_F?
W-T-F?
W$T$F?
how the fuck do you brand codebases?
say you've got a brand called dicks,
and you've got a website, api server, some SDK's, and whatever else. How do you format the codebase names so it's A, usable as a variable name, B clickable at the variable part of the name, C, that's fucking it
dicks-website can't be used in js because
dicks-website = require('dicks-website') won't work
dicks_website can't be used in url's and in general because double clicking any part will select the whole word, so you can't replace dicks_X easily.
dicks$api seems to work, dicks and api are seperately clickable, and usable as a variable in javascript. I already know that the $ sign probably fucks up many many systems so that's probably a no go
has this question been addressed already?4 -
What's harder than trying to name a variable is to think of a memorable but easy to type password to a system that resets expires every 3 months with history checks.2
-
Hello, I am stuck working on a project built on top of CakePHP 1.3 and I have some custom helpers, one of them named Order; for my views, I need to set a variable $order to contain the order data.
My problem is that if I set the variable in the controller ( $this->set(compact('order)); ) it overwrites the helper instance ( $this->Order ), and if I set it with a different name in the controller (say $_order) and reassign it in the view file ( $order = $_order ), the helprr instance ( $this->Order ) is also overwritten...
I really need to have the namings as described in order for my code to be clean and logical.
FML... -
let target: any = e.target;
if (target.nodeName) //other code
Results in a typescript? error wherein it says that Property 'nodeName' does not exist on type 'EventTarget'. but if I refactor the variable name to something that isn't target it works
i don't understand2 -
When coworkers leave their laptop unlocked we find a commonly used variable name and replace all name references with 'poop'
-
Variable Naming process
-------------------------------------------
Fetching a data of Counties into a variable using Fetch API.
Variable Name: countyData.
The code review is going to be interesting.4