Skip to content

Conversation

@SesameSeeds
Copy link

@SesameSeeds SesameSeeds commented Aug 14, 2017

Yeah I got frustrated and was tired, so I found something to make it work. Anything, though it is not sustainable. I am working on better understanding that functionality and then branching from there by doing extra work on the side since I feel perpetually confused. Sorry about the crap code. It'll get better with practice I am sure.

@SesameSeeds SesameSeeds changed the title Ride Share Stef -- Carets Stef Gunderson - Ride Share -- Carets Aug 14, 2017
@CheezItMan
Copy link
Collaborator

Keeping the data in one variable per driver is awkward because then you need an individual variable per driver. So if Uber has 10 million drivers, your code would need 10 million variables. That's not sustainable.

Instead I'd suggest making a hash where the key is the driver ID, and the value is an array of trips. That way you can have one variable which can store all the drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants