Click here to Skip to main content
15,910,303 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 19:50
Super Lloyd21-Jul-20 19:50 
GeneralRe: Confused by team mate... Pin
Jon McKee21-Jul-20 19:55
professionalJon McKee21-Jul-20 19:55 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:13
Super Lloyd21-Jul-20 20:13 
GeneralRe: Confused by team mate... Pin
David O'Neil21-Jul-20 20:26
professionalDavid O'Neil21-Jul-20 20:26 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:34
Super Lloyd21-Jul-20 20:34 
GeneralRe: Confused by team mate... Pin
Jon McKee21-Jul-20 20:50
professionalJon McKee21-Jul-20 20:50 
GeneralRe: Confused by team mate... Pin
David O'Neil21-Jul-20 21:05
professionalDavid O'Neil21-Jul-20 21:05 
GeneralRe: Confused by team mate... Pin
F-ES Sitecore22-Jul-20 1:31
professionalF-ES Sitecore22-Jul-20 1:31 
Jon McKee wrote:
There's no point in involving a Queue in the first place

In slight defence of the coder in question, selecting the data type that matches your data is actually good practice. eg you *can* store a date as a string;

"2020-07-22"

save it in SQL as a string, retrieve it and show it or parse it to DateTime if you need to add\remove days to it, convert back to string and save again. But we don't and I'm sure I don't need to explain why. Similarly people use decimal for currency when they really shouldn't. In the original code a List was used to process something that isn't best represented as a List, it was data used as a stack or a queue so using Queue makes that explicit. Also I don't think accessing the last item of a List using an index is very efficient.

The biggest failing in the code is obviously not just dequeuing regardless, that bit is silly and not very readable.
GeneralRe: Confused by team mate... Pin
Jon McKee22-Jul-20 9:21
professionalJon McKee22-Jul-20 9:21 
GeneralRe: Confused by team mate... Pin
F-ES Sitecore23-Jul-20 0:30
professionalF-ES Sitecore23-Jul-20 0:30 
GeneralRe: Confused by team mate... Pin
Jon McKee23-Jul-20 12:33
professionalJon McKee23-Jul-20 12:33 
GeneralRe: Confused by team mate... Pin
Johnny J.21-Jul-20 21:22
professionalJohnny J.21-Jul-20 21:22 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:00
mveOriginalGriff21-Jul-20 20:00 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:12
Super Lloyd21-Jul-20 20:12 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:14
mveOriginalGriff21-Jul-20 20:14 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:35
Super Lloyd21-Jul-20 20:35 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:38
Super Lloyd21-Jul-20 20:38 
GeneralRe: Confused by team mate... Pin
OriginalGriff21-Jul-20 20:18
mveOriginalGriff21-Jul-20 20:18 
GeneralRe: Confused by team mate... Pin
Super Lloyd21-Jul-20 20:36
Super Lloyd21-Jul-20 20:36 
GeneralRe: Confused by team mate... Pin
Sander Rossel21-Jul-20 21:49
professionalSander Rossel21-Jul-20 21:49 
GeneralRe: Confused by team mate... Pin
5teveH21-Jul-20 22:24
5teveH21-Jul-20 22:24 
GeneralRe: Confused by team mate... Pin
F-ES Sitecore22-Jul-20 1:35
professionalF-ES Sitecore22-Jul-20 1:35 
RantRe: Confused by team mate... Pin
MehreenTahir22-Jul-20 4:14
MehreenTahir22-Jul-20 4:14 
GeneralRe: Confused by team mate... Pin
Super Lloyd22-Jul-20 5:00
Super Lloyd22-Jul-20 5:00 
GeneralRe: Confused by team mate... Pin
Marc Clifton22-Jul-20 4:14
mvaMarc Clifton22-Jul-20 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.