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 - "what-the-func"
-
DISCLAIMER: I swear to god this is true. This is a completely unfabricated anecdote.
Soon we are moving to a new office space, and my department have been delegated the responsibility of moving all of the computers from the old work space to the new one. I was a little confused at first, because I'm a software developer, not a removalist.
It gets better.
We just had a meeting the other day, and my manager had advised us that we were to be moving the machines on a Saturday. I confirmed whether we were being paid overtime, simply because I had never worked a Saturday before. My manager replied (this is paraphrased but ultimately accurate) - "It's unpaid. Because you get paid a salary, you're expected to do unpaid overtime here and there. We have christmas parties and nights out, all of which come out of the companies pocket. Not all companies do this, so it's only fair you give back".
I honestly couldn't believe it. I was being asked to spend basically the majority of my day off moving computers from one site to another, for free, purely because it's "expected". Am I the only one who thinks this is crazy?
Long story short, I went home and started updating my resume.18 -
Hello.
C++ is mysoginist, patriarchal and i propose the 'friend' keyword be removed as it oppresses weak people like me and the developers of lang are fkin racist neo nazis and hope they die in hell for what dey did.
It has just come to my attention that if a class declares another function or class as 'friend' the other func/class can access the private members of the said class. I haven't also coded even a day in c++ but that information is irrelevant as of now.
THIS IS VERY OFFENSIVE TO ME AND SENDS ALL THE WRONG SIGNALS TO SOCIETY. Just because i call you a friend does that mean you can grope me in public? How can women be safe if their private parts can be accessed by any of their friends?
WOMEN ARE OPPRESSED IN WORKPLACES AND I TELL YOU ITS ALL C++'S FAULT. I WILL NOT TOLERATE THIS BIGOTRY YOU FILTHY
UNCULTURED SWINE. IF THIS SHITTY KEYWORD IS NOT REMOVED I SWEAR TO GOD ILL HAVE THE MF PRESIDENT BAN C++ WHO DO YOU THINK WE ARE YOU FKIN MORONS.8 -
Client: "We need a quote for a website build."
Me: "OK. What kind of website?"
Client: "We are working on a brief now, but we need a cost ASAP."
Me: "Alright. It should cost between $X and $Y. Dependent on the brief."
Client: "We can't go back with a range. We need a set price."
Me: "Well, give me a solid Functional Specification, and I'll give you a price based on that."
Client gave me a Func Spec. I gave them a price. Then they gave me change after change after change...
But they refused to pay more than the initial fixed price. By the end of it, I would have been better off working at McDonalds.4 -
Found this gem in my news feed yesterday and can't get it off my mind: catch exception, sleep, goto try-block and, well, try again:
$attempts = 0;
start:
try {
$attempts++;
// (...)
} catch (Exception $e) {
if ($attempts <= 10) {
usleep(100000);
goto start;
)
}
Did we go full-circle? Is "goto" the next big thing? Is this a late april fools joke? What am I missing here? This can't be real.
Source: https://blog.frankdejonge.nl/back-t...4 -
#define someError ( -1)
int func(params *param)
{
//some code
if(condition)
{
someError ;
}
}
Spent like half and hour on debugger thinking why the fuck does it skip my statement. My manager who was passing by saw me puzzled and asked if he could help, so we spent another 10 minutes without success(tho my manager is technical guy but he had an unlucky moment I guess). Eventually senior manager saw our wtf faces and asked what is going on, it took one question for me to light the bulb "someError is a macro right?"
I guess you can imagine my embarrassment at that moment..
PS: Forgot return keyword before the error code. -
One of the many good things about F# is that it seamlessly integrates with the .NET ecosystem, right? Very handy in an enterprise environment where in order to get anything done you have to use in-house nugets and tediously building a C# app for something you can do in about 30 LoC in F# just doesn't make sense...
... And then you run into the one fucking namespace in the whole ecosystem that just DOES. NOT. WORK. with F#. What the actual fuck M$?!
In all other cases Func<T',Task> in C# translates into T' -> Task in F#, but not here. "Oh, you're trying to give me Func<T',Task> -> Task? Can't do". Fuck that.9 -
when the swift language cannot infer the generic type from the invocation, it also doesn't want you to explicily specify generic type in the bracket...
says i have a method:
```
func createDeferred<T>() -> ABC.XYZ.Deferred<T>
```
then if you call it like this:
```
let dfd = createDeferred()
```
It complaints that it cannot infer generic type T, which make sense.
But it also doesn't want you to code it this way:
```
let dfd = createDeferred<Int>("countProperty")
```
if you do so, it mumbles gibberish: "Cannot explicitly specialize a generic function".
What it actually trying to say is, you should put the type somewhere else so that it can show off its smartness to "infer" it from there:
```
let dfd: ABC.XYZ.Deferred<Int> = createDeferred()
```
with a few more typing and findout what exact type it is, it finally works.
the moral of the story is, in order to communicate with the wonderful work apple genius made, you don't tell it what is the answer straight away, that's defiance, you must hide the answer somewhere intricately and let the smarty swifty swift to find it out for you.6 -
//In the code block below. What are both self methods refering to? do both self methods refer to the Suit enum because it is inside the enum block? I am trying to better understand self. Please see link for expanded question.
enum Suit {
case spades, hearts, diamonds, clubs
var rank: Int {
switch self {
case .spades: return 4
case .hearts: return 3
case .diamonds: return 2
case .clubs: return 1
}
}
func beats(_ otherSuit: Suit) -> Bool {
return self.rank > otherSuit.rank
}
}
https://code.sololearn.com/c9KIG0ab... -
first() function in python...
Because it does not exist
Why have a any() that returns True if any of the items in iteratable are True
But what if I need to get the item itself...
In C it's as easy to write as the any func The performance will be the same6