Swizec Teller - a geek with a hatswizec.com

    comp sci ain't useless

    You will often hear on the internet programmers say that their college degree was useless, that it taught them nothing, and that it's a waste of money.

    maybe

    Or maybe they just weren't paying attention.

    Knowledge is a tool. You can't use what you don't have.

    Swizec Teller published ServerlessHandbook.dev avatarSwizec Teller published ServerlessHandbook.dev@Swizec
    Today in my dayjob as a web developer I used

    - linked list traversal
    - recursion
    - the halting problem

    Don't let anyone tell you computer science is useless in webdev ๐Ÿค“

    Just yesterday I used 3 different concepts from college.

    • linked list traversal
    • recursion
    • the halting problem

    And I don't mean "I used code based on those principles". No, I used them for my own code because they were useful.

    The halting problem

    The halting problem came into play when I was helping the new guy implement a feature. He's building message receipts.

    We have a chatroom.

    How can the sender know that their message was received?

    Well, you use the ping pong scheme. Each message is a ping. When you get a pong you know the message was received.

    But how do you know you're still waiting for a pong and the message wasn't lost?

    You don't. That's the halting problem. Also known as an unsolvable decision problem. Or the most famous example of such.

    It is mathematically impossible to create a process that knows whether another process has finished or is still running.

    Only solution is to have a max timeout.

    If it don't pong in 30 seconds, it ain't ponging. 30 seconds is the default TCP timeout btw.

    TCP also uses a ping-pong scheme.

    CPsvgpngg07c73

    Look at that. A whole protocol we can mimic to implement message receipts. How wonderful. โœŒ๏ธ

    You'll think of ping-pong, halting, TCP, and unsolvable decision problems, if you've seen them before. "Ah! This problem is like that other problem!.

    Pattern matching.

    Linked lists and recursion

    Linked lists and recursion broke my brain for many hours. There was a bug and I spent hours validating my implementation.

    Bug was actually in the data.

    Garbage in garbage out. Another compsci maxim.

    So how'd I use linked lists?

    We built a whole system for SMS drip campaigns over the years. It's like ConvertKit or Drip or ActiveCampaign but for SMS. Super neat and makes me wanna spin-off a separate company.

    But text campaigns are also the bane of my existence. I designed the system. I built it. I maintain it. ๐Ÿ˜…

    Text campaigns are built as linked lists. Technically graphs because there's branching and loops, but in practice they're often linked lists.

    Each node points to the next node. Each has a bunch of messages and a DSL that specifies how to GoNext.

    Supports skipping messages, delays, etc. It's neat.

    How do you implement that? Recursion. You interpret it like a programming language. You can think of it as a state machine too.

    You are at a node. You do what the node says. You call yourself with the next node. You keep going until skip = false.

    But you won't think of linked lists, graphs, DSLs, recursion, graph-data-as-programming-language, and state machines unless you've heard of them before. "Ah! This problem is like that other problem!.

    Pattern matching.

    In conclusion

    You don't need a computer science degree, or any degree, to get into web development. That's what I love about this field. It welcomes and accepts everyone.

    Knowledge you've got you can use, knowledge you don't you can't

    But if you've got the degree, use it! Solve interesting problems. Grow.

    I too didn't need my college skills when I was just starting out as a $7/hour PDF-to-website converter.

    Happy hacking โœŒ๏ธ ~Swizec

    PS: I understand I'm blessed that in Europe we believe college needs to be free to be any good. In USA this is the opposite. When you have to go into crushing debt to get a college degree ... well that's a different question. You don't need one, but if you've got it and you paid for it, find a hard enough job so you put that investment to use.

    Don't sell yourself short my friend

    Did you enjoy this article?

    Published on May 1st, 2019 in Computer Science, Technical

    Learned something new?
    Want to become an expert?

    Here's how it works ๐Ÿ‘‡

    Leave your email and I'll send you thoughtfully written emails every week about React, JavaScript, and your career. Lessons learned over 20 years in the industry working with companies ranging from tiny startups to Fortune5 behemoths.

    Join Swizec's Newsletter

    And get thoughtful letters ๐Ÿ’Œ on mindsets, tactics, and technical skills for your career. Real lessons from building production software. No bullshit.

    "Man, love your simple writing! Yours is the only newsletter I open and only blog that I give a fuck to read & scroll till the end. And wow always take away lessons with me. Inspiring! And very relatable. ๐Ÿ‘Œ"

    ~ Ashish Kumar

    Join over 14,000 engineers just like you already improving their careers with my letters, workshops, courses, and talks. โœŒ๏ธ

    Have a burning question that you think I can answer?ย I don't have all of the answers, but I have some! Hit me up on twitter or book a 30min ama for in-depth help.

    Ready to Stop copy pasting D3 examples and create data visualizations of your own? ย Learn how to build scalable dataviz components your whole team can understand with React for Data Visualization

    Curious about Serverless and the modern backend? Check out Serverless Handbook, modern backend for the frontend engineer.

    Ready to learn how it all fits together and build a modern webapp from scratch? Learn how to launch a webapp and make your first ๐Ÿ’ฐ on the side with ServerlessReact.Dev

    Want to brush up on your modern JavaScript syntax?ย Check out my interactive cheatsheet: es6cheatsheet.com

    By the way, just in case no one has told you it yet today: I love and appreciate you for who you areย โค๏ธ

    Created bySwizecwith โค๏ธ