avatarJacob MacInnis

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2554

Abstract

pect of creating your portfolio, and it’s the process itself that will make you a better designer. Analyzing your work and thoughtfully removing projects from your portfolio is painful but also the best way to grow as a designer.</p><h1 id="7177">3. Unsolicited Redesigns for Fortune500 companies</h1><p id="3c7d">You know, I love unsolicited redesigns because they are not only a great tool for exercising your design sensibilities when just starting out, but they are also a good way to generate hype & attention in the design community. If the only reason you do them is to generate attention, keep doing them.</p><figure id="4114"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Hq1t6yGemFPW4Gz7IMtNLQ.jpeg"><figcaption></figcaption></figure><p id="2a9b">The point is, as a designer we shine when solving hard problems, or at least attempting to solve them. But doing a quick visual re-design of nike.com, apple.com or any other Fortune500 company is not only lazy but also easy because you’re doing it for a company that is already very successful and has fantastic assets/products to work with in the first place.</p><p id="1013"><b>I always love to see unsolicited redesigns that are focused on real problems, companies that aren’t yet successful, products that are struggling and are neither hip or cool.</b></p><p id="58ab">Being a good (product) designer means being a good problem solver. Cherry picking the problem is of course totally up to you, but it also reveals a lot about you and your work ethics. Unsolicited redesigns are a fantastic source to practice your skills, but focus your motivation on the problem and not the shiny brand (unless your only goal is to work for company xyz).</p><p id="33cb"><b>Please keep doing Unsolicited redesigns as an exercise because they are fun & quick to do, but in the context of building a strong portfolio I recommend avoiding it, especially if 90% of your work ends up being unsolicited redesigns.</b></p><h1 id="d2db">4. Hiding your responsibilities</h1><p id="bff8">Let me give you a real life example: I remember reviewing a couple portfolios for a Senior Designer role. While going through some designers I found at least 6 portfolios who showcased exactly the same work for Nike.</p><p id="a402">Neither of them outlined what they actually did on the project, which of course caused trust issues immediately. Who did what? Did any one of them actually worked on it? How many more designers worked on this?</p><p id="d893">When working for bigger clients this is a c

Options

ommon issue, but it can be solved easily by adding a detailed description about your responsibilities on each project, plus the people you collaborated with. Handle it the way movies do, with a list of detailed credits at the end.</p><p id="a0b7">Leaving out the details about a project usually makes the viewer suspicious, especially if I spot inconsistencies when comparing it to other projects in your portfolio which seem to differ in quality.</p><h1 id="549f">5. Making your portfolio a piece of art</h1><p id="a519">Often we use our own website as a creative outlet. We think of it as our own creative playground where we can finally express ourselves, after all these limiting client projects. In general, there is nothing wrong with that.</p><p id="bf01">We treat it as our personal experiment & without noticing it first, we created a piece of art. What we end up with is a website that is slow and playful to an extent that it becomes un-useable. If you like to get hired by certain companies, imagine the people who <b>have</b> to review your portfolio. Their time is usually limited and the amount of portfolios to review is a draining task.</p><p id="d088">If I need to complete a puzzle first just to find the navigation, I’m very likely to dismiss a portfolio immediately, even if the work is outstanding.</p><p id="9217" type="7">Think of your portfolio as the space in a museum. Clean, easy to navigate & with full focus on the work itself.</p><figure id="6083"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*2VxU8bMmdxw014KZcMs-CQ.jpeg"><figcaption></figcaption></figure><p id="af85">Focusing on the usability of your portfolio is as much as important as the work you like to showcase.</p><p id="1896">While this sounds almost too obvious, it’s still one of the main reasons why so many portfolios get rejected during the review process.</p><h1 id="cf0b">Conclusion</h1><p id="75b5">If you avoid these 5 things above you’re probably on a pretty good way to build a fantastic & effective showcase of your work.</p><p id="5304"><a href="https://twitter.com/schneidertobias">Please reach out to me on Twitter</a> if you have any questions or comments, which I’m sure you have. (:</p><p id="4491">Keep on rocking, Tobias</p><p id="1ff0"><i>I’m Tobias, a Product Design Lead at Spotify NYC. Founder of <a href="http://www.semplicelabs.com/">Semplice</a>, Advisor & UX at <a href="http://memorymirror.com/">memomi</a><a href="http://www.vanschneider.com/">www.vanschneider.com</a></i></p></article></body>

How To Write a TypeScript Type Guard

Code Readability Game Changers

Photo by Pramod Tiwari on Pexels

