Mother of Israeli hostage snatched by Hamas at Nova festival hopes peace deal talks will see her 'strong, beautiful' son released
Gary Neville's builder backlash: 'Angry' workers who he ordered to remove Union Jack hit back and accuse him of suppressing free speech
Representative Line: Listing Off the Problems
Today, Mike sends us a Java Representative Line that is, well, very representative. The line itself isn't inherently a WTF, but it points to WTFs behind it. It's an omen of WTFs, a harbinger.
ArrayList[] data = new ArrayList[dataList.size()];dataList is an array list. This line creates an array of arraylists, equal in length to dataList. Why? It's hard to say for certain, but the whiff I get off it is that this is an attempt to do "object orientation by array(list)s." Each entry in dataList is some sort of object. They're going to convert each object in dataList into an arraylist of values. This also either is old enough to predate Java generics (which is its own WTF), or explicitly wants a non-generic version so that it can do this munging of values into an array.
Mike provided no further explanation, so that's all speculation. But what is true is that when I see a line like that, my programmer sense starting tingling- something is wrong, even if I don't quite know what.
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.Cut business costs in Budget or cut growth, accountants tell Chancellor
Prince Philip's expletive outburst that endeared the Duke of Edinburgh to his guests, royal insider reveals
The hidden factors that raise your risk of motor neurone disease - as Lewis Moody shares his devastating diagnosis
Crypto market in the UK could grow 20% thanks to imminent bitcoin ETN launch
Essex boy, 11, was so ill before tragic death he couldn't even open Christmas presents
In Jilly Cooper country, every man wanted to be in the saddle, and every woman was yearning for a good hard gallop, writes CHRISTOPHER STEVENS
The exact date a new Essex Starbucks will open in former Little Chef location
Over-50s invited to share their sporting memories at Witham Leisure Centre
Essex country club submits plans for air dome to allow use of tennis court in winter
Essex’s most popular primary school with ‘the highest expectations’ for pupils
'She's not Madeleine McCann': 'Polish Maddie' breaks down in tears as she goes on trial accused of stalking Gerry and Kate
Why I'm convinced Starmer must have played a role in the collapse of this prosecution: TOM TUGENDHAT
Peruvian bishop is accused of having 17 secret lovers after being exposed by cleaning lady... as mistresses started fighting over him
'Never again': Robert Jenrick will pledge to end two-tier justice as he warns the Sentencing Council is 'not fit for purpose'
Quarter of UK University Physics Departments At Risk of Closing, Survey Finds
Read more of this story at Slashdot.