Tuesday, December 11, 2018

Week 16: CST 205

A variety of subjects were learned in this class. We learned how to manipulate photos, and sounds in JES. We also learned about the software development cycle and a few basics on how to use GitHub. After that, we made a few simple games.

This class gave a good rundown of the basics of the Python language. Although it wasn't required or focused on, our team involved a lot of object-oriented programming in our code. We also worked a lot with the PyCharm IDE for its easy to use interface used by professionals and amateurs alike. I would advise a future CSIT-Online student to make sure they do the full 10+ hours of python preparation if they are not familiar with python. I would also advise someone to keep track of the new functions they have learned about and use the existing python 2.7/JES documentation for help learning about new functions. I had the most difficulty with the Labs where there wasn't as much guidance towards the end of the semester. If I got started earlier in the week, I would have done better. I also would have preferred if the TA had a group hangouts like the one we had for CST 300.

In Chapter 15, we learned about Classes and Objects. In Python, points represent a 2D space, they have parenthesis with a comma separating the coordinates. Classes are a programmer-defined type indicated by "class stuff: ". The class object can be used to create more objects. When you create a new object, that is called instantiation. The object is an instance of that class. Dot notation can be used to assign values to an instance. The elements are called attributes. Dot notation objects can be used in print statements to print the value of it. An object can be changed by reassigning one of its attributes or reassigning it with a function. Any object can be copied instead of aliasing. In a shallow copy, the object and reference are copied but not the embedded objects. In a deep copy, the object, the references, and the embedded objects are copied.

Some errors when debugging class issues will be attribute errors. This occurs when you are trying to access an attribute that isn't there. This is fixed by asking type(p); this will return the type of object. This is also fixed by using isinstance(p,Point); if this is is true, p is an instance of the class. The hasattr(p,'x') function will explain if an object p has an attribute 'x' (a string).


Tuesday, December 4, 2018

Week 15: CST 205

This week, we learned about lists. Lists are a sequence of values with elements or items. Lists can be changed so if there are unwanted values, they can be changed. Lists can be added together or concatenated with the '+' operator. Slice can be used on lists to remove values from the first to the last number. Append can be used to add a new element to the end of a list and extend is used to append more than one element. Pop can be used to delete an element if you know the index, and del can be used if you know the element but not the index. Split is used to break a string into words. A delimiter can be used to help split strings. 

A dictionary is like a list, it has keys and values associated with those keys. Its key-value pairs are called items. You can make an empty dictionary and add items to it. 

In the guide to identifying complexity, a few things were mentioned to do in order to increase understanding. Complex problems with sequential execution are probably not solving complex problems. Complex problems require a few self-created functions to be made and require more data variables to be tracked with test cases. They need to be broken down to be understood, then recombined and will take a long time to be completed. 

Code review is a systematic examination of computer code in order to find mistakes and improve the developer's skills. Code review ensures that the final project is good, allows practice in code review as a soft skill, allows team members to learn from each other, learning to read different styles of code, and learning to focus on details. A few tools to check out are Gerrit, Review Board, Rietveld, Codifferous. The best practices: reviewing 200-400 lines at a time at allowing yourself about an hour to do so but not more than 90 minutes. The author should annotate the source code establishing quantifiable goals and metrics to improve the process with a checklist for both parties. Then the reviewer verifies that the defects are fixed. 

Good programming practice is a good skill to learn. Start your journey with a plan which includes the data, functionalities described with pseudocode, communication between functions, and a diagram of the design of the program with the modules and how they connect. The program should be done and tested in small chunks or by lines. Programs should be indented correctly. The variable names should be clear and self-documenting in mixed case. For booleans, the word 'is' should be used to indicate boolean variables and methods. The functions should have a description of the preconditions and postcondition including the acceptable conditions where they will run. The comments should be a complete sentence with a capitalized letter on the first word unless it is the name of a variable. The header comment should be at the top of the file with the filename, author, date, version number and a description of what the file is for and what it contains as well as the course name, number, section, instructor, and assignment number. Testing data and plans should be done in the program and when testing, the boundary values should be indicated. 


cst 499 week 8

This week, we finished writing the paper in order to do the best job possible even if it was a little bit late. Now that everything is done,...