Click here to Skip to main content
15,914,780 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
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 
I posted this response to someone else in the thread, but OP might want to see it too.

--

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.
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 
GeneralRe: Confused by team mate... Pin
Super Lloyd22-Jul-20 4:59
Super Lloyd22-Jul-20 4:59 
JokeRe: Confused by team mate... Pin
abmv22-Jul-20 4:30
professionalabmv22-Jul-20 4:30 
GeneralRe: Confused by team mate... Pin
W Balboos, GHB22-Jul-20 5:01
W Balboos, GHB22-Jul-20 5:01 
GeneralRe: Confused by team mate... Pin
Gerry Schmitz22-Jul-20 10:17
mveGerry Schmitz22-Jul-20 10:17 
GeneralThought of the Day Pin
OriginalGriff21-Jul-20 4:40
mveOriginalGriff21-Jul-20 4:40 
GeneralRe: Thought of the Day Pin
W Balboos, GHB21-Jul-20 4:55
W Balboos, GHB21-Jul-20 4:55 
QuestionRe: Thought of the Day Pin
Daniel Pfeffer21-Jul-20 5:14
professionalDaniel Pfeffer21-Jul-20 5:14 
GeneralRe: Thought of the Day Pin
User 1106097921-Jul-20 5:44
User 1106097921-Jul-20 5:44 
GeneralRe: Thought of the Day Pin
honey the codewitch21-Jul-20 6:34
mvahoney the codewitch21-Jul-20 6:34 
GeneralRe: Thought of the Day Pin
Eddy Vluggen21-Jul-20 10:55
professionalEddy Vluggen21-Jul-20 10:55 
GeneralRe: Thought of the Day Pin
OriginalGriff21-Jul-20 11:19
mveOriginalGriff21-Jul-20 11:19 
GeneralRe: Thought of the Day Pin
Eddy Vluggen21-Jul-20 12:41
professionalEddy Vluggen21-Jul-20 12:41 
GeneralRe: Thought of the Day Pin
W Balboos, GHB22-Jul-20 1:34
W Balboos, GHB22-Jul-20 1:34 
GeneralRe: Thought of the Day Pin
Eddy Vluggen22-Jul-20 2:02
professionalEddy Vluggen22-Jul-20 2:02 

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.