Syntax Video
Why is the web essentially $h!t now??
Transcript
Why is the web essentially? Now, we're gonna we're going to get into it. So, uh we found this post on Reddit on r/webdev from frontend dev mark and they say this is a get off my lawn post from someone who started working on the web in 95. Am I the only one who thinks that the web has mostly just turned to [ __ ] It seems like every time you visit a new website, you're faced with one of several atrocities. Cookie warnings that are coercive rather than welcoming. Sign up from our newsletter, please. intrusive geolocation demands, requests to send notifications, videos that pop up, login banners that want to track you by some other ID, carousels that are the modern equivalent of the marquee tag, the 29th media request that hits a 404, pages that take 3 seconds to load. The thing that I keep coming back to is that developers have forgotten that there is a human on the other end of the HTTP connection. As a result, I find very few websites that I want to bookmark or go back to. The web started with an egalitarian informationcentric motivation, but has devolved into a morass of dark patterns. This is not a healthy trend and it makes me wonder if there is any hope for the emergence of small sites with an interesting message.
We now return to your search for the latest cool JavaScript framework. Don't abuse as your reader in the process. [laughter] So, what do you guys think? I have my thoughts, but yeah, what do you guys think? Money. It's money. So many of these things are marketers and and people trying to squeeze as much money out of their product as possible, which like go for it. However, it's all selferving. you you add in a like a popup to sign up for the newsletter or some silly spin or whatever. And as much as we like techies say we hate all of this stuff, it works. It works super well. and and regular people are fine with going to a website and having things shift down and [music] and pop up over top because like like one example is that like we go to Riverside four or five times a week and I go to the login button and I load it and it it pushes the screen down cuz they have some sort of banner to tell us. So all of a sudden
I it's moved and then the Google login with Google overlaps the login button. So, I accidentally click that and it makes me so mad every single time. And you know what? Those banners work super well. I sell courses and they work super well. Those login with Google's, they help the sign-ins go all the way up. So, the bad thing is that this stuff works.
Yeah, that's really it is that somebody said, "All right, this increased my conversion by this percentage." And then everybody did it. I was even trying to log into Hulu the other day. I hate Hulu. Hulu has the worst interface. Hulu's on blast. I have the three thing bundle with ESPN cuz I want to watch hockey and Hulu and whatever. I log in to Hulu on the TV. It says you don't have an active account. I log into the ESPN Disney thing. It says I have the bundle. I then log in to Disney. It says I have the bundle. I log into Hulu on my phone. It says I have the bundle. I log in with the same account on my TV and it doesn't effing work. In some systems it's all money driven. In other systems, it is no care put into anything.
It's just a lack of attention to to detail. Like the whole Apple ecosystem is exactly the same way. It's so infuriating that like none of the stuff works well together. Yeah. My thought is because we're technical and we build these sites, we probably notice it a lot more or we we feel like something can be done because we try not to do these things on the sites that we have control of. But for a lot of nontechnical users, I feel like they kind of just are like, "Oh, I guess that's the way the web is." They don't A lot of people Yeah. A lot of people aren't uh in the mindset of like, "Oh, it shouldn't be this way." They kind of just accepted it. It's a lot harder when you're at a larger company with so many competing priorities cuz again, it comes down to money, right? Like you're just the developer. You're trying to do your best. You're you're trying to advocate for not having all of this stuff, but then your manager comes in or the marketing manager comes in or the CEO comes in and they're like, "Oh, well, we need this and we need that." And it's all these competing priorities that just creates a giant mess.
Yeah. Yeah. Someone's not going to like reach outside their org to say be like, "Hey, we shouldn't pop up this newsletter so obnoxiously." Um because also the person that's in charge of the newsletter is not going to take that cuz their signups are going to go down 10%. And then they're they're sitting waiting to answer for that. Yeah.
You know who I appreciate for this is Netflix. Their app is good. Every single TV app is good. That even on low power devices, it's all good. And they still managed to experiment with UIs and conversion rates and clickthrough rates and all this stuff, but somehow that app performance is rock solid and I never feel like I'm struggling to find things on there.
[music] Uh so like when you have good experiences like that and then you have terrible ones, you're always like, is it the career? Is it the team? Is it the management? Is it the design? Like what is the UX developers? Like what is it? So yeah, the web is that way. Now I would say if do your best to try and change it, right? Like I don't want to and you like on a bad note of like the web is just that way. But yeah, like if you have the power to bring it up in meetings, you know, do do your part you there watching this video.
Anti-gravity deleted my whole D drive. So, this guy, poor guy, posted on Reddit where he had an agent and let it rip and it actually deleted an entire hard drive off of his system. And he went and detailed like how it worked and what what all the commands were and how he asked after the fact. He asked the AI like, "Did you just do that?" He says, "Yes, I'm so sorry. I hope you can recover that." Um, and we've seen this story pop up several times now, and it's awful to see, but if you have your terminal commands, like you can like whitelist commands. I think Curo does a pretty good job at like detecting if something even if you tell it it can auto run, it'll still like try to sus out if it should autorun something. But at the end of the day, if it's running millions and millions of commands amongst millions of people, something like this is bound to happen. And the solution to this, unfortunately, is either you run this thing in a container where it cannot reach outside the
bounds, right? Like if you're allowing some arbitrary terminal commands to be autorun, you're going to have a bad time at some point. So you got to run it in like some sort of Docker container or something like that or you have to be a little bit more cautious and you have to sit there and approve them. Maybe just whitelist several of them, you know, like don't whitelist RM um [laughter] which probably Yeah, I I mean I personally don't ever want AI touching my D, but like I think that this is very possible that these things are just going to pop up more and more. Have you guys ever had AI do something destructive on your machine?
I've had it delete code, but I had checkpoints for that. So, that was nothing crazy, but I I beyond deleting. Yeah, I haven't run into like any RMR RF or dropping a database yet, but I do I do run things in a container. So, I think that's that's the main thing that you should be doing because if it goes wrong, you can always roll back. So, what what's your setup like? Like what what does that look like, CJ? So, you want to run like an IDE, a VS Code or one of the forks and like how do you do that with Docker?
Recently with Cursor, they released uh I believe it's called containers. So, when you're running commands over here in the agent window, you can actually have it run it inside of a container and it sets all of that up for you. So, it basically like it has your code living inside of a Docker container and everything it runs is not directly on your machine. So, if it ever deleted rm-rf/ it would just be the Docker container.
You can also do like a manual setup or use things like dev containers. So there's a whole uh dev container spec which basically makes it so that your codebase and your shell and everything you're doing is happening in a container, but then there's a a way [snorts] for VS Code to make it look like you're actually editing the code on your machine. So yeah, containers feels like it's local. The dev containers are pretty awesome. I I need to get more projects set up with that because it it's also a lot more portable as well.
You can you can run it in the cloud or you can move it to a second machine and you don't have it have to like worry about actually having the machine where your code is running and if you move to another machine you have to reset up everything. Yeah, I had an AI agent write a SQL that deleted all the content from my database without me asking for it to do that. Now granted, it's like it's a development database. I have copies of it. I have data dumps or whatever. It wasn't a big deal, but it did it entirely on its own accord. I was writing some migration scripts for uh my habit tracker app and it was just like, "Oh, I wrote this one and applied it for you." And I was like, "Oh, great. Thank you. I didn't ask you to do that." You know, and it's like, "I thought you wanted the data gone for some." I don't even know why, but it was like it wanted to delete it. It thought I wanted to delete the data. And man, these things just do whatever they want.
This next one is from author Herzen. What's the best way to learn with AI without it coding for you? I wish to learn how to code myself without the AI doing the actual coding, but I do want it to teach me. What would the best tool for that be? Preferably one that sees my IDE, codebase, a desktop agent, cloud code, cursor. Thanks for the tips. Yes.
Okay, so this one is interesting and I actually had a section on this in my my recent conference talk but uh best way to learn AI is to use AI to take information whether that is data code documentation whatever and make it in a way that is consumable for you to understand because when it starts to write that code even if you approve of that code and you read all the lines of that code eventually you're just going to start hitting command Y and accept that it looks fine, looks close enough, and then you'll slip a little bit. Next thing you know, like your brain isn't doing that cognitive work to actually understand what's happening, even if you can read the lines of code. Like I I remember, I don't know if you guys were like this, but when you're learning how to code, you could copy code from a book, a tutorial, or whatever, and you would copy it by hand. You would write it, you would read it, you would understand it, but you didn't really know it, right? you didn't truly
comprehend what it was doing. And to me, this is like very much the same thing. So, you have to really uh utilize it in a way that is getting [music] information into you that you can consume rather than doing the work, right? I think the hardest part is not just asking AI to do it for you, right? Cuz it's so easy, right? It's just built into the editors now. So, one suggestion I have for you is to turn off AI in your editor and just use something like the chat GPT window or the cloud window. So that way there's a little bit of a barrier where you can still ask it things, but you're not letting it just write the code for you. And I think it's really funny that they said that learning to code is archaic. It is not archaic. Like the the code that AI is outputting is the same code that we were writing by hand 5 years a 3 years ago.
So learning to do that will just make you a more competent developer. And when you are using AI and it gets stuck, you're going to have the skills to be able to unstuck yourself now. So yeah, the thing is put in the work and you can ask AI. Don't ever ask AI to solve it for you. Don't copy paste the code that AI is outputting for you. But you can ask it things like what is this framework or where should what should I search the web for if I want to learn about this other thing. Basically just don't ask for the answers. Don't let it give you the answers. But it [music] could still be useful in pointing you in the right direction. Similar to like a real mentor would do.
Yeah. I find it extremely helpful to use AI to get ideas and patterns. If I'm venturing into an area that I've I've never been into before, I'll ask it for like the other day I asked it for like like what is this curve equation called in CSS, you know, like I I [clears throat] wanted to exponentially grow something up like like what is that even called or like we were trying to figure out what the best algorithm for diffing images are and like I was like that's kind of not an area I'm comfortable in. I don't really know much about that. So instead of asking it, hey, just diff these, I would say, what would you possibly use? And in your code editor, you can just simply switch it to the ask tab or like CJ said, I would probably just go reach for some sort of inline chat where you can say, hey, I'm I'm working on X, Y, and Z. What are my options to to go forward with that? And because so much of programming is just like higher level ideas, design patterns, how to tackle problems. And if
you can ask it about that, then you can form an idea of how to tackle something [music] and you're going to be much better off. Yeah, I think one of the questions they had in here in the notes was preferably something that can see my IDE in codebase. I say you shouldn't do that because learning how to describe your problem and describe the the state of your codebase to the AI. When you do that, you're actually learning like you're actually uh internalizing how your code actually works instead of just letting AI do everything for you. I like that. Yeah. And I I agree. There are some times when it's nice to ask questions about what is this doing, how is this doing this, and like give me some of that. But I I do think the more you rely on it, the easier it gets to just kind of get lazier and lazier and then therefore the things that you are actually picking up become less and less.
Yeah. I'm also thinking we could use some of the things that people did when before AI. So like maybe they were learning to code from a video and just watching a video about somebody teaching code is not enough for you to learn it. You have to actually pause the video go and do it and the argument used to be [laughter] should I don't copy paste type it yourself even though it's like it's just markup you know just type it yourself and you'll get comfortable with it and the argument has not necessarily changed it's just should I be copying and pasting or should I be allowing AI to do it? Exactly.
This next question is from adventurous meet 5176. They ask, "What's a small programming habit that improved your code readability? I've been trying to improve my coding practices, and I'm curious about habits that help with writing clearer, more maintainable code. One thing that helped me personally was slowing down and choosing more descriptive names for variables and functions. It sounds simple, but being intentional about naming has made my projects easier to understand when I revisit them later. Another improvement was setting up a consistent branching workflow in Git instead of making random commits on main. and made my process feel a lot more structured. I'm looking to pick up similar small but meaningful habits from others. What specific technique or routine has helped you write cleaner or more understandable code? I think they're already on it with the stuff that I do all the time. So worrying about variable names and function names. Um so I used to talk about the way I code as writing self-documenting code because there's this idea that instead of writing comments, you just write code.
Oh my gosh, you were one of them. I was one of you don't need comments to speak for itself. Yes, but I actually still think that I think like if you if you can read code and the variables are descriptive and the function names are descriptive and reading the code itself uh gives you an understanding of what it does. I think that's great. Obviously, you shouldn't lean on that all the time.
Sometimes we do need we do need comments, but I think that's a great great place to start. There's a lot of really good resources. If you're in the world of JavaScript, there is a GitHub repo called Clean Code JavaScript with a ton of examples of like good and bad. It shows code that isn't clean and then code that is clean. So you can start to pick up some of those habits. Yeah. And I agree with the uh naming of commits like be make sure that you're and these days it's a lot easier with AI cuz AI will give you a very descriptive commit name and description of what you just changed. But overall hygiene of like making sure your code base is readable and and the idea that you could come back to this code in 6 months from now and pick up where you left off.
That's that's the main goal here. Yeah. Commit frequently too, right? Yeah. Mine is one thing that I started doing many years ago and this it really improved my code readability especially as we got into promises is dealing with the error first. So if you have a callback function the error should always be first and dealing with all the possible things that could go wrong right up front at the top of your function [music] has makes for much more readable code because first of all it's it's important that you deal with the errors and and not with [music] your happy path of what you think is supposed to happen. And then second of all, once you're done with all the cr of like these are the bad things that could happen, then you're on your happy path and you're not cramming a whole bunch of code into an if or an else or into into a then or whatever, you know, like if if your main logic of what's supposed to happen on like a route or like an API call is stuffed inside of a a then or like it's nested deeply inside of a bunch of brackets. I find that very frustrating. So, I like to go nice and
early. you can throw deal with your errors or whatever and then below that you're just everything is is daisies. I completely agree. I think the term is early return [music] and basically instead of having nested ifs, you check the not case first. If it's that case, then you throw the error up top instead of having to do it deeply nested down. Yeah, I love that.
Yeah, my tip for writing better code is really to write things that are predictable. So have an organized structure. So, sometimes we get into a flow of especially folks with ADHD, right? Where we're uh let's say you have your TypeScript types and you're you're here where I am right now and I'm just going to put this type here and I'm just going to write it by hand at this point or whatever as opposed to keeping them in a system, right? Systematize your stuff in a way that makes sense and then don't drift from that system where where you're defining things in a file. I'm always going to find them in the same order. That way, these patterns become predictable every time you enter a new file, you know what to look for. And as long as those predictable patterns exist, where the things are located, you're never going to be coming into a codebase that is a mess. Uh because you're always going to know where to look for things. And in that same regard, utilize formatterers on save,
prettier, onsave, whatever it is. It's crazy that in in 2025 that there's some people who aren't doing that still, but uh having an auto formatter, coming up with a specific format, and then uh of course removing all the semicolons from your code. [laughter] I'm just kidding. I'm just saying that to hurt CJ's feelings. I'm not Yeah, but I completely agree like if you let the tools do the work, like the formatting and the linting, then you that's something that you don't have to worry about. It's off your cognitive load. So every single project I set up has a llinter has a formatter llinter formatter predictable patterns same structures same organization.
Yeah. One more question on the same idea is that there's this idea of when you open up a file the topmost code should be what that file does and then the lower code should be how it does it. So if you have like a route, you put the the actual route handler up top and then if you have other functions and things that need to go below it of as to like how it actually handles it, those should go a little bit lower versus the opposite. Do you agree with that?
I kind [snorts] of do the opposite. Uh, honestly, yeah, I do the bits and bobs first and then the Yeah. And then the actual handler down there. I don't know if it's that much of an issue with like clicking through cuz like if I'm if I'm like going to a function for it to do something, I'm not like going to the file and then scrolling down. I'm just clicking through to the function where wherever the hell it is and it just opens that file at that spot.
Exactly. I think with modern editors, [music] you're not just opening a file anymore. It's like go to definition like you're following the code. So at the end of the day, you're not going to end up at the beginning of the file that you need to scroll down to. This is another coding pattern I think called above the fold and below the fold. So above the fold is what this file is about. Below is more so like implementation.
Yeah, I think that probably is a good pattern to do. Not one that I've ever adhered to though. Doesn't hurt. And at the end of the day, guys, does it really even matter? Because eventually AI is going to write all this code for us, right? [laughter]
Quote it with credit and a link. Quoting Syntax