Hundreds without power due to 'potentially dangerous situation'
Hundreds without power due to 'potentially dangerous situation'
Woman who posed as sex worker admits manslaughter of two men she drugged
Ukrainian oligarch's wife speaks out and says she is NOT the woman 'whose limbs were blown off in Monaco bomb attack' - as 'police probe tycoon's alleged links to €100m scam'
DAN HODGES: The PM had just two things in mind - saving his tarnished legacy and throwing a spanner in Burnham's works
The long overdue military blueprint: How ground troops and manned tanks will make way for drones and crewless submarines...
Labour MPs warn Andy Burnham that his 'Manchesterism' vision risks shedding support in the countryside and impoverished south
Indefensible: PM finally unveils his defence plan - but there's a £5bn black hole, the MoD has to make £10bn in cuts and there is STILL no date for spending to hit 3% of GDP
Starmer's defence plan is woefully inadequate and the price we could all pay is unthinkable. Will Burnham do any better? Our enemies are watching: GENERAL THE LORD DANNATT
Charlie Kirk's parents and widow Erika to confront assassination suspect Tyler Robinson next week as they attend key murder trial hearing
At first testosterone worked wonders - and put a twinkle in my eye. Then something totally unexpected happened. My generation are guinea pigs in the hormone revolution: NADINE DORRIES
All we know after 'serious' plane crash in quiet Essex village
Man part of 'violent group' avoids prison over Epping protest disorder
All we know after 'serious' plane crash in quiet Essex village
Serena Williams' adoring children watch their mum bow out of Wimbledon Singles as her Centre Court comeback ends in Round 1 defeat: Family, friends and fans cheer 44-year-old's amazing return - after getting back into shape with the help of fat jabs
Severe delays on A12 as closure could be in place for 'several days'
Orlando airport staff force 800 travelers from UK to wait FIVE HOURS for luggage - then warned them they'd be 'arrested' if they left without their bags
Representative Line: A Specific Key
Today's anonymous submission isn't really a WTF, but it highlights the hardest problem in computer science: naming things.
For example, let's say you saw a method called handleRSAPrivateKeyGeneration. You'd likely assume that it generates an RSA private key. More specifically, it accepts a request for a private key and handles that request. It's right there in the name.
public String handleRSAPrivateKeyGeneration( @RequestParam(value = "algorithm", defaultValue = "EC") KeyAlgorithm algorithm,… )Except this function accepts an algorithm as a parameter. That's not bad design; it makes sense to inject implementations like that. Though in this case, it looks like it's injecting a key that can be used to look up the actual implementation, which I like less, but I don't know the rest of the implementation, so we can let it slide.
So there's no WTF here. It's a badly named function that may not return an RSA key, but does return a valid cryptographic key. By default it generates an elliptic curve key. Presumably as an armored key, since it returns a String- and the armor usually supplies enough of a hint that consumers can infer the key type. Our submitter tells us that this function is part of a Java Spring controller, and returns a string because the result is displayed in a web page.
No WTF, but it does highlight how sometimes being too specific with your name can make the name less clear. handlePrivateKeyGeneration would be a better name, since we don't know exactly what kind of private key it's generating.
Names, as always, remain hard.