TypeScript is such a game changer. It is so powerful and amazing to use. It has the ability to make working on massive codebases with multitudes of developers a simple process. As projects grow in complexity, maintaining a clear understanding of data types and their properties becomes increasingly challenging. This is where TypeScript, with its robust type system, comes to the rescue. When moving into a new area of code TypeScript will guide you through complex functions by telling you all the data structures, and return types of the functions. It will tell when your making a mistake before you even run a compilation.

Among TypeScript’s arsenal of features, one particularly powerful tool stands out: the TypeScript Type Guard. I have worked with a lot of talented TypeScript developers I often find that the TypeGuard concept lags behind in understanding so that is why I wrote this walk through:

Understanding TypeScript Type Guards

TypeScript Type Guards are functions used to narrow down the type of a variable within a conditional block. These functions help TypeScript understand the specific type of an object or variable, enabling more precise type inference and facilitating safer code execution. While TypeScript’s type system already provides static type checking, Typeguards offer an additional layer of assurance, especially in scenarios involving union types or complex conditional logic.

Consider the following TypeScript example which works but is not using a typeguard :

enum CartTypes {
 sale,
 return,
}

interface Cart {
 cartType: CartTypes;
 total: number;
 salePromotion?: string;
 returnReason?: string;
}

interface SaleCart {
 cartType: CartTypes.sale;
 total: number;
 salePromotion: string;
}

interface ReturnCart {
 cartType: CartTypes.return;
 total: number;
 returnReason: string;
}

// Format number to US dollar
let USDollar = new Intl.NumberFormat('en-US', {
 style: 'currency',
 currency: 'USD',
});



// our checkoutCart function is given carts of many types and it
// needs to figure out which checkout type to handle

function checkoutCart(cart: Cart): string {

 if (cart.cartType === 0 && cart.salePromotion) {
    return `${salePromotion} - ${USDollar.format(cart.total)}`;
 } else if (cart.cartType === 1 && cart.returnReason) {
    return `${returnReason} - ${USDollar.format(-cart.total)}`;
 }

 throw new Error('Unsupported cart');
}



// Example usage
const saleCart = { cartType: 0, total: 47.5, salePromotion: 'Holidy Sale' };
const returnCart = { cartType: 1, total: 15.97, returnReason: 'Item Damaged' };

console.log(checkoutCart(saleCart)); 
// Output: "Holiday Sale - $47.50"
console.log(checkoutCart(returnCart)); 
// Output: "Item Damaged -$15.97"

In this example, the `checkoutCart` function accepts a `Cart` object and formats the total amount as a US dollar currency string with sale promotion string. However, within the function, we need to differentiate between a sale cart and a return cart to handle them appropriately. We achieve this differentiation using conditional statements based on the `cartType` property and other expected properties.

While this approach works, it can lead to code duplication and reduced readability, especially as the number of conditional blocks increases. This is where TypeScript Type Guards come into play.

Elevating Code Clarity with Advanced Type Guards

Let’s enhance the previous example by introducing more advanced Type Guards

function isSaleCart(cart: Cart): cart is SaleCart {
 return cart.cartType === 0;
}
 
function isReturnCart(cart: Cart): cart is ReturnCart {
 return cart.cartType === 1;
}

// our function does the same thing but is a bit more 
// easy to read and easy to use

function checkoutCart(cart: Cart): string {
 if (isSaleCart(cart)) {

    // Here we've changed the type of cart to SaleCart and 
    // the cart will have the expected SaleCart types for example
    // cart.salePromotion will always be a string
    // and TypesScript would tell us cart.returnReason is a bad type

    return `${salePromotion} - ${USDollar.format(cart.total)}`;
 } else if (isReturnCart(cart)) {

    // Here we've changed the type of cart to ReturnCart and 
    // the cart will have the expected ReturnCart types for example
    // cart.returnReason will always be a string
    // and TypesScript would tell us cart.salePromotion is a bad type

    return `${returnReason} - ${USDollar.format(-cart.total)}`;
 }

 throw new Error('Unsupported cart');
}

In this updated version, we’ve defined two Type Guard functions: `isSaleCart` and `isReturnCart`. These functions accept a `Cart` object and return a boolean value indicating whether the object matches the specified cart type. By using these Type Guards within the `checkoutCart` function, we can confidently access properties specific to each cart type without resorting to manual type checks.

By leveraging TypeScript Type Guards, developers can enhance code clarity, reduce redundancy, and promote safer code execution. Type Guards empower developers to write cleaner, more maintainable code, ensuring that TypeScript’s powerful type system is fully utilized to its fullest potential. As projects scale and complexity grows, embracing TypeScript Type Guards is essential for building robust, type-safe applications in the ever-evolving landscape of software development.

If you enjoyed this content and would like to support me in these endeavors please visit: https://ko-fi.com/jacobmacinnis

Typescript
Type Guards
Intellisense
JavaScript
Advanced Types
Recommended from ReadMedium