Q: Can you give a bit more concrete example of how different SDLC cycles are applied? (using a real life example)
Q: You mentioned that there should be an assessment of real project cost (which I interpret mainly as time). How does one realistically assess how long some development will take?
Q:
Q:
Q: what is the difference between ":" and "-" at the beginning of a statement in an activity diagram?
Q: I'm not able to render the plantUML diagrams, but get the error "No PlantUML server, specify one with "plantuml.server"." Any idea on how to fix this?
Q: Is it possible to have nested diagram? Like that a new more detailed one come up when you click on a function
Q:I have lost the first 10 minutes. How can I write a uml diagram in Vscode? Do I need an extension?
C: When I was working as Senior SE in Critical Mass, in canada we used team based code review where a team of senior deloper and junior developer reviewed code together for eachother which gave less of a problem as it was a team effort rather than one person who is commenting. which diffuses the point
C: Having planned well (reqs, risks, analysis/ design) would hopefully make all persons on the same track for the project direction
Q:
Q:
Q:
Q:
def fibonacci(n):
"""
Compute the Fibonacci number of a natural number n. #COMMENT: Good descriptions.
Input:
n: natural number # COMMENT: One could make the function throw an error when n is not a natural number.
Output:
F_n : Fibonacci number
"""
# PSEUDO CODE
# F_0 = 0, F_1 = 1
# F_n = F_{n-1} + F_{n-2} where n > 2 # COMMENT: The pseudocode is not representative of the actual implementation of the Fibonacci function, which in this case is by list-appending, not iteratively as suggested by the pseudocode.
if n == 0: # COMMENT: These explicit return statements seem to be redundant, given that the return fibonacci_list[n-1] command are now returning the same values.
return 0
if n == 1:
return 1
fibonacci_list = [0,1]
for i in range(2,n): # COMMENT: writing the range in this way does not include n
fibonacci_list.append(fibonacci_list[i-1] + fibonacci_list[i-2]) # SUGGESTION: this could be written by only storing the last two items, not the full list, if memory is an issue. If time is an issue, one could perhaps use a stack instead?
return fibonacci_list[n-1] # COMMENT: we think that the index you want to return should be n, not n-1
#!/usr/bin/env python3
def fib(n):
prev = 0
curr = 1
for i in range(n):
tmp = curr
curr = prev + curr
prev = tmp
return curr
for i in range(10):
print(fib(i))
- A: Feedback
#!/usr/bin/env python3
def fib(n):
# Add docstring/documentation explaining what the function does as well as input output
prev = 0
curr = 1
for i in range(n):
tmp = curr # could be better to describe it in readable name
curr = prev + curr
prev = tmp
return curr
for i in range(10):
print(fib(i))
No other comments. Docstring could be ignored since the code is very clean and easy to understand in this case. Nice, clean code!
#!/usr/bin/env python3
def pi_test():
pi = 0
d = 1
for n in range(1,1000000):
a = 2*(n%2)-1
pi += a*4/d
d += 2
return pi
print(pi_test())
#!/usr/bin/env python3
def pi_test():
pi = 0
d = 1
for n in range(1,1000000):
# Why did you settle for 1000000?
# It could be made into a function maybe?
a = 2*(n%2)-1
pi += a*4/d
d += 2
# This seems like a nice algorithm.
# Does it have a name?
return pi
print(pi_test())