UNIX Shortcuts, C++ Shortcuts, Bools

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



Duration: 1:11:23
155 views
1


Today we talked about three things -


A) UNIX shortcuts. We went over how the input tester works, and how through clever use of shell scripting we can automate routine and tedious tasks to make our lives better, as well as various commands and aliases to speed up the development process


The UNIX philosophy is to get maximum results for minimum effort - and it works.


B) C++ shortcuts. We talked about different ways of doing the same thing with less typing, including chaining together multiple cout statements, using the ++ operator instead of x = x + 1, the += operator so you can do x += 7 instead of x = x + 7, and showed some really hideous abuses of the preincrement and postincrement operators to explain why x = x+++ ++x is valid C++, but you should never write it.


It did get me my job, though, so I guess there's that.


At your level of development, don't combine a ++ operator with another command, just write x++; on its own (or ++x; which does the same thing when not combined with another command). By the time you get to second or third semester you should have enough skill to use them in compound commands safely.


C) We talked about the bool type, which is basically an integer that can have only two values: 0 (false) and 1 (true).


In general, C++ uses 0 to mean false, and everything else is true.







Tags:
csci 40
preincrement
postincrement
unix
unix shell scripting
unix shortcuts
C++ shortcuts