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 - "elif"
-
So Python doesn't have switch-case statement... I feel so dirty having to use multiple if-elif-else
*sigh*12 -
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 -
What I fear most is the "I used to be a developer like you" type of client.
No, that's not how any of that works.
No, noone uses that anymore.
Please stop trying to correct me.4 -
"A Single Line of Computer Code Put Thousands of Innocent Turks in Jail"
I'll leave the title as it was, but people were hunted down just for having been once logged by a tracking pixel inside a messaging app.
Simply terrifying, I hold that off for a while, since it sounded like the usual fakes, but it seems its not, as more and more keep confirming it.
"The government eventually exonerated 11,480 of the wrongly accused, but some had already spent months in prison, and reportedly some even committed suicide."
"Elif finished dressing her youngest and watched police search her family's home before they took her into custody — for using a messaging app the government deems seditious.
She knew the arrest was coming. She'd already lost her job, because traces of the app known as Bylock were found on her phone"
"The regime relies on logs from the country's ISPs to identify users of Bylock, fingerprinting them on the basis of their communications with Bylock's servers. These communications can be triggered without using Bylock, though: Bylock's tracking pixel was used for analytics for pop-up ads and in at least eight apps."
https://m.slashdot.org/story/336657
http://cbc.ca/beta/news/...
https://boingboing.net/2018/01/...7 -
I used to write HTML line by line.
and then someone showed me emmet.
life has never been the same since.4 -
Else if, elif, elseif, if else garrgghj. I can never remember what it is in whatever language I happen to use...13
-
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 -
I'm about to move to a new city and one of the websites I'm using adds its name, url and ©️2018 to anything you copy. It is driving me absolutely insane. Trying to find an adress on google? Well you didn't search for [streetname], you searched for [streetname, website name, url ©️2018]. Thank you for copyrighting that public street you fuck. Trying to e-mail an agent? Sorry I can't send an email to [e-mail adress, website name, url].
Whoever thought of this needs to be taken out back and shot.2 -
These guys who only know Python and fuck you up, because you are used to write "true" instead of "True", or "else if" instead of "elif". Finally they laugh about you, because you are not able to "remember this simple syntax"!!!2
-
#on a mission ;)
def vacations_started_yay():
devrant.uninstall()
for i in range(60):
if(i%7==0):
devrant.install()
elif(i%8==0 ):
devrant.uninstall()3 -
...just download our new app! NO! FUCK YOU! What do you think you deserve storage space and permissions on my phone? Make a responsive site or webapp or I will not use your service. Why does everything need a fucking app? Oh, you bought a new car? Download an app! New appliance? DOWNLOAD A FUCKING APP! Just bought a new Samsung phone, but already use all of Googles empireware? WELL HERE IS ANOTHER CALENDAR/MAIL/EVERYTHING APP FROM SAMSUNG THAT YOU CAN'T COMPLETELY DELETE! This needs to stop.
/rant
Thank you for listening2 -
Mind blow of the week: JavaScript has no "else if".
It's always two tokens. Not one. It's NOT like python's "elif".
It's ALWAYS chaining an additional and DISTINCT if statement in the else clause of the first. It is NOT creating multiple comparison paths in the same if statement as it would seem.
For example:
if(a) console.log(a);
else if(b) console.log(b);
else console.log(c);
Simply needs more proper indentation to show which "if" the "else" actually belongs to:
if(a) console.log(a);
else
if(b) console.log(b);
else console.log (c);9 -
Coming to the end of beginners python and added a new loop to a number guessing game and now my elif is invalid syntax.19
-
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 -
Does anyone else read about a new library/framework, get really excited about and can't wait to get home to try it out?
-
My fellow devs, appreciate what you have right now, even if it doesn't seem that great. I've recently switched majors from Bioinformatics to Medicine and I wouldn't say I regret it, but I do certainly doubt this decision sometimes. While studying Bioinformatics, I was always really interested in the biological part, often wanting to learn more about medical topics and such, thinking if I did switch, I could always keep programming as a hobby. Now I did switch and I miss being in a professional CS field so much. Medicine is great, but the people who study are mentally completely different from people that code. I still code small projects on the side, but don't really have anyone to talk to about them and I'm even starting to regret not paying more attention in linear algebra. I miss linear algebra, think about how ridiculous that is haha. Anyways, if you are looking forward to a major change in your life, it might not be all that you think it will be. So look at your current situation, it might be what you wanted all along.
Thanks for listening.
.
.
.
Also it is incredible, how technologically incompetent most medical students are lol4 -
What are the skills that are essential for developers and computer scientists in general but are disappearing/rare.
Ill start it off with sayin probably the relation of a developers code on a hardware level, i dont see many programmers knowing about what happens under the hood when he chooses an if over a switch.
What do you think?4 -
def examMonth():
for exam in exams:
while days:
if time ≥ week:
pass
elif time == days_3 or time == days_2:
book = open_book()
study(book)
else:
panic_and_devRant()
days = days - 1
def study(book):
see_open_book()
delay(minutes_10)
devRant()