Tutor profile: Vincent H.
Questions
Subject: Python Programming
What is a short-hand way of writing a simple for loop in python?
Use list comprehensions. Example: l = [] for i in range (0, 100): if i % 2 == 0: l.append(i) Can be simplified to l = [i for i in range(0, 100) if i % 2 == 0]
Subject: Computer Science (General)
How is premature generalization bad?
Premature generalization can lead to a more complicated and less performant product. For example, the overuse of interfaces vs concrete types. If there is no need to use an interface, using a concrete type will lead to better performance as the runtime can use the address of the concrete type which is known at compile time, rather than at runtime.
Subject: C Sharp Programming
What is the downside of awaiting on async methods?
For each await call to an async function, an async state machine will get created with all the local variables in its scope. Many calls to the same async function will have memory impact as the state machines will allocate memory on the heap.
Contact tutor
needs and Vincent will reply soon.