Log inSign up
David K ๐ŸŽน
28K posts
Image
user avatar
David K ๐ŸŽน
@DavidKPiano
Making state machines at @statelyai ยท I play piano
Orlando, FL
stately.ai
Joined December 2012
2,704
Following
86.8K
Followers
  • Pinned
    user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Apr 28, 2023
    We're making it even easier to create state diagrams. โžก๏ธ state . new
    Image
    00:00
    357K
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Aug 29, 2020
    Facebook is extremely over-engineered for a birthday reminder app
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    May 30, 2025
    Replying to @jacobmparis
    That's easy URL stands for Uniform Resource Locator URI stands for Uniform Resource Iocator
    104K
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Sep 10, 2024
    Interviewer: Invert this binary tree Junior dev: Here's the algorithm I memorized Experienced dev: Let me find a library for that Senior dev: Does inverting the tree align with our core business objectives?
    600K
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Aug 15, 2019
    Developers: lets/ โ”œ store โ”œ files โ”œ in โ”” some/ โ”œ super โ”œ organized โ”” opinionated/ โ”œ hierarchical โ”” structure Also developers: import { something } from "../../../../../../../"
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Jul 22, 2019
    Junior dev: "why isn't this working?" Senior dev: "oh, you just need to do X, Y, and Z" Junior dev: (wow they're so smart) Senior dev: (wow I made that mistake so many times)
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Jul 28, 2025
    Why hire a $150k/year dev when you can just pay $200/month for an AI coding agent and $200k/year for a dev to fix its code?
    206K
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Nov 13, 2025
    I have no idea what to name my baby At this point I'll just name him "utils"
    234K
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Nov 25, 2022
    GitHub Copilot is really amazing. I used to spend hours writing error-prone & sometimes incorrect code manually, but now, that error-prone incorrect code is automatically generated in seconds.
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Jun 11, 2019
    Developers: "I guess accessibility is important to some people, we'll get around to it" Developers at conferences: ๐Ÿ—ฃ๏ธ "CAN YOU INCREASE THE FONT SIZE I CAN'T READ THE CODE"
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Aug 31, 2022
    โš›๏ธ React tip: when conditionally rendering component based on some string enum (like a role), use an object to map enum values to components. This can be cleaner than using conditional operators, and it keeps the logic organized & clear.
    Screenshot of code showing clear mapping between role and component. 

const RoleViews = {
  ADMIN: AdminView,
  EDITOR: EditorView,
  GUEST: GuestView,
  // ...
};

const SomeComponent = () => {
  const role = useGetUserRole();

  const RoleSpecificView = RoleViews[role] ?? DefaultView;

  return (
    <main>
      <RoleSpecificView />
    </main>
  );
};
    Screenshot of code showing description of difficult to read and hard to understand mapping between role and component.

const SomeComponent = () => {
  const role = useGetUserRole();

  return (
    <main>
      {role === 'ADMIN' ? (
        <AdminView />
      ) : role === 'EDITOR' ? (
        <EditorView />
      ) : role === 'GUEST' ? (
        <GuestView />
      ) : (
        <div>Default view</div>
      )}
    </main>
  );
};
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Apr 23, 2018
    The levels of testing code
    Manually test the code
Write hundreds of unit & integration tests for the code
Model the code and automatically generate exhaustive tests for every possible permutation of the code
Formally prove that it is mathematically impossible for the code to have bugs
Delete the code
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Apr 29, 2020
    Junior developers: "I have no idea how to solve this one problem; I'll never get good if I just keep Googling for the answer" Senior developers: (46 tabs open to Google and StackOverflow for one problem)
  • user avatar
    David K ๐ŸŽน
    @DavidKPiano
    Sep 19, 2025
    If you're using Tailwind, don't sleep on child selectors. They clean up your styles and eliminate repetition. Vibe coding agents aren't smart enough to do this. (if you're using CSS, keep scrolling)
    Before
<table>
  <tr>
    <td className="px-3 py-2">CSS</td>
    <td className="px-3 py-2">Great</td>
  </tr>
  <tr>
    <td className="px-3 py-2">Tailwind</td>
    <td className="px-3 py-2">Fine</td>
  </tr>
</table>

After
<table className="[&_td]:px-3 [&_td]:py-2">
  <tr>
    <td>CSS</td>
    <td>Great</td>
  </tr>
  <tr>
    <td>Tailwind</td>
    <td>Fine</td>
  </tr>
</table>
    421K

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

TermsยทPrivacyยทCookiesยทAccessibilityยทAds Infoยทยฉ 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up
Advertisement
Advertisement