Table of Contents
- Course Description
- Introduction
- Homework
- Exams
- Overall Thoughts and Conclusion
- Resources
Course Description
The course description from the CSE 142 Course Website:
Basic programming-in-the-small abilities and concepts including procedural programming (methods, parameters, return, values), basic control structures (sequence, if/else, for loop, while loop), file processing, arrays, and an introduction to defining objects. Intended for students without prior programming experience.
Introduction
Prior to this class, I had basic knowledge about the fundamentals of programming. This knowledge was mostly in Python. However, this class was in Java. This difference in programming language was not a significant issue for me as this class was intended for students without prior programming experience. Even though I had some basic knowledge from before, the class was not "boring" or "useless" in any way.
The Autumn 2018 CSE 142: Computer Programming I at the University of Washington was taught by Brett Wortzman. Overall, I thought the course was well taught and very well structured. Although I had some programming knowlege, there were also many new tricks and concepts I learned in both lecture and section. I thought the homework assignments were fun and challenging. And although the exams were difficult, there were plenty of resources available to help.
This post will outline my experience for the Autumn 2018 CSE 142 course taught at the University of Washington. Additionally, it will be a way for me to reflect on the course and the course material in order to enrich my knowledge in programming. Along the way, I will talk about different things that I thought were helpful and I hope this post will be useful to other students as well.
I will not be posting my code publicly. By doing so, my post will not be helping students plagiarize, but instead offer helpful insights regarding the course. Prior to posting this publicly, on December 30, 2018, I emailed my instructor to read over this article in order to check for anything that might be deemed as academic misconduct. On January 2, 2019, my instructor emailed back giving me approval to post this.
Homework
In the Autumn quarter, there were nine total homework assignments. Each had their own specification document and sample outputs to check their external correctness. The assignments were somewhat cumulative since each assignment built upon the fundamentals of the previous one. Although challenging, these assignments were also very fun and valuable to the class. Almost all the assignments had a creative portion which kept the homework interesting. They were assigned on a weekly basis and were all related to what we had learned during the week in lecture. These assignments were graded on both internal correctness and external correctness. There was plenty of help available through the textbook, our TAs, and the Introductory Programming Lab (IPL).
- Internal correctness
- Good style and readable code
- External correctness
- Correct output
Here is the link for information on all the homework assignments for my quarter: CSE 142 Homework Page.
Useful Tools for Homework
Output Comparison Tool
The Output Comparison Tool was a very useful resource for me when doing homework. Almost all the assignments had console output that could be compared with the given sample output. This allowed me to check for external correctness. However, comparing the output to the sample output is only one check.
Checking my own programs with different inputs was also very necessary since there might be an edge case or another test case that was not given in the sample outputs. I believe that testing my programs extensively with the sample output and my own test cases is very important for this course and for programming in general.
Here is the link for the Output Comparison Tool for my quarter.
Indenter Tool
The Indenter Tool fixes the indentation of your Java Code. This tool I did not use as much compared to the Output Comparison Tool.
Here is the link for the Indenter Tool for my quarter.
jGRASP
For the course, it was recommended to use jGRASP as our integrated development environment (IDE). Although I had heard about IDEs like Eclipse and IntelliJ before the class, I decided to use jGRASP as it was recommended.
jGRASP is a lightweight barebones Java IDE which has the basics and essentials needed for an IDE to work. It doesn't have extra cool features like other IDEs have like autocomplete, but that didn't mean it was horrible to use either.
In fact, after completing the course with jGRASP, I would highly recommend new Java programmers use jGRASP. A main reason is that it doesn't have autocomplete. By not having all these extra features, it keeps it simple for students and doesn't give you the luxury of doing everything for you. By not having autocomplete, I had to write each statement out through memory or by looking up the documentation of what I needed.
Here are links related to jGRASP:
- jGRASP Home Page
- CSE 142 Course Software Page for my quarter
Good Style and Clean Code
Having good style and clean code is the key to getting a good score on the homework assignments. Since half the homework points were from internal correctness, it was very important to always write code with good style. I think internal correctness was the easiest way to lose homework points. While I could check my program's overall external correctness with the given sample output, I couldn't concretely and exactly see what was wrong stylistically.
However, I think grading internal correctness as a priority is very needed. Although the overall reply when asked about style was very vague and not very helpful, teaching about clean code is fundamental to a good programmer. Readable code is very necessary, especially in a collaborative setting. If another programmer was to look at unreadable code, they wouldn't understand it and would have to rewrite it entirely. This would slow the work being done and make the workflow highly inefficient.
Additionally, I think the mantra of this course was "reduce redundancy." Throughout the entire course and the different homework assignments, it was always reiterated to check for redundant code and try and reduce redundancy. This is very important because in programming, you don't want to repeat yourself and write the same code over and over again.
Overall, I don't think the vague and unhelpful answers were detrimental to my learning because they were trying to teach us to write readable and elegant code. Depending on each programmer, everyone is going to have a different way to do this. I had to decide whether my code was readable and well documented. The main takeaway from this was that I had to make my own decisions and always stay consistent.
There were also some style guides given, but I still had to make the final decisions. Here are links to two style guides detailing good style and clean code from the CSE 142 course website for my quarter:
- a Java style and comment guide by a TA
- another Java style and comment guide by a TA, more applicable for 143
Assignments
Homework 1: Song
This assignment focused on static methods and println statements where we had to write a program that would "output a cumulative song in which successive verses build on previous verses." Being the very first homework assignment, this was fairly simple. This was also the first assignment where we were introduced to good style and reducing redundancy. The main focus on the assignment was that the song was cumulative and that we should focus on reducing redundant code.
Homework 2: ASCII Art and Rocket Ship
In this homework assignment, it focused on for loops and print/println statements. The main focus of this assignment was to use for loops and static methods to reduce redundant code (once again focusing on maintaining clean readable code). If there was a section where there were two very similar pieces of code, I had to ask myself if I could factor that code into a static method and call it multiple times or if I could create a for loop to iterate through it.
Homework 3: Cafe Wall
Focusing on for loops, parameters, and graphics, we had to create a Cafe Wall illusion with DrawingPanel. DrawingPanel is a special class that the authors of our textbook wrote. Similar to the last assignment, we had to reduce redundancy, but this time, it focused primarily on using parameters to remove redundant code. This allowed us to have variability in our methods and reduce similar redundant code.
Homework 4: Budgeter
For this assignment, it focused on using if/else statements, Scanner, and returns. To have clean style, we had to look for redundant branches of if statements and see if we could refactor them in a way that removed redundant code. It was also our first time taking user input and having an interactive program with Scanner.
Homework 5: Guessing Game
In this assignment, we had to create a number guessing game using while loops and random numbers. The main focus was to use while loops since the number of iterations we needed was undefined. Another focus was that we needed to keep track of overall game statistics in a way that we could print them after all the games were played.
Homework 6: Mad Libs
Mad Libs was the assignment where we were first introduced to file processing. The main focus was to scan the files for placeholders, then prompt the user for the specific type of that placeholder to replace them, and then output it into another file. This program involved both line-based and token-based file processing.
Homework 7: DNA
I thought the previous assignments were not too difficult and very intuitive, but the DNA assignment was definitely the one I thought was the most difficult out of all. In this assignment, it focused on arrays and file/text processing. The main issue I had with this assignment was the difference between arrays and other data types. Instead of using value semantics like primitive data types, arrays used reference semantics.
- Value semantics
- You deal directly with the values
- Reference semantics
- You deal with a reference/address to the values
A good analogy from lecture was that array variables are similar to emails. Emails are not actual people, but you could use an email to reach an actual person. If you give someone else that email, then they could also reach the person behind the email. So if you pass the variable of an array to another method, then that method can access and change the values of the same array since that variable only contains a reference to the actual array.
Homework 8: GeoLocation
This assignment is given during the week of Thanksgiving break so it is specific to the Autumn quarter. It was one of the shorter and easier assignments. This assignment focused on the basics of classes/objects and was an introduction to object-oriented programming. In the assignment, we wrote a class for an object and also client code for an existing object.
Homework 9: Critters
The main focus of the assignment was on objects and object-oriented programming. However, unlike Homework 8, we did not write the client code for the program and were unable to change it. Instead, we were restricted to writing classes that extended another class. From this, we had to focus completely in an object-oriented way.
An example of this is that the client code would ask our Critters (our classes) for a single move each in-game tick. Since this was how the program was structured, if we had wanted to move five moves up in succession and then down for another five moves, we could not use for loops. Using for loops did not work because the client program asked us for a single move each time and for loops would not be able to "remember" which move we were on. Instead, we had to create fields for our Critter objects to "remember" which move we were on.
Since the Autumn quarter had the extra GeoLocation (Homework 8) assignment, I think it really helped my understanding with object-oriented programming because it gave me additional practice with objects and how they interacted.
Exams
The tests for this course were handwritten and although they were difficult, there were plenty of resources available for help. The exams were not graded on internal correctness and instead on external correctness. Both exams had "cheat sheets" attached to the back of them.
Here is the link for the CSE 142 Exams Page for my quarter.
Practice-It
For both the midterm and final, although there are plenty of other resources, most of the review I did was from Practice-It. Practice-It is definitely the most helpful and useful resource I took advantage of during the course. Categorized into different chapters of our textbook and having sections for past exams, it offers many programming problems with a way to check your solution directly on the website. I highly recommend it as a way to practice programming and prepare for the exams.
Here is the link for Practice-It.
Midterm
The midterm content included:
- Expressions
- Parameter mystery
- If/else simulation
- While loop simulation
- Assertions
- Two programming problems
- One programming problem (probably hard)
I recommend getting very good at doing the "mechanical" problems very efficiently. The mechanical problems include the expressions, parameter mystery, if/else simulation, while loop simulation, and assertions. By getting familiar with doing these efficiently, it gives you more time to do the programming problems which will definitely take up the majority of the test time.
Final
The final content included:
- Reference mystery
- Array simulation
- Inheritance mystery
- Two file processing problems
- probably one line-based and the other token-based
- Two array programming problems
- One class-based programming problem
- One Critter-based programming problem
- One programming problem (probably hard)
For the final, it consists mostly of programming problems and less of the mechanical problems seen in the midterm. Even though the final has significantly more content, we were also given more time to complete it.
Overall Thoughts and Conclusion
The CSE 142 course was a great experience and really helped me build a good framework for programming. It taught me to always maintain good style and prioritize clean and readable code. Additionally, it taught me to focus on reducing redundancy and eliminating repetitive code.
Resources
- CSE 142 Course Pages
- CSE 142 Homework
- CSE 142 Homework Page for my quarter
- jGRASP
- jGRASP Home Page
- CSE 142 Course Software Page for my quarter
- Useful Tools for Homework
- Output Comparison Tool for my quarter
- Indenter Tool for my quarter
- Style Guides for my quarter
- CSE 142 Exams
- CSE 142 Exams Page for my quarter
- Practice-It