Technology · India
Hi, I’m Kyle. I manage products. Occasionally, I post thoughts here that are too long for Twitter . I managed to get a lesson done on one out of two days this weekend, so I’m counting that as a success. Back in the saddle for Day 5 of my journey through SwiftUI. Today’s series of lessons is all about Conditions! The first lesson today was about testing conditionals, i.e. – if statements. This was probably the most straightforward lesson today, because from here on it gets pretty hectic. Essentially, you just write a simple sentence that says “if something matches this condition, then do this”. It’s pretty easy! An easy example is this: Since the variable mySanity is equal to the string “gone”, the codes prints out the message “Sorry, dude. You lost your marbles!”. Easy enough, though this is yet another example of me constantly getting tripped up by the difference between parentheses, braces, and brackets. The next step in today’s lesson was about testing for multiple conditions, using if else statements. Pretty straightforward expansion on just regular conditions. They seem pretty readable when there are only a couple things to check, but I have a feeling the next block of this lesson is going to be about a better way to solve for situations with lots of conditions to check because I can see this getting unwieldy already. From here, we moved on to switch statements. Switch statements are designed specifically for enums, and they must be exhaustive. You can set a default case that handles anything not explicitly covered in the cases you’re writing, though, so you don’t have to make a case for literally every possible scenario. By default switch statements also stop at the first case that runs, but you can set fallthrough after your statements to have it continue running the next cases. Paul has a great example of using switch statements to print out the 12 Days of Christmas: Without fallthrough , it’s going to stop at the first case. By adding fallthrough after each case it will continue running the rest of the code, printing out the entire lyrics as expected. Find of a fun example! Finally, we wrapped it up with a quick runthrough of the ternary operator. The ternary operator is just a way for us to do either/or behavior on a given condition. Scott Michaud has a great tweet about remembering how to use the ternary operator. This still feels a little superfluous to me, but Paul says that as we get deeper into actually using SwiftUI we’re going to find some situations where ternary operators become critically important. So…hurray, I guess? Anyway, this wa
Hi, I’m Kyle. I manage products. Occasionally, I post thoughts here that are too long for Twitter . I managed to get a lesson done on one out of two days this weekend, so I’m counting that as a success. Back in the saddle for Day 5 of my journey through SwiftUI. Today’s series of lessons is all about Conditions! The first lesson today was about testing conditionals, i.e. – if statements. This was probably the most straightforward lesson today, because from here on it gets pretty hectic. Essentially, you just write a simple sentence that says “if something matches this condition, then do this”. It’s pretty easy! An easy example is this: Since the variable mySanity is equal to the string “gone”, the codes prints out the message “Sorry, dude. You lost your marbles!”. Easy enough, though this is yet another example of me constantly getting tripped up by the difference between parentheses, braces, and brackets. The next step in today’s lesson was about testing for multiple conditions, using if else statements. Pretty straightforward expansion on just regular conditions. They seem pretty readable when there are only a couple things to check, but I have a feeling the next block of this lesson is going to be about a better way to solve for situations with lots of conditions to check because I can see this getting unwieldy already. From here, we moved on to switch statements. Switch statements are designed specifically for enums, and they must be exhaustive. You can set a default case that handles anything not explicitly covered in the cases you’re writing, though, so you don’t have to make a case for literally every possible scenario. By default switch statements also stop at the first case that runs, but you can set fallthrough after your statements to have it continue running the next cases. Paul has a great example of using switch statements to print out the 12 Days of Christmas: Without fallthrough , it’s going to stop at the first case. By adding fallthrough after each case it will continue running the rest of the code, printing out the entire lyrics as expected. Find of a fun example! Finally, we wrapped it up with a quick runthrough of the ternary operator. The ternary operator is just a way for us to do either/or behavior on a given condition. Scott Michaud has a great tweet about remembering how to use the ternary operator. This still feels a little superfluous to me, but Paul says that as we get deeper into actually using SwiftUI we’re going to find some situations where ternary operators become critically important. So…hurray, I guess? Anyway, this wa
2–3 DSA coding problems on HackerRank, CodeSignal, or company platform
Data structures & algorithms — arrays, trees, graphs, dynamic programming
System design or low-level design — scalability, APIs, databases
Career goals, teamwork, strengths/weaknesses, role expectations