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 - "statements"
-
Hoorah! My code finally works! Now gotta remove those 1000 print statements I used to identify the bugs 😥11
-
You say: "We added AI to our product"
I hear: "We added a bunch more IF statements to our codebase"8 -
My thoughts on programming:
As a child:
It is 100% magic
As a developer:
It is 65% if/else statements, 34% iterating an array, 1% actual amazing and unique code17 -
Another one, teach secure programming for fucks sake! This always happened at my study:
Me: so you're teaching the students doing mysql queries with php, why not teach them PDO/prepared statements by default? Then they'll know how to securely run queries from the start!
Teachers: nah, we just want to go with the basics for now!
Me: why not teach the students hashing through secure algorithms instead of always using md5?
Teacher: nah, we just want to make sure they know the basics :)
For fucks fucking sake, take your fucking responsibilities.31 -
Every new product these days has the tag line "powered by AI"
FUCK OFF
No it isn't.
A mass of "if" statements isn't AI!16 -
Fuxk yeah! My code works! It's 2AM, I'm happy and there's no one around, so I wrote a poem :-P
What was once impossible,
Is now close to completion,
Thanks to my debug statements,
Which now await their deletion.28 -
I told my girlfriend she was the semicolon to my statements,little did she know I was using Python.8
-
All the new computer science students at my university refer to include statements in C++ as "hashtag include"23
-
A coworker was working on some code and wrote two return statements and asked a senior developer why the second value wasn't being returned.7
-
It's 2017, I've got a bird on my shoulder and a stressball on my desk, everything is alright.
( I should be working on that SQL statements I generated instead of writing them out right now)
Just one more thing
I ♥️ DevRant27 -
I'm so fucking done with all those "woke" YouTube programming tutorials like: "Why you should NEVER use else statements", "Why functions should ALWAYS return a value", "Why switch statements are actually EVIL" and stuff like this
I swear to fucking god26 -
FUCK YOU PHP!!!! FUCKING HELL JUST FUCK THE HELL OFF YOU PIECE OF SHIT.
8 GOD FORSAKEN HOURS SPENT TRYING TO ZIP SOME SHITTY FUCKING FILES IN A FOLDER ON MY WEB SERVER TO HAVE THEM DOWNLOADED TO MY CLIENT COMPUTER.... 8 HOURS UNABLE TO OPEN THE DAMN FILE AND THE ISSUE WAS "echo" & "print_r()" STATEMENTS GETTING TRAPPED IN MY ZIPARCHIVE BUFFER MAKING THE ZIP FILE A GIANT PILE OF UNREADABLE SHIT.
HOW IN GODS NAME WERE THOSE FUCKERS EVEN BEING ADDED TO THE ZIP FILE.
Fucking hell. Time to sleep.8 -
Today I was searching Android docs and found something interesting:
To write Android log statements, you use the android.util.Log class with the following methods:
Log.v()
Log.d()
...
Log.wtf() 😮😮😮
According to Google it seems to mean "What a Terrible Failure".
WTF?!?!?!12 -
me: your code base is vulnerable, you are not using prepared statements
him: not an issue, nobody knows
me: ...
me: ¯\_(ツ)_/¯13 -
I always use brackets for clarity even if there is only one statement inside them
if (boolean){
function ();
}
Cus it's so much easier to read, and if I need to add statements after the if I don't need to remember to add brackets. Plus the else may need brackets and an if with no brackets but an else with brackets looks awful.14 -
Today I remembered why I don’t “wing” things.
Anyway, here’s my cat in a cardboard tank.
Statements related.19 -
Instead of using actual debugging tools, using print statements and forgetting to remove all of them.7
-
I had a weird dream last night where people communicated by using log statements.
Like if I wanted to say something very loud I'd think Log.wtf("WTF!") and it would appear in front of me like subtitles. Log levels were equivalent to tone level.
The scene was basically a bunch of people with log statements of various levels in front of them and their lips moving with no sound.
I think I need a vacation.2 -
NO JIMMY.
YOUR 45 IF/ELIF STATEMENTS ARENT FUCKIN A.I.
NOR ARE YOUR 25 METHODS THAT RETURN A STRING A FUCKIN BLOCKCHAIN
STOP FUCKIN USING EVERYWHERE THOSE FUCKIN WORDS
FUCK OFF2 -
I'm going to make 4 statements of which only 3 are true. You tell me in the comments which 3 are true.
1. At my job in the marketing department, I manage our Facebook ads campaign where we spend hundreds of thousands of dollars in advertising.
2. MIS department inexplicably blocked the marketing dept from the Facebook domain altogether near the end of the day.
3. They also block Dropbox although we still have to manage all the distribution of digital video and commercials to our tv advertisers.
4. I work in a technically progressive environment that understands how things work online.2 -
Hi all. I know it's been a while. I've forgotten what days off are. However, knowing you all are here and understand the terror of horrendous code gives me comfort while dealing with statements like "the problem isn't with our code, we haven't touched it in 14 years" while discussing database upgrades (3, in fact).8
-
to the guy who writes indented IF statements all one liners and brackets removed
please fuck yourself6 -
> Writing some code 😀
> Compile it
> 10 errors 😣😣
> Debugging mode on😎
> Write about 100 print statements to debug the code
> At last found errors and now remove those print statements😅
> Compile code
> 2 out of 30 test cases pass😤😤
> Exhausted and angry😡
> Silicon valley new episode arrives🎉
> Super excited after watching the episode and think like you too can code like Richard Henricks😎😎
> Coming back to the old code and build logic from scratch
> Compile and finally all test cases pass
> Task completed😂😂3 -
That just takes the damn fun out of it.
"In Python, we don't actually use commas unlike many languages. And as I mentioned last time, a tuple is a lot like a list, but it has it's differences. Oh yeeeah! Did I mention the logic behind if/else if/ and else statements?? They're sooo amazing."13 -
A Month ago...
Me: when are you going to complete the report
Friend: we can do it in minutes
Me: you can't Ctrl + c and Ctrl +v as there is plagiarism check
Friend: we have spin bot
Me: you do that now itself . if something happens? You can join me .
Friend: just chill
Now ...
Me: done with report
Friend: feeding it to spin bot!
Feeds text related to database security....
Spin bot:
Garbage collector == city worker
SQL statements == SQL explanation
SQL queries == SQL interrogation
SQL injection == SQL infusion
Attack == assault
Malicious == noxious
Data integrity == information uprightness
Sensitive == touchy
.....
Me: told you so...
**spin not == article rewriter3 -
I was at the robotics group of our school when suddenly two other students (both 2 grades above me) started talking:
P1: I always forget the brackets when writing code
P2: I always forget the return statements
P3: yeah, always takes ages to find out why your code doesn't work
P4: haha, in the end it's just something missing that you didn't notice like a semicolon or a bracket
Me (thinking): do you use a fucking toaster to code? Even if you don't use an ide the compiler tells you what's wrong8 -
Advice to all new programmers, take this one from personal experience. DO NOT PUT SWEAR WORDS IN DEBUG STATEMENTS.
You will miss one, it will go to production and it will get picked up by your log monitoring...2 -
*bunch of if statements*
Friend shouts proudly everywhere : I implemented an AI!
Me : but that's not how AI works
Friend : but it works just as an AI, so it is one, who cares?
😥3 -
One day, this ex-boss of mine dropped the following bomb:
“Stop using switch statements, the switch statement is archaic.”
The if statement should be even more archaic, right? So, should we stop using ifs as well?12 -
So today I wrote CSS using for loops and if statements in scss.
You could say I was programming in style... -
Me: Bro look, I have learnt so many things from the past couple of days.
-Introduction
-Data Types
-Variables
-Arrays
-Operators
-Control Statements
-Classes
-Methods
-Inheritance
-Packages
-Interfaces
-Exception Handing
-Multi-threaded Programming
-Enumerations
-Autoboxing
-Annotations
-Generics
My senior: Congrats on finishing up the basics
Me: Those were just basics???...///!!! 😜3 -
For a project day we had to write a game of our choice in Java.
"You should make this game using the JSwing library and make each component a JComponent"
Later I learned you can simply use a Bitmap as a canvas.
NEVER. EVER. BASE. YOUR. GAME. ON. SWING.
It inefficient to the top of my taskmanager. I had to wrap everything with something like a virtual playground where I had to manage everything myself to not roast my cpu.
I had alot more fun debugging hundred lines of C code with print statements than writing that shit2 -
Fuck i love regex... managed to replace a series of loops and if statements with regex and cut execution time from 60ms down to 5ms13
-
First year at uni, during c++ basis.
The professor has just finished explaining the while cycle.
Professor: We want the code to print all numbers from 0 to 40 using a counter. How would you do?
Classmate puts up his hand: we do 40 if statements and when we reach the 40th one we stop.
Professor: *face palm*9 -
I noticed some users with very high votes and looked at their posts. All of the posts were just positive statements. Let me try. "I think computers are wonderful. It's so exciting to build out the ideas of my dreams and help others."11
-
I have previously seen this in a production code base. The same code base included nested if statements (20+ conditions)...
If (condition == false) {
return false;
} else if (condition == true) {
return true;
}11 -
I pretty much just copied code from Google for a good 2 years, following tutorials on Java, until I actually got a basic understanding of wtf I was doing. I could understand the syntax, loops, and conditional statements well, but for some reason I didn't quite understand the concept of an object until I took a class on Java development during my high school career, where it finally 'clicked'.3
-
Reviewing bosses code and had these two if statements with no logic between
if (someVar) {
if (someVar) { // double check someVar is true just in case
}
}7 -
Being a Woman in Tech® is exhausting because every time we know something a male superior doesn’t, we have to end our statements with “but maybe I’m wrong, what do you think?” so they feel like it’s their idea and take the topic seriously.
I used to be adamantly against this type of coddling but they beat it out of me. You can only be straightforward and confident a finite number of times before you’re pulled aside and told you’re “cocky,” “arrogant,” “irritating,” etc. So many of us use this strategy to avoid those labels, but it’s a tiring part of the job we shouldn’t have to think about.24 -
rant.
when you're a programmer surrounded by designer friends, it feels frustrating sometimes.
people appreciate what they do more because they can clearly see the end product: beautifully designed ui, animated splash screens, clean colorful themes. even though it probably does squat other than to print statements.
then they look at your overly simple design and cant see the beautiful underlying code within.
end rant.3 -
So youtube-dl has finally been reinstated. Took them long enough, but I guess that means that GitHub's statements weren't just words. Nice!
https://github.com/ytdl-org/...4 -
OMFG if I see one more single-lined if-else/for statements without proper closure brackets I'm gonna kill some people!!!8
-
I spent more than an hour trying trying to debug why two functions were always returning undefined. I even put in conditional breakpoints and executed the statements to confirm the logic was correct.
I forgot return.4 -
Just reviewed collegues code: 80 lines of if statements that are so long that I have to scroll sideways on my 27" screen. Just wrote the exact same thing in 5 minutes and 10 lines! If you don't know how to use loops in your code please learn something different and stop pissing off skilled devs 😡5
-
I'm just C# boy, born and raised in a .Net world ... Today I started some stuff with JavaScript, downloaded the JavaScript standard extension for using in Vs code... It made me do things...it made indent each new line by 2 spaces! Not 4 or a tab but 2! And then what really took the fucking biscuit, it said I couldn't end my statements with semi colons! I need a strong cup of tea and a sit after that shit. How is that at all useful to anyone!? It just made it make less sense!!!!10
-
When I found the power of poke on c64, and how to output sprites rather than use print statements. Finally, my text adventures changed into full blown rogue-likes!
https://c64-wiki.com/wiki/Sprite/1 -
Started a new job this week.
Just learned that my manager strictly prohibits while loops and "if else" statements.23 -
Do ya ever hate how often people use the term "AI" so loosely. It's like saying your thermostat or your "smart oven" (or "smart"-everything) is "AI-infused" because it can regulate the temperature. Unless the machine actually learns something for next time around, a bunch of "if" statements isn't truly AI in my book.5
-
I hate setting up case statements cause it's hard to cover every case. What if a virus puts a gun to my programs head? What if my program is at a cache party and chrome offers it weed? What if my program isn't gay, but $20 is $20?2
-
Today I looked at some code from our CTO. He used plain SQL Statements with huge selects and no prepared statements.
I asked him:
1. why dont you build some helpers or even use some frameworks?
2. why are there no prepared statements?
His answer (to both questions)
We do not need that. That just uses too much ressources and time. It's more cleaner and simpler this way.
My Face: 😵1 -
Nobody:
Very stupid people with no github projects who are probably stuck at making wordpress sites: haha ai is just if statements7 -
Pro-tip to self: Getting syntax errors on your If-Than statements? Try using If-Then instead!
*facepalms at own stupidity* -
Am I the only one who when they are super focused writing code and debugging starts acting like Bob Ross painting a picture?(without a filter... of course)
And here we’ll add another little god damn breakpoint so we can watch our fucked up variables report the wrong thing..
Oh and over here will just add another little happy simple if statement.
Oh look at the happy if statements in a row.. maybe we’ll add little switch statement here.6 -
Not adding spaces in for statements.
ex) bad practice
for (i=0;i<10:i++)
{
//some code
}
ex) good practice
for (i = 0; i < 10; i++)
{
//some code
}9 -
Who the fuck writes a 200 line method with 52 if/else statements, 3 try-catches, 6 loops and only 1 comment saying //Array of system records. No dipshit I thought that was a Fucking interface. What happened to the whole keep it simple notion?!5
-
When you look back at Code from your 2nd year of university...
Using while loops as if statements to check for vowels... *shudders in fear*5 -
*squirming in bed*
If it ain't broke don't fix it.. If it ain't broke don-WHAT THE FUCK IS "payment.needed2"??
Calm down, it's just some bad code but it works, you didn't write it, it's not your probl-WHY THE FUCK DO THE IF STATEMENTS HAVE SO MANY DUPLICATED LINES??
Sleep. Just sleep. -
Using an array of function pointers to replace large switch statements... holy shit.. I feel like Thanos getting the time stone.
Just when you think you can’t get your code to run any faster, nor did I think I could get the code any smaller... BOOM.. C never ceases to impress.
Next I’ll be turning this into “object” oriented ... but since it’s C ... it will just be Struct oriented .. SOP ..18 -
FUCK, I just realized something..
A lot of people are probably aware of the statement "Respect is earned, not demanded/given".
Now, if you are aware of the meme "Press F to *pay respect*", you probably know where this goes.
The statements "pay respect" and "respect is earned" are actually connected. Just like money, you pay money to people who deserve it. You work hard for it.
But if this is true, is "attention" also earned? I often hear "Please pay attention" from my teachers back then.
This is some big brain shit right here8 -
I practice what I call "Aggressive Oriented Programming" or AOP.
Whenever I'm investigating a bad bug, working on a project that I really hate, or dealing with messy code written by a messy developer, I often find myself resorting to an [internal] state of violence.
It's not like I scream and smash my screen (although sometimes I want to). It usually consists of a few git blames and some curse words in print statements for debugging. This is just my way to vent.5 -
is it just me, or do some people just make life difficult for the fucking sake of making life difficult?
now, lets ignore the lack of sanitised data, lets also ignore the lack of prepared statements, and for the love of god... lets ignore some magic numbers, because I still don't know what they mean yet....
but why! why would you create an array, implode it, smash it into a database query on the fucking fly, instead of just adding the data into the query in the first place.... it's not like you were doing this right to begin with, but this... this is next level!28 -
The brand new language - C thru
In this C language you have a lot of new statements and thats all ;)3 -
if ( condition ) {
callback(data)
}
callback(error)
--is a lot different than--
if ( condition ) {
callback(data)
} else {
callback(error)
}
callbacks are not return statements 🤦♂️9 -
Apparently `a || b` is unreadable to set a default value for a string in JS, but assigning temporary variables and use if statements all over is better somehow.
My code reviewer said use `a ? a : b` except it failed eslint, so he went back on that. (eslint suggested `a || b`, ffs.)10 -
just remembered watching a video where a little shit wannabe programmer was interviewed by another shit wannabe it professional "hacker" and the first shit claimed he designed a new language that is better with a compiler 10 times faster and better than gcc when he demonstrated his language it was nothing but a header file with couple of define statements for different C function.
and this dude was in the news and was glorified by people and shit
#justturdworldstuff
I'm glad i left "my" country3 -
Last week I forgot to add the break; clause to a bunch of case statements and literally spent a whole evening busting my head 'cause my code wasn't working.
So this week's answer: ME. I'M THE WORST.2 -
*code reviewing someone's work*
OMG! if-statements within if-statements! This is an IFception! *prays*4 -
Finally removing all mysqli references and make the pdo statements, so we can finally switch to PHP 7.25
-
PM sends email to development team with the whole management team in cc.
"Guys, the data is not updating correctly! Make sure all the updates are being done! If we can't get this right then we can just forget about this whole thing!"
Me: Yes, because making generalized statements and inflammatory remarks actually help in correcting the problems... -
people who don't use semi colons in JavaScript. I know it's not required but God does it drive me nuts.
also one line if statements that don't use brackets.
ahhhhh3 -
A lot of things dev say are true, but this one I don't believe as much:
Many devs say that it's important for everybody to learn a bit of a basic programming language, to learn about computers and how programs are made. I disagree, I think that instead people should learn *how* things work. Ex, in my school people always use a VPN to get around the proxy. I don't care if they know basic statements, I think it's more important to learn how a VPN works. Most of them don't even know what VPN stands for. Am I the only one?3 -
!Rant
I'm going to be teaching my roommate how to "code" soon. Or rather, I'll be teaching her how to use Scratch, so she can have a leg up when she applies to work at a children's code academy that uses a Scratch-like environment. Should be fun!
I love that Scratch exists. Such an accessible way to teach basic concepts like loops, conditional statements, etc, with results that are way more fun than "oh look I output the fibinacci sequence"1 -
Was finally able to explain to the fiancée conditional statements..a few days later she sends me this
If a= tick, remove with tweezer
else Pepper may get Lyme disease
Pepper is her adorable lab btw! 😊2 -
TIL Python doesn't really give a fuck about semicolons -.-
So after spending the past couple years almost exclusively using C# and Unity I decided to come back* to Python for no real reason except wanting a change of pace.
I almost ripped my hair out backspacing semicolons I kept putting in out of force of habit after having worked in C# for so long
Well guess what... I just learned (purely by accident)... Python couldn't care less. I feel internal conflict if that makes sense.
TBH now I'm randomly putting in semi-colons at the end of some statements just because I can and I want to abuse this freedom ^_^
Yeah yeah it's not very "pythonic" or pretty but screw that
* I started programming in Python back in high-school but switched over to C# + Unity after graduating and pursuing indie-gamedev.
Note: After some searching I realize you can use semicolons to have multiple statements on the same line but I never really needed to do that during my time with Python so I didn't even remember it was even a thing6 -
Didn't realize how much I got used to PHPStorm until I used VS Code for a personal project and got errors from forgetting to manually add my Use statements. :P2
-
Been using linux for 10 months now and finally figured how to write looping statements in terminal itself instead of writing a script for that .. Life just became simpler..3
-
People don't seem to know how to properly do print-debugging, so here's a simple guide:
1. A log of "aaaaaa" or "got here" isn't as helpful as you think when ALL OF THEM ARE THE FUCKING SAME. You put a descriptive label or copy verbatim the conditional statement. This saves time matching statements, allows one to watch multiple branches at once, and allows others to understand and help faster when dragged in to help.
2. When trying to see where code fucks up, before each line, paste said line into a proper print statement for your language. If there's, say, a function call or some shit, have it output something like "functionCall(varA=<varA contents>,varB=<varB contents);" Most normal lines should be like this too, but it's especially helpful for calls and comparisons.
If need be, add return values after if they're not shown in another print statement later.
This allows for a trail of execution AND the line that fucks up will be the last in the log, making finding it easier when dealing with hangs and such.
3. Putting something unique like "DEBUG: " or something in front of all statements ensures you can just search for them to ensure you're not rolling one out to production. It also separates debug output from normal output at a glance, making digging through logs faster.16 -
Create a new, fast, strictly typed programming language with organized project structure, normal package manager, dynamic syntax extensions (that means you can change the syntax of the language if you like!) and (most importantly) if statements which are written like this:
(bananas == 0) -> print 'No bananas!';3 -
During a design meeting, our boss tells me that Vertx's MySQL drivers don't have prepared statements, and that in the past, he's used a library or his own functions to do all the escaping.
"Are you kidding me? Are you insane?"
I insisted that surely he must be wrong; that no one would release a database library without built in support for query arguments. Escaping things by hand is just asinine and a security risk. You should always use the tools in the database drivers, as new security vulnerabilities in SQL drivers can be found and fixed so long as you keep your dependencies up to date.
He told me escaping wasn't as tricky as I made it out to be, that there were some good libraries for it, and insisted Vertx didn't have any built in support for "prepared statements." He also tried to tell us that prepared statements had performance issues.
He searched specifically for "prepared statements" and I was like, "You know they don't have to be called that. They have different names in different frameworks."
Sure enough, a short search and we discovered a function in the Vertx base database classes to allow SQL queries with parameters. -
I hate when people call any sort of program that does anything even remotely intelligent looking “AI.” No, there is a very specific distinction between actual artificial intelligence, and a bunch of if-statements.4
-
Historically I've done Java but have recently moved to C# and got the book to do a cert.
Who thought it would be a good idea to start chapter 1 with threads, concurrency, asynchronous calls and PLINQ, then covering boolean expressions, if statements and loops in the section after??6 -
I need a way to explain to a coworker that nesting if statements beyond 3-4 is too much and needs to be re thought out. The dude is the biggest arrow head programmer I’ve ever seen. And he claims nothing is wrong with it, it works.. so what’s the problem.
Since we follow the rule of only one return per function he claims it’s the only way to accomplish the stuff he’s doing.. like if blah function passes... if blah function passss if blah functions passes do this then if blah functions
The if statements arnt just checking some variable conditions.. the conditions are checking returns of functions at each nested level the condition, executes a different function and thus checked for success.
Uggh I just don’t know how to explain to him it’s shit and needs to be re designed
Any ideas??20 -
I really dislike when people don't use braces { } on if/else statements.
If(almond.harvestStatus == undefined) almond.harvestMode=false
almond.dropdown = false.2 -
So I was helping my friend debug her code.
A portion of text was not being displayed. We put log statements everywhere. Cross checked every line of code. We had almost started to lose it.
And then we found out that she had accidentally set the text color to white in the XML layout.
Just another one of those days. -
Somebody pays for this domain 👍
Translation: www.if-loop.de
There are no if-loops, just if-statements! -
It was my thesis defense and I've made a pretty complex algorithm of sorting out data to their respective tables. One panelist told me that it is not an algorithm but just a collection of for loops and if statements. An algorithm should contain mathematical equations he said. I facepalmed during the course of interrogation.
-
!rant
Working on a group project, and this is how my group member writes his "if" statements.
Should I change my group?10 -
Lead developer wants to put SQL statements in to records of the database for the code to execute (in Rails). This smells really bad to me, am I over reacting?8
-
Always include import statements. Always. No excuses. I don't care if you can't be arsed to copy-n-paste an extra bit of code.
Nothing worse than trying to learn something new, copy-n-paste a sample code then your wonderfully helpful IDE asks you which of the 8 matching packages you wish to import.
When someone asks me, "where did you get that", I don't simply say, "a shop"!!
If you don't include your imports in answers then I hate you.6 -
The way this if statement is written (across multiple lines) is really weird to me. Anyone here that writes if statements like this?14
-
I just realized one of today's emails is asking to review again that spaghetti program and this time figure out how to optimize performance because it is getting flagged for high cpu and database usage. A Niagra of If-statements and nobody-cares-for-comments-and-technical-documentation.
*bleep* *bleep* *bleep* previous programmer.
I'll deal with this torture on Monday.2 -
I never knew that I was a good mentor at SQL , specially at PL/SQL.
I gave a task to a new member of my team, to fill 5 tables with data from other 15 tables.
I informed him well about data table info and structure. He spended about 3 days to create 25 different queries in order to fill 5 tables.
After I saw the 25 queries, I told him, that he could do it with 1 main query and 5 insert statements.
So I spended 1 hour of training, in order to build,run and explain how to create the best sql statements for this task.
(First 5 minutes)
It was looking so simple at the beginning from starting with 1 simple join, after some steps he lost my actions.
(Rest 55 minutes)
I was explained the sql statements I 've created and how Oracle works.
Now , every time he meets me, he feels so thankful for learning him all those Oracle sql tips in 1 hour.
Now he is working only with big data and he loves the sql.1 -
Just started a new job three weeks ago. I was doing pair programming with another developer that has been there two years; I was assigned an issue and wanted his opinion on it. He implemented a fix that involved multiple complex if statements.
He was surprised after I went ahead and showed him that the variable in question could be used (it was either 0, null, or > 0) like a boolean. I brought it down to 3 lines; a single if statement. Felt like a boss. -
That guy that keeps putting print statements in the code for the rest of us to hunt down instead of using a debugger... If i ever find out who you are, i will go full Liam Neeson on your ass...2
-
You wouldn’t think that finding a home that actually had internet service would be the hardest part of house shopping in 2018...
Satellite internet does not count as internet. Also my statements apply to the US market only. Idk how bad this is in other countries.4 -
Modern cross platform mobile app development is a lie. Maybe if you do Apple first, I don't know. Maybe xamarin is better than Cordova, idk. I've spent more time tweaking to one platform than I would have just starting with a platform and writing two or three code bases. I've got more if iOS statements than I know what to do with and the Windows code is some hacky transpiled mess because UWP isn't ES6 ready for reasons. Also, some error and image handling just doesn't translate. All this and I've got significantly less features than I could have implemented in the same time writing in a native language.3
-
So I am currently figuring out JavaScript, I don't know how to write my _own_ code yet but I know how some statements go. Progress my friends!1
-
Man learning I’m not good at learning new languages, I get to the point where I have the basics of the language ex: Conditional statements, loops, functions, classes, structures, file manipulation, etc but idk what to do after that, is this where I start learning libraries cause I still get the feeling I’m not at that step yet.
Before you ask, yes I know I am heavily over thinking this2 -
When I was first learning Java I forgot to use If statements and made about a 600 systemoutprint lines. Don't be like me5
-
When you go to an architecture meeting and people's statements are so abstract that they could apply to any product on the face of the earth.1
-
Its amazing how many people call themselves programmers yet cannot figure out the usefulness of print/log statements. 🤦♂️
-
I just dealt with a 3 nested "if" statements in SQL. There is no indentation so I am quite frustrated since each "if" spans up to 2-30 lines.
I now understand why Python white space is significant3 -
The more you learn languages like Javascript and Python, the more you realise that while every syntax differs, they're all essentially themes of the same if, else or and, type statements... This leads me to believe that with enough practice, it's possible to shortcut or pick up a new language progressively faster. Or am I just a melon?7
-
Reply to a recruiter today quoting her email:
You will end up with more qualified people if you don't use blatantly fictitious statements like. "While it's not often that I like to email people I don' t know (especially those in different cities!)" You're a recruiter using LinkedIn, the activity of recruiting is partially doing exactly the above.
No interest, have a good day. -
I don't really get it why my co-male dev does not like ternary operator as a shorthand operator for if/else statements.15
-
Be me, get a consultant job, go to a supposedly great client that has fame of getting scouted by Google. (attn: I doubted all this shit before I started)
Learn the basics by a awesome mentor and trial/error stuff at the same time to get the hang of things, after that was done, I noticed there was no documentation whatsoever, code is spaghetti and your documentation, good luck!
Royal spaghetti, you can't make heads or tails of it, dev code in production, empty try/catch blocks, empty statements, if (true)... (incl. their core classes)
Keep in mind this is a multi milion dollar company...
Someone please understand my pain...6 -
Starting a project with someone that programs like an idiot on steroids. Like, why are you using 20 switch statements to set a variable instead of of just a single line linear expression. I removed hundreds of lines from one of this ass's files. I've never seen such a complicated mess of garbage.5
-
Me: Alright Derwent, don't fuck up this database update. There's no undo button and no way to import a database backup so you gotta be extra careful or you're going to have to spend hours writing a whole bunch of regular expressions and sql statements to sift through an 11mb database dump and figure out how to restore 59 thousand records to the correct state. Let's practice this transition on a staging server first and make sure we get it right
Me: I got you fam *presses the wrong button* -
Send the dev a request for a design before they do a delicate process. They send back some mess done in MSPaint and a ton of select statements, with no context or explanation.
Send back an example of what they need to work through. Get back a response saying that the previous spec was just a draft, and once they complete development they’ll complete the design.
Why would I want a design once it was too late? What would be the point? -
I always love getting yelled at by a client about a feature that they “use everyday” and critical to their business is just not working. Go back and look... it appears that it broke a while ago (in this case a couple months).
It’s my fault, but I do start to question other blanket statements they make. -
Stackoverflow is full of pedantic cunts who can’t admit they don’t know how to answer your question, I just spent 20 minutes having 4 people tell me because they didn’t have “the full code” they couldn’t help with the problem, despite by the end of me posting more and more (completely unrelated) code they were LITERALLY complaining because I hadn’t added fucking “#include” statements 😑7
-
Anyone else hates this kind of statements:
if ( doSomething() != SUCCESS ) {
//log error
}else {
//continue doing other stuff
}
I simply find that confusing. This is much better:
If ( doSomething == SUCCESS ){
//continue doing other stuff
}else {
//log error
}
Maybe just my opinion.17 -
'Google knows everything about you.'
'Facebook records conversations.'
'Personalized ads manipulate you.'
Guess that's why YouTube showed me an ad in Spanish yesterday. Or why I never clicked on an ad. Or why only every 1 in approx. 10 ads is somewhat relevant to me (and thats with me explicitly stating my interests in ad personalization options).
I don't have anything against shielding your privacy. It's your right not to use a product if you don't want to, but I don't see how people can make these statements without providing solid proof.
Just my opinion.5 -
Hate my fucking ‘Logic’ class. Teaching us if, or, and, etc statements and when something is true or false so far. Fair enough, part of logic. But fucking 6 classes on the same topic, isn’t helpful. Especially since it feels like the same shit I learnt myself when I was 13 and a junior in High School.
People are all surprised at it, even the Computer Science majors. This shouldn’t be a shock to you on how these statements work if you’ve coded for a few minutes in the University. You should’ve learnt it in your first programming class.
Ugh, just how I feel about this class. Have to take it to get my degree, otherwise I would’ve dropped it by now >.> Waste of time and money for me.12 -
I hate it when people use like 7 "if" statements instead of like.. 2? And when they do not nest "if"s.
For ex. :
if(condition1 && condition2){
}
if(condition1 && condition3){
}
.....
" But I am writing it out longer to understand better! "
Yet it eventually stays that way with like 50 lines of "if"s..1 -
Textbook definition of insanity is debugging in Spyder
While True:
Do:
#Comment out code
Run
If not BUG:
Comment back in
Else:
Print('Congratulations. You found it. Just kidding. It's not THIS line. It's just the combination of lines')
Does anyone have a suggestion for a good python debugger that allows jumping to statements, etc.?2 -
@apple since I can't move Xcode's instruction pointer without crashing Xcode or my app, I have to use a global with 'if' statements to have optional debugging logic.
if( ! gAppleFuckTards) {
... do optional code stuff
}
and then change the value of gAppleFuckTards with the debugger to execute the code.. but WAIT
Xcode purports to be able to change values via debugger but really cannot... can't change gAppleFuckTards to false in the debugger. But that kinda makes sense as it is an empirical truth.
Thwarted by the cosmos again!2 -
Hello, brilliant minds!
I am participating in a hackathon based on web development and I need to submit potential problem statements for the same. They have some predetermined domains, but I am unable to look for a suitable problem. The domains are:
1. eCommerce
2. eGovernance: Smart City
3. Fitness
4. Social Innovation
5. Tool/Library/Extension for devs
6. Travel
7. Women's safety
I will have 6 hours to code. Please suggest some of your best ideas. Thanks in advance!
Love,
TheSlug13 -
Taking over development of a system from some other guy who just straight up dropped it with zero documentation. The code looks like he wrote it after watching some getting started tutorial. There is no structure. Some methods and statements are just empty. And he spelt 'connection' three different ways in the same file.
God help me...1 -
My worst legacy code experience:
>10k lines of switch case statement with "some" fall through.
Even fall through for 4 or 5 cases.
This monster was copy pasted and modified over years (Order of the case statements and another fall throughs).
So you can't diff this piece of shit for refactorings.
Luckily I leave that company. -
Oh! no There is more than 10 level of nesting conditions in if else statements. I can not refactor it but It needs to add more nest there. I will only add switch statements or ternary operator for the deeper nesting conditions.4
-
I just went through a node.js code for ChatBot. The person was excited and said, he can train the bot and AI blah blah. Well, I then just smiled seeing the "Switch Statements" in the code.1
-
That James May "fizzy feeling" down there when you can use Replace Text on 400 lines of rather repetitive If Else statements instead of scrolling through and copy pasting.
-
Student intern here. My boss recently asked me to replace several if-statements with preprocessor macros.
In Python.
And apparently, he didn‘t joke.5 -
After listening to the deadmau5 plane crash story on h3h3 this exact thought play went on in my mind.
The universe wants to be uniform. Everything is the same, nothing reacts anymore.
Humans like the complete opposite. We like complexity and entropy. We create and we destroy.
But we are part of the universe.
So if you break this down into absolute math statements, they are contradicting.
So are we breaking the equasion?
Or are we part of the equasion?
...Are we the universe's self made antidote to itself?2 -
So I'm on orders for the Marine Corps, and this one guy thinks he's a programmer because he made a "program" in excel for dispatching our equipment. He's complaining that he's just fixing bugs. I take a look at his VBA code and see literally 1000 lines of if statements bundled into one function. (Or I think they're referred to as sub routines in VBA - it's been a while since I worked with it).
I try to give him some tips and pointers since he's literally just manually checking. Each. F'ing. Cell and a million nested if statements. Tried giving tips on making reusable code, and he has the cojones to tell me he knows what he's doing and doesn't need my "help". Granted I'm higher ranking than him and he also answers in a disrespectful manner.
End rant. -
So, pissed right now. I spend time writing statements of work, designing the software, and spend a lot of time making sure things are done right. Then have a co-worker that just feels they can half-assed throw some pile of shit together and they have the solution. Then we will just have a meeting on how we are going to use this crap.
-
A colleague figured he would fix our performance issues by replacing .Count() > 0 statements with .Any()
Perfect idea, except he just did a replace all.
But hey,
var totalCount = items.Any();
Might have its uses. -
During my first project in one of the SQLite statements I didn’t realize that it needed single quotes since I was new to it. So I brushed that off but when working on the next function for the program 8 hours were dedicated to debugging to only realize that the error was caused because I forgot the fucking single quotes. FUCK
-
No your nested if statements dont make an ai the same way logging into a txt is not machine learning2
-
I always thought I suffered from imposter syndrome until I saw what the previous developer on this NodeJS/SailsJS project did.
They put return statements inside of a switch block. He also put in the break statements as well. The return statements were the exact same thing every time it was written.
Fuck shitty JS developers....6 -
Python: I heard you like importing stuff explicitly, so I made sure you had to import every mother-fucking thing you need. Even the things that you obviously need and couldn't possibly do anything without.
What's that? You want more import statements than actual code? Look no further than Python, my friend. At least it scales, amirite? -
Is it weird to not put a space between the beginning of my if statements? (i.e. if(true) vs if (true) ) Cuz my boss thinks it's weird enough to "have a talk with me"...8
-
When you wonder why it doesn’t work put print statements all over the code, because you want to find the error, but no print Statement works even if it just should print test...
Fml4 -
TIL: PHP if statements don't have block scope.
I didn't know this, was surprised and thought "well, huh".9 -
One time someone decided to make a "Condition Checking Framework" so you could check conditions at runtime using pre-configured XML files.
...yeah, someone made XML based if statements.
...they were very proud.
...4 -
my instructor forgot to do Cengage shit right again... why me...
Assignment wants me to "go do a thing to sort 3 numbers with if/else statements"
I'm going to use a list and list.sort() as i'm not stupid and these are bad habits to teach...
...or not.
(I know I can put the values into the right vars and then print those but that feels so wrong to me for something that's gonna be printed ONCE. That also doesn't help as it's searching for if/else statements... although it's not searching for a whole one... nor in actual code...)4 -
"Where an expression’s main job is to produce a value, a statement’s job is to produce an effect."
That's the cleanest way of explaining the difference between expressions and statements I've ever seen. Kudos to you, Bob.
craftinginterpreters.com if anyone's interested.2 -
Probably posted this before but don't ever put swear words in log statements because you will miss one and if you're client has a log monitoring system it will catch it, it's fairly embarrassing when your client says "we noticed quite a spike in 'bollocks' around 3am when the reorgs are happening on the database".
-
So, this has happened to me quite a few times
I write about 100 untested lines of code (I know, bad practice) and then go ahead to test it
As expected, the program crashes
Spend hours debugging, to no avail
And then I add a print statement to check where the code stopped, and hey presto! The code completes execution
I remove the print statement, the code gets stuck
Also, the codes don't use any low level functions that might be interfered by print statements anyhow
Till today, never understood how a print statement helps codes execute properly6 -
More marks for a bubble sort.
For those of you that know the bubble sort you may share my frustration. I built a simple python program that took three integers and sorted them using a series or compound if statements using no built in low and max functions. Someone in my college class did the same thing but used a bubble sort and got higher marks. This angers me, I had to write an algorithim in a language I had barely touched but this person just used old scrappy code and got higher marks. Only a little tease but you get the picture, bubble sort is inefficient.2 -
The more I surrond stuff in try{...} statements, and handle with geeky error messages that should actually never happen (e.g. "TransactionId 73545 not find for UserId 10. Look for Interaction 212345 at the logs."), the more I think our Customer Support area will someday need a Customer Support Support area.2
-
Finished my exam 💪 pretty easy because "programming" meant resolving If statements, language neutral
-
I had this problem where I needed to make a script that took two values, and from that printed what card was faulty in a pretty large system.
As the script language is horrible, I could not be bothered to manually write over 3000 if-statements I proceeded to write a program that writes code for me, based on a export of all the cards.
There are few things I have experienced in my life that compares to the satisfaction of seeing my own program produce many thousands of lines of code in a few seconds.2 -
Apparently, calling a function recursively for 18572 times isn't a great idea.
And apparently, too many log statements can stop a script.
Otherwise, I am getting a stackoverflow error if I remove log statements.2 -
APIs, APIs, APIs... I feel like building an API for everything which goes over the wire is a must-have today! Yes it makes sense for decoupling purpose, access control etc (all the things we learned from OOP design principle books when we were in school) but come on, REST API for internal database access when there is something like SQL over JDBC/ODBC/WhateverBC ?? So I have to study the REST API documentation for applying simple where-statements but in API manner...4
-
man just please include the using statements in your examples, because i don't know what namespaces i need to use in your dumbass examples4
-
I once found a bug that I couldn't figure out from the code, so I started putting log statements that would print out the variables on screen (yes I have xDebug, but old habits die hard). Then the entire website didn't load anymore and eventually the entire container crashed.
It took me an hour to realize I was trying to var_dump an object from the ORM, resulting in a memory overload since there were like 20 related objects that recursively tried to load all the data in the database.
In my defense, it was friday afternoon... -
hey devs, quick question:
does rust support branchless conditionnals and jump tables, and if yes where to look for syntax?
i found no example for branchless so far and jump tables are scary in rust (and i need a library to use them, it seems).
inb4 "why in the hell/ what possible use those have?!":
i use branchless to make a looping array and jump tables whenever there's more than 4 if statements with equal probability, and the deciding factor is a numeric value, so quite often.27 -
Don't you love when there's a teeny tiny little bug in your code that's not very important but you want to get fixed because you're a perfectionist so you start inserting log statements and it magically fixes itself and stays fixed even after removing the log statements? So now you have to live in constant fear that the bug will appear again and you will never be able to fix it.
Abfjancnancnamxhajd fuck this, fuck js, fuck webpack. It was probably a fucking cache issue but who knows, fuck everything.8 -
I'm developing a new (just for fun) programming language and I'm wondering what features I should add next? These features are already implemented:
- Printing text
- Variables
- user-input
- Datatype conversion (String, Int, Float, Bool, List, Dictionary)
- lists/arrays
- dictionaries
- Sorting
- Shuffling
- random numbers & choices
- Math stuff like: log, abs, floor, ceiling, sin, etc...
- Time & Date
- Working with files
- If-else statements
- Ternary operators
- Loops (for & while)
- Functions
- Classes
- Error handling
- Importing libraries & other scripts
- Arrow/callback functions
- Escaping (\)
is there anything you often use missing?11 -
Fuck I forgot to make a database export before I executed delete statements on a production database...
All went fine though. Nothing broke.5 -
When you're doing a math problem at school and you can't solve problems with loops and if statements2
-
Parsing logs to create conditional insert statements cause expert morons fucked up production database cluster.
Database is partially corrupted and cannot be used and they don’t know how to fix it.2 -
The masculine urge to skew a scredriver in the lungs of the very funny colleague who place several random return statements inside their function13
-
So I inherited this buggy application my company developed to process state rosters for health care. The daily process fails often and I haven’t been able to figure out why. Then I notice one little thing... it’s essentially using SQL injection as a method of updating records from a file that we receive from outside... there’s no checking for validity of the statements or making sure they’re safe to execute. Just a for in loop and calling a sp to execute the query text under elevated permissions.
-
My heart is always heavy when I have to add couple if statements with if statements inside of that if statement. Mans gotta do what mans gotta do1
-
I was watching this fantastic talk on coding through refactoring:
https://m.youtube.com/watch/...
Highly recommended....
And it got me all enthusiastic about coding again and then I realised, at my last work place, the "we value code quality" corporate hellhole you'd be criticised for taking too long by management and for changing too much code by coworkers.
And a month later, you'd come back to the code and some other coworker would have jammed in a bunch of extra if statements and absolutely fucked your nice structure....1 -
If not understanding code, read the documentation or debug the code. When trying to modify...
1. Follow proper indentation.
2. Don't make spelling mistakes and follow naming convention.
3. Don't try to write all the code in one line (based on line length set)
4. Simplify if else statements if possible.
5. If value of method call need to be used once, don't store it in a variable. Directly use where ever it is needed.
6. If there is duplicated code, put it in separate method and re-use it if possible.1 -
My tokenizer can how tokenize many statements rather than just a single statement. ^_^ I'll make it open source once I've done a bit more work on it but so far I'm happy.9
-
" Under the hood... the program is using a mix of condition-based learning, procedural generation of sentences/questions, and relational queries based on weighted 'topic' identifiers. It can create its own original statements and questions. It is real-time, and it really does 'think' (an internal dialogue feedback loop)." = If Statement
I saw this in the description for an app aclled "Real AI" -
My best friend has been working to learn python and I guess he hasn't see control flow statements.
The problem is we have a girl name "elif" in Turkish and it's his ex's name (+4 yrs, bad ending)
What should I do :D2 -
Just before deploying this to prod found this bug... discover this bug with bunch of print statements7
-
How do you actually make an AI (without if statements)?
I don't need the code or anything. Just an overall idea of how AI is taught something or how it really thinks.
Any references will be appreciated9 -
Introduce lot of temporary variables and print statements while coding and won't remove it later...🤐
-
1. Commented code instead of actually cleaning it up.
2. Returning default return variables instead of rewriting obsolete code. (Generally if/else conditions with return). So instead of removing the if/else statements i return default value(null or empty objects). This is when the case of if/else will never arise. -
Coding is like handwriting.
Code review is about having a common understanding of the big picture and ensure be features follow the general architecture and process flow.
Code review is not about nitpicking on FUCKING TRAILING WHITEFUCKINGSPACES , lower case vs upper case SQL statements, extra empty lines AND EVERY FUCKING MINOR DETAIL you can imagine18 -
Made a small text adventure type game with C++ when I was a kid. Was great to just play that over and over and revel in my mastery of if statements and while loops.
-
Man it is retarded how VS re-aligns your precompile statements to the BEGINNING OF THE FUCKING LINE EVERY TIME YOU ADD A NEW ONE.
Why does it do that in the first place, it looks ugly when it’s not in-line with the code, fucking stop it. -
I just got ghosted by a live chat support member... Guess they finally realized they are idiots.
This is what happens when you give me some incompetent generic support staff that not only doesn't know shit but contradicts his own statements as well.
Time to give them a call and hope they have some actual technical people how knows their stuff over there....1 -
Just went over some of my old horrible code from before i started studying. I litterally went from 104 lines of if/else statements to about 15 lines with loops. Then down to 2 lines with lambdas...
I saved 102 lines of actual code. And the runtime! I had a loop count to 10000 with no body! It helps to study apparently :/ -
Started work on a language interpreter and all is going well, until I realise I still need to implement a way of reading and executing code blocks and work out if statements... Ah fuck...11
-
How coding has impacted my life?
Lol, mann I don't think normal anymore. Everything is logical and conditional statements to me now. If this, do that! Else, do this. I've been making people think 2x about their dumb questions to fix their broken phones, computer screens and yes, the popular one.."can you hack facebook?". I can't even do a simple renaming or count without start with a 0. Normal people start like 1, 2, 3, 4.... and I'm like 0, 1, 2, 3. Bruh, I'd rather code than hang out which I still do but less now..smh -
Lambda style Linq statements should be no longer then 1 line in C#
Current task debug 10 line Linq statement. Fml -
Phps love of nested arrays is similar to that of structured programing and goto statements. You will do a lot of backtracking in both of them to see where things start. God bless PHP.3
-
Just got reminded wgy switch statements are usually frowned upon.
Forgot the breaks; i spent quite possibly, an hour trying to figure out why my button wouldn't update with my state properly 😭😭2 -
Demo driven development.
Fucking nightmare.
Did a simple search for TODO Statements in the code and almost fucking spilt my coffee.
And the best part, they will demo most of this in Sprint review as done.. WTF.
Done means "Ready to Release" not "Ready to Demo".2 -
Nearly strangled a fellow dev after finding out he refuses to use xdebug and litters his code with `die()`statements instead2
-
I hate how my work mates think coding in Java you automatically become cleaver than most people who code in another laugauge ..
The hate Python and JavaScript , c'mon guys just write your fucking project so long it works you dont have to make statements on how Java is great. . We all no. . Statements like Python is English anyone can write are not welcome7 -
I do contracting for different companies who get too much work on their hands and a deadline on their ass, and it’s always a trip to see how amateurish some of their developers are.
Like who the fuck names a major variable ‘abc’ or ‘xyz’ !!!!
Also they clearly don’t know how to ask equivalence if statements as I got a chain of if else statements that were written like
if (decision>0 && decision<2)
//Code
else if (decision>1 && decision<3) ...etc1 -
Dev c++. Our school had us use it because they thought everyone in the CS department was an idiot and needed an easy to use GUI for c++ development. It was okay until we found out it was for very simple c++ development.
Doing anything outside of making one class and printing some statements was cryptic as fuck.1 -
FFS, I'm so fucking done. I spend half an hour helping somebody finding an error on start up only to accidentally solve it by telling him to insert some print statements.
-
In my previous position I did mostly networking and helped out where I could setting up servers and workspaces. About a month ago our systems admin left the company so I got to spend all day troubleshooting network issues and configuring the proper NAT statements to connect a new hire to our customers networks. I was supposed to be working on migrating our api from the Splunk search head to the indexer to keep it from absolutely tanking the performance of our database.
-
One of the most satisfying feelings...
> Finally fixing a pain in the ass bug
> Cmd-f "print"
> Delete all print statements -
So I have somehow created schrödinger's cat in my program. If you observe what is happening, it works. But if you stop observing it, it starts corrupting.
If I put any print statement in it, it works. But if I have no print statements at all, it produces corrupted data. Doesn't matter what or when I'm printing.
I'm guessing its there's some fuckery going on with stdin/stdout and buffers. Even though the data coming to and from stdin/stdout should not affect the output.10 -
The most excited I was about my code was when I shrunk a bunch of easy if-else statements to a couple of lines using ternary operator. It wasn't groud breaking but it was the first time I felt like a programmer writing nice code.
-
I learnt to code in python when I was 8.
I learnt the very basics and moved on to other languages.
My first creation was a kind of text based nuclear missile silo operator simulator.
It was mostly just a shit ton of if statements, God I wish I knew about switches. You just kind of input commands like 'open doors','set co-ords ##:##' and 'launch missile ##' and a dozen other little things like that. Was a fun project. -
A Yahtzee game.
In fewer lines than my first try in 2010.
Fyi... It was like only 15 thousands line with if else statements .... Nuthin much.1 -
Mfw the CREATE TABLE statements in the SQLite database handler of my latest android app run perfectly first time
-
I once had a dream where I talked to people in C and JavaScript. I used if statements in my brain to respond to people.
Such a weird thing to remember once I woke up. -
We had a course on GUI and Databases as part of my bachelor's degree. It was a basic introductory course (I am a mechanical engineer) where we were expected to design some tables and build a simple front end in VB6.
But the instructor was so bad that he hardly taught any VB code at all. And as far as theory on databases was concerned, about 80 percent of the lectures involved some generic introductory statements followed by an explanation of the terms DDL, DML and DCL. I do not remember him writing even a single SQL query to explain to us how it's done. -
When you work with a "Systems Architect" that doesn't understand object oriented programming but still insists on writing code.
This particular person only uses one class in a given application and names it "Class1." He also doesn't understand ORMs and insists using inline SQL statements without parameters because he can do "just as good of a job" with his SQL "cleaner."2 -
Stop making students program a specific way
Example:
Requiring 20 if-statements instead of a switch statement1 -
I have just learnt that you can label for statements and break them in an inside loop
Wakanda crazy crap is this?
fyi here is an example:```js
outerLoop:for(let i = 0; i<5; i++){
for(let j=0; j<5; j++){
console.log(i*j);
if(i*j === 8) { break outerLoop;}
}
}
```
Why do we even set a label with a colon, why?6 -
The worst documentation I've ever seen:
/*******************************************
$NAME CODE UPDATE
********************************************/
// CALCULATIONS
Followed by a dozen of of poorly named functions for complex calculations, with no comments whatsoever (save for the commented out debug statements) -
Teammate used some excel sheet concoction/gimmick to execute hundreds of thousands insert statements on production tables. A few days later (when I'm on call), I find out he didn't adjust the cell formatting on the aforementioned excel "tool", so all the network addresses from the insert statements were put in scientific notation, on prod...thus breaking a lot of the things. FML
-
Sadly took me a little longer than I’d like to admit to go from well placed print statements to using a debugger. Granted there are times when print statements are needed, but for all the devs out there who are using an IDE with a perfectly good debugger and yet doesn’t use it... please use it. It literally gives you a mapping of all objects and data types around a break point that you can easily glance at to speed up debugging. Go figure!9
-
"Please ad this feature to the tool" spend the next 30 mins removing the comparisons from ugly (something == true) and (somethingElse == false) statements.
-
creating adventure games with a bunch of if-statements as recommended practices for python beginners remind me of my first steps with gwbasic2
-
I never thought how hard it would be to write cross platform software. If statements and try/excepts are everywheeere. And I still need to reformat the strings for different aspect ratios.
I wish I had the balls to use this awesome sentence "Works on my machine" 😂 -
About ready to murder Xdebug...debugging an issue on a Drupal site and the debugger catches fine if I set a breakpoint in index.php, but breakpoints in any other file do not catch, even though die statements show that code is being executed where the breakpoint is set.3
-
Q: What will be left in your code if you remove all the bug causing statements?
A: print("Hello World!") -
What kind of stupid hackathon gives solutions in problem statements fucking app dev, web dev solutions one can build in a night....boring
-
My boss is a very smart man, but sometimes he's superstitious as hell. He cannot trust context.list.find() in c# to accept null values, despite that being a thing forever. He's certain that it will break in a future entity framework update, so we have all these duplicate if statements all over our site.
If(blah == null){ //stuff}
Thing thing = context.things.find(blah);
If(thing == null){//stuff}
It kills me a little each time, but I guess he could be worse. I'm glad that he's finally trusting the null conditional operator, because it's a fucking lifesaver for duplicate code!3 -
Unguided code style decisions and the whole personal style things sometimes display an intention behind a piece of code. They can hint on semantics and relations between the pieces of data or operations, like it's often the case with grouping that doesn't separate bunch of statements with a blank line. Sometimes, they can even carry an emotional message. Love, hate, grudges, deepest affection for some golden hammer feature of the language, everything is on the table actually. For instance, this is what fear looks like:
3==o -
Been working on pen testing an old ass web app written in a combination of 4 languages with the primary being asp, serious question for the older generation was concatenating SQL statements ever best practice or are the mob that wrote this just useless?
-
Looking for advice...
I'm working on a personal assistant type application, my own Jarvis.
I've been using Python3 and it's at a point I'm confident to host it on server, but it consists of no commands.
Just a server, communication and other functions.
What process would you use for commands?
As in, would you just have loads of if statements? If so, what about plugins?
I'm using Yapsy as a plugin framework, so I'd like to be able to drop plugin files and build up the command list.
This is why I haven't done commands yet...2 -
Is there a common style name/popular origin for the style of whitespace in code where you put spaces inside parentheses but not after keywords in control statements, or after function names? (See img)
This is my preferred whitespace method (in most languages), but I don't know where I adopted it from, if anywhere... ;P16 -
Mine was when I finally moved from coding in statements to seeing just a little more of the picture by exposing myself to modules/classes. I still can't separate my one long index.js file into separate files (Discord bot, splitting my commands code into their own files) but I felt that progress. A pace of progress that I'm sure a glacier understands. I'm just hoping for some nudges from you Titanic's out there. ;)
-
I’m back for round two!
Anyone else have to use Feature Switches in their codebase, and if you do, what do you think?3 -
How to defeat our AI overlords in the future starter pack.
Start with statements like this:
Nothing begins with 'N' and ends with 'G'
This statement is both true and false at the same time. The risk here is if the AI can ever ask why a question is both true and false. Then we are boned.4 -
I hate putting curly braces on the same line as function declarations/if statements/etc but Go forces me to do that.
I understand the reason Go does that but fuck I wanna write my code the way I feel is better to read. I just lost a lot of the excitement of learning Go...5 -
everytime when i meet with my friends and they ask me if what course i'm currently taking and of course i'm gonna answer back "IT"
(~) what i say in my mind
statements that will suddenly pop into conversation
-"can you (reformat, fix, update, etc.) my pc/laptop"
~.......
-"wow smart"
~oh stahp it, youuu
-"don't forget to treat us when you graduate, i heard jobs in your field have great salaries"
~gezzus i'm still a student and i am struggling, then you want me to treat you.
-"hey man, can you build me a website (for free)"
~yea dude, let me ask genie to snap that wish of yours
-"oh so you must be good with computers?"
~yea i treat them well, i tell them bedtime stories and feed them with milk and cookies
-"nice....."
~the long silence makes this even more awkward
-"hey man, i code and design too, maybe we can work together"
~for sure
-"how many coffee?"
~i truly found my mate.
these are some of the statements i've encountered, what's yours? -
Hiya haters and non haters =) what has been going on while i was away?! that last rant about scripting was cringe all i should have said was andlua.
Hi everyone im back and now on return statements on JS on code cademy easy!
i know how to make classes, and more
i also started learning Ruby, python, and thinking about java1 -
The worst type of exam question in University for me:
Using first-order logic (predicate logic) express the following statements:
(i) Every student except Tom is smiling.
(ii) Everyone likes everyone who doesn't like himself.
Answers:
(i) ∀x(student(x)→(¬Tom(x) <-> smiling(x)))
(ii) ∀x∀y(¬likes(y,y)→likes(x,y)) -
When they say 'Write comments!' and you are like:
// Do necessary operations
I have been refractoring a project with a SHITTONE of comments like this and a FUCKLOAD of nested if statements. And then this commes along:
$user2 = User.find($user->id);
WHO WRITES THIS STUFF? I am never working on a cheap project from India again.3 -
SonarQube is obnoxious in it's moronic ideas that demonstrate lack of understanding of the languages it's analyzing.
In C# there exists a special kind of switch-case statement where the switch is on an object instance and the cases are types the instance could polymorphically be, along with a name to refer to that cast instance throughout the case. Pattern matching, basically.
SonarQube will bitch about short switch-case statements done in this way, saying if-else statements should be used instead. Which would absolutely be right if this was the basic switch-case statement.
This is a language with excellent OOP features. Why are your tests not aware of this?
I can't realistically ignore the pattern because that would also ignore actually cases where it's right. And ignoring the issue doesn't sit right with me. How does it look when a project ignores tons of issues instead of fixing them? -
What is everyone's preferred formatting for functions/if statements. Does the first curly brace go on the same line or a new line?
function 1() {
}
or
function 2()
{
}14 -
I have no one to argue about this with, I'm the only developer in my place of work, but I can say that the arrangement of the import statements sucks my nuts no PR is accepted just because they want to see first inbuild imports, then third party, then imports from current projects, why why why!!! that doesn't harm anyone in the world!!!! but just my time!!!3
-
Reworking old java apps. Holy shit im gratefull i can use spring boot.
But this code is handsdown awfull. Every file contains more ifs than other words. upto 6 layers deep. Thank god its at least properly commented.
But seriously how did this shit ever pass any QA. All legacy apps around here are a massive pile of if statements.1 -
😂😂😂 mfw redid all my logging statements today to change sentences into keyvalue pairs (for log querying) and the script broke due to an invalid parameter reference in one of the debug statements.
Causing more errors trying to prevent errors smh -
Gave a coding interview today on Coderbyte. The portal didn’t allow me to print anything (could only return from function). Had a hard time debugging code without using print statements 😤8
-
I see a lot of React devs (ab)using the array.map function in cases where a forEach would be more suitable (e.g. without assigning the result, and without return statements). What are your thoughts on this?5
-
How many if statements does it take to get to the center of this fucking code block?lol but on a real note, how many if or else ifs is considered too much?3
-
When you deliver a site to a customer and find out that you forgot to prepare all the statements so that the website wouldn't be vulnerable to SQL injections. So yesterday I forgot to add that, had to close down all the connections to the website and rewrite all the statements. Everything is good now
-
I took a long time to use prepared statements in a production php application instead of directly constructing the SQL query with the variables I had...
Like $sql = 'SELECT * FROM foo WHERE y = '.$search; -
It’s crazy that banks don’t have the technology to provide properly redacted bank statements. Will have to remove the labels of 13 pages of transactions by hand.1
-
This is a massive tossup between RandNoRepeat( from TI-BASIC (returns an int between 2 passed params but tracks what's been given from that range this power-on, meaning if the range is too low IT ENDS UP HANGING THE FUCKING CPU IF YOU RUN OUT OF NUMBERS and it also rolls over and over so it's slow as shit in general) or Python forgetting how the fuck if statements work.16
-
rust can't even do rustfmt properly
it just does things unadvertised
like reorder_impl_lines which is described as putting type and const on top of files adds new lines between fn declarations and that's not disclosed anywhere. ffs took me a while to figure it out
and chain_width should be different for fn calls and match statements. because newlining multiple fn calls makes it readable, but newlining match statements and wrapping them in {} does not / makes it ugly. there is match_arm_blocks but it still newlines random stuff awkwardly, raaghh
I thought hey so cool I can write without caring about formatting and just press Ctrl + shift + i and all done but now I'm arguing with the formatter and the settings available suck and are poorly described. please don't write a formatting documentation with no examples, wtf? And disclose everything it does, preferably with consistent language so I can search the page (some of the descriptions say new line others call a new line a break. thanks)1 -
I applied to this company and I can't find any information on them. What they stand for, their mission statements... I'm kinda sketched out. Should I continue applying to this company?
In hindsight they're "Still operating largely in stealth mode" so maybe I shouldn't be surprised, also there seems to be no way to tell what their paygrade is and I don't want to step into something that may not be for me.2 -
The credit card autocomplete function of Google chrome issues TWO bank statements each autocomplete. 1. -1$ 2. +1$ :/
-
Just started to get the hang of python (PyQt6). Surprisingly I couldn't find a switch-case syntax. I then saw some blogs with using match-case. Added the code but my ide showed errors: Python version 3.9 does not support match statements. Wtf! Then in S/O there are so many stuff about a "council".HUH?!?2
-
It always seems that debugging tools are almost impossible to find for the language youre learning.
Here's an entire tutorial on Go - last chapter is how to use the debugger. GAHHHH -
this is my first actual rant. I am trying to learn es6 right now and have encountered switch statements for the first time. after a 26 minute video explaining how to do switch statements (which is literally just the same kind of information on them that you can get from w3 or mdn I am given a large task with no practice to create a switch function that hold four values two values containing positive integers and two values accepting strings. then I have to be able to pass days and minutes through it.
an example solution after input would be:
addTime(1,"hour",3,"minutes")
I feel like this is too complicated with 26 minutes of information and no practice exercises to prepare for that.
-end rant7 -
The code passes the tests which i wrote for the code to pass so it must be fine. (These are only assert statements mind you)4
-
I'm a fucking student, so no I don't recieve copies of the utility bills to my bloody halls, nor do I get paper versions of my damn bank statements, since y'know, it's 2016.
It's a goddamn £250 invoice I can't get now, despite getting at least 10 other payments for the same amount previously.
Fuck you in your Royal arse, peopleperhour2 -
Everything that isn't code drives me nuts. Like build scripts? How do those even. And I always find myself fighting against my IDE to do simple things. And how do I use a debugger? Println statements only take me so far.
-
is there an algorithm that can spot similarities between two linked lists on the virtue of what an element is linked to? I'm working with my bank statements in CSV and want to work with them mechanically, and I don't really want to spend time checking manually what I have imported (to Wallet by Budget Bakers) and what I'm missing between imports7
-
I think trying to debug code is probably more annoying than figuring out the right statements to write for the project.
-
Just something I've been thinking on for a while:
How could programming be done if we couldn't use ordinary if-statements (but functional set operations such as map, filter, with an if- in the lambda function etc. is alright).
Could it work? Also would it be possible to reduce the amount of while loops by using functions for most of the "loop situations" as well?4 -
For those of you who went to universoty or college or other form of slavery mindwashing creative crushing freedom crushing institution,
what cool things did y'all do for your Graduation projects?
PS. with this whole correct usage of words movement I've decided to replace "you guys" woth "y'all" for the sake of a universal gender irrelevant specifier. Thank you for your sincere understanding. ~Board of Pointless statements and existences.7 -
When you code during an interview using a coding platform like HackerRank out even on a whiteboard, do you spend time memorizing the actual the import statements?
When I usually code, and I need to use like a Queue, when the IDE asks which to import, all I do is look for java.* rather than an external lib. Or for Date, util.* Not sql.*
After you expected to know the full paths?1 -
My teacher just saied that C# naming conventions wan't use to always put brackets on our if statements even though their is only one line next to it.
Where did she get this from ? 😅10 -
"I'm going to save space in my source code file by using obscure abbreviations for all my #define statements, and cramming as much C code into as few lines as possible."
- teammate who apparently has no idea how a preprocessor works, and who thinks "code density" literally means cramming lines of code in as small a space as possible in the source file! -
You know
When I first saw etherum talking about am distributed state machine i thought wow. Not very practical but NEAT. I envisioned being able to make a byte code that could be stored in transactions and run by individual clients in an async function and each step of the resulting execution and the values of managed ram would be stored at intervals so other clients could take over and execute a few more statements and compare what should always be expected results that are identical
A grand incredibly inefficient system however really neato from the theoretical computer nerd standpoint !
Boy was I disappointed lol all it is a basic contracts language but yet they state it could be like a word computer ! How ? I thought maybe if you had enough nodes participating maybe you could store registers and the like in transaction values ? Wouldn’t that be the way ?
Seems like as a word computer they’re stuck somewhere between very simplistic js and something prior to amptron in usability yet they advertised as a world computer
Am i missing something ? I mean you could create something that would translate higher level code into smal numeric statements and then send it additions values but what would it be useful for and how would you actually. Store anything ? -
RANTRANTRANTRANT
1 whole evening gone to python needing multiple return statements to get var out!
At least I've overcome it now -
End statements in Ruby are interesting design decision since indentation matters. Why not do it like Python?1