Skip to content

Instantly share code, notes, and snippets.

View harsh183's full-sized avatar
😺
People pleasing users

Harsh Deep harsh183

😺
People pleasing users
View GitHub Profile
@harsh183
harsh183 / hackyTestFramework.java
Last active June 8, 2024 01:42
Java hacky test framework
interface TestCase {
boolean test();
}
// print title if case fails
void checkCase(String title, TestCase t) {
if (t.test() == false) {
System.out.println("Failed: " + title);
}
}
int add(int a, int b) {
@harsh183
harsh183 / typeInf125.md
Last active December 25, 2020 05:29
Blurb I wrote on CS 125 Forum about explaining Type Inference

I've gotten many questions about this from both students, and current existing course staff since type inference is a reasonably new age concept that is getting picked up in the programming languages of the 2010s and 2020s.

The lesson gives a pretty good starting point, especially the 7-minute walkthrough here on the basics of type inference.


Talk is cheap, show me the code

I redid a few of the older problems using var type inference across a few of the past homework problems to see this in action. I highly suggest checking these out.