Coding with Loops

Channel:
Subscribers:
2,640
Published on ● Video Link: https://www.youtube.com/watch?v=NpPEOyw6SqI



Duration: 1:01:10
155 views
1


Today we did a live coding demonstration of loops, using them to calculate the stats for baseball. The key to coding is to start small, and go slow, testing and growing your code every step of the way. The single biggest mistake new programmers make is to try coding a complicated bit of code from scratch and then be puzzled when something doesn't go well. Today is a good example of how you should be coding right now.


We also talked about static_cast and why it's maybe better than other forms of casting, the use of size_t, and integer division again.


I also introduced readlib (available on Github) which replaces cin with a read() function that just works a lot better, as well as some iomanip options such as setprecision and fixed which you can use to format your floating point numbers the way you want.







Tags:
csci 40
loops
baseball stats
how to code
readlib