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.
David Beckham is praised by Aryna Sabalenka as Wimbledon's Royal Box empties out after men's tennis finishes
Japan wants 10 million more robots by 2040, some providing medical care
Once failing school named as best in the county for 'making a difference'
Trump Drops Restrictions On Anthropic's Mythos and Fable Models
Read more of this story at Slashdot.
Young girl bitten by rabid bat while climbing tree outside her family home
The bloodcurdling 'traditional welcome' prisoners gave baby Preston's killer Jamie Varley that left him sobbing in his cell
Fears over 2000 new homes plan on 'irreplaceable' 800-year-old nature reserve
Chinese asylum seeker boat intercepted off Queensland coast sparks questions over Australia's border security
Adorable newborn baby boy wearing just a diaper is filmed being rescued from Venezuela earthquake rubble
‘Rapid and substantial improvement’ at Braintree school praised by Ofsted
Large families say bins are overflowing between collections in new waste scheme
All the Essex postcodes that won prizes in the People's Postcode Lottery in June
All the Essex postcodes that won prizes in the People's Postcode Lottery in June
Former Indonesian minister and startup hero jailed for Chromebook buys
New Florida Law Bans Local Net-Zero Emissions Policies
Read more of this story at Slashdot.