From ce30bfcd9e8c64af50bf8ee46c8fe8d6249ab753 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Sun, 22 Sep 2024 01:57:31 -0600 Subject: [PATCH] Cleared up posts & fixed nav --- content/cognitive-load-of-syntax.md | 18 ------- content/goth-stack.md | 75 -------------------------- content/thoughts-on-ai.md | 18 ------- pages/templates/partials/navitems.html | 22 +++----- 4 files changed, 6 insertions(+), 127 deletions(-) delete mode 100644 content/cognitive-load-of-syntax.md delete mode 100644 content/goth-stack.md delete mode 100644 content/thoughts-on-ai.md diff --git a/content/cognitive-load-of-syntax.md b/content/cognitive-load-of-syntax.md deleted file mode 100644 index b85dede..0000000 --- a/content/cognitive-load-of-syntax.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: "Thoughts on Cognitive Load and Programming Language Syntax" -date: "February 07 2024" -tags: ["thoughts"] ---- -Recently, I started to pick up a new language in my spare time: Go. Was it partially influenced by the surge in HTMX popularity and how often Go is used alongside it? Almost certainly. But at some point along this journey, I noticed something: This is _so_ much more fun and _so_ much less draining. This whole post won't be me gushing about how much I love Go as a language, not directly. I started to notice a few things... - -# Oh, what fun... -I come from the JavaScript and TypeScript world with frameworks like Remix and Next.js. And the DX (Developer Experience) for these is lovely! For reasons I could not quite pin down, I was having much more fun with Go + HTMX despite the hacks to get close to the same DX. It came down to how darn easily I could pull off things I had previously relied on services for. Need a message queue to run on the edge? Easy, write a wrapper over Redis to use its PubSub. Need real-time updates to the UI? No problem, write a basic Server-Sent Events system with subscriptions and channels. Anything I wanted, I could build. That, and the way concurrency _"just works"_, and I could make anything I wanted happen. This brings a level of satisfaction that is hard to convey in an article. - -# What changed? -So this isn't meant to be a post to bash JavaScript, as much as I do have my reservations about the language. That being said, JS makes basic things like concurrency an afterthought. Go's lightweight threads, called goroutines, make it easy to write concurrent programs without worrying about the overhead of heavyweight threads. Even better, Go has channels that provide a simple and effective way of synchronizing communication between goroutines, making it easier to write concurrent programs free from race conditions. Similar concepts are present in Java, Rust (Tokio), C#, etc. Even better, error handling! Now, this is controversial, but forcing errors to be valued and allowing functions to assert that there _may_ be errors is a game changer for writing safer code. All of this amounts to a much lower cognitive load. I am less worried that my code is inefficient, error-prone, etc. I can just _write_. - -# What does this mean? -As a field, we can and should investigate and identify key points in programming languages that increase or decrease the mental load or overhead for developers. Imagine if we could identify these points and work to reduce the overhead. This has been on my mind as I reflect on my experience learning Go. I want to dive deeper into the details of what we can do to reduce this overhead and get back to writing good software without unnecessary restrictions. - -# Thanks! -Do you have any thoughts on this? Do you want to have a chat about the topic? Feel free to reach out by email at [me@atri.dad](mailto:me@atri.dad). Until next time! 🫡 \ No newline at end of file diff --git a/content/goth-stack.md b/content/goth-stack.md deleted file mode 100644 index 0a4378b..0000000 --- a/content/goth-stack.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -name: "Introducing the GOTH Stack" -date: "January 08 2024" -tags: ["article","golang"] ---- -# Enter the GOTH Stack! -The GOTH stack is something I've been trying to get to for a while now. It's not a specific repository with a fancy command that can scaffold a project for you. It's more like a set of pillars for building excellent, pleasant, full-stack web applications. - -# The first pillar: Go -Go is something I learned to love later on in my career. I was mainly writing JavaScript, building on serverless platforms and growing frustrated at the performance and limitations. Go changed all of that. - -What makes Go good?: -- Static types -- Incredibly easy concurrency -- Errors as values -- Incredible runtime and build time performance -- Tiny memory footprint - -The tl;dr is that it is challenging to write Go code that is _not_ performant. - -# The second pillar: Templates... well... Go templates -Go templates surprised me, to be completely honest. They offer just enough to get me going and perform exceptionally well. Sure, it's not as simple as a basic JSX file in Next.js since you need to make a route handler, but it works pretty well and supports basic control flow. I am interested in looking into alternatives such as TEMPL (which reads much like JSX for Go), but I need to find a real reason to move from the standard library here. - -Here is an example of a route handler passing a slice over to a template for rendering: -```go -package pages - -import ( - "HTML/template" - - "github.com/labstack/echo/v4" - "goth.stack/lib" -) - -type HomeProps struct { - Socials []lib.IconLink - Tech []lib.IconLink - ContractLink string - ResumeURL string - SupportLink string -} - -func Home(c echo.Context) error { - socials := []lib.IconLink{ - { - Name: "Email", - Href: "mailto:example@site.com", - Icon: template.HTML(``), - }, - } - - props := HomeProps{ - Socials: socials, - Tech: tech, - ContractLink: "mailto:example@site.com", - ResumeURL: "https://srv.goth.stack/Atridad_Lahiji_Resume.pdf", - SupportLink: "https://donate.stripe.com/8wMeVF25c78L0V2288", - } - - // Specify the partials used by this page - partials := []string{"header", "navitems"} - - // Render the template - return lib.RenderTemplate(c.Response().Writer, "base", partials, props) -} -``` -As you can see, it really isn't that bad! It also comes with many of the benefits of Go and the flexibility of components! - -# The third pillar: HTMX -So, up to this point, you may have been thinking: "Gee Atri... you can't do anything reactive here". Before HTMX, you would have been right. HTMX offers a more backend-centric developer a way to build complex reactivity to their front end through basic templating languages. It is one file you import in your template, and it enables anything from basic HTML swapping to WebSocket and Server-Sent Event support. It is really, really powerful and worth looking at all together. - -With Go managing route handlers and API routes, the template language running the UI, and HTMX governing interactivity on the front end, you can effectively write a fully dynamic full-stack application without writing a line of JavaScript code. It even runs quite a bit faster than some of the JS world's frameworks (Astro, for instance). It is actually what powers this site right now! The fundamentals are essential here and come together for a clean and enjoyable developer experience. I encourage everyone in the JS world to give it a shot! Perhaps it is not your thing, and that's okay! But you might also just fall in love with it! - -# Thanks! -If you found this helpful, please let me know by email at [me@atri.dad](mailto:me@atri.dad). Until next time! \ No newline at end of file diff --git a/content/thoughts-on-ai.md b/content/thoughts-on-ai.md deleted file mode 100644 index bfac382..0000000 --- a/content/thoughts-on-ai.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: "Thoughts on AI" -date: "April 09 2024" -tags: ["thoughts", "ai"] ---- -I'm a bit late to the party, but AI has definitely taken off lately. Every product we use now seems to have some sort of AI integration or feature baked in to capture some of the hype. How do I feel about it? Well… thats complicated... - -# Memes -If you dig around my GitHub you'll surely stuble upon Himbot, my Discord bot project. This is where I used to enjoy AI. For memes. I had two commands: "ask" and "pic" which generated text and images respectively. Now, I didn't write some complex algorithm for this. It used Replicate to access open source models. As it turns out, this made the bot quite fun. Have an unhinged discord conversation that needs image replies? All you had to do was throw some no-context nonsense into "/pic" and see what happens! It was amazing! This honeymoon period didn't last long... - -# Capitalism -Capitalism ruins all things. Including AI. Now what could be a useful and fun technology is rammed into every product ever at the _expense_ of its users just to check a box for shareholders. Notion? It has AI now. Snapchat? Yup… an AI assistant there too. Want to use windows? I hope you aren't planning to ignore Microsoft's new OS level AI Copilot! There is no escape it seems. Even DuckDuckGo and Brave Browser are using it now (although given Brave still clings to the trash that is Web3 I am less surprised there). My point is, there is definitely going to be AI fatigue, if there is not already. Capitalism won't let us forget about this though, since it seems to line the pockets of the ultra-rich anyways. Want to make a game but don't want to pay an artist? Just pay for some compute and generate images with **prompt engineering**! How did that model get the data to learn to do this? No need to worry your little heads over that detail if its making you money! All of this and more is enabled by this technology and encouraged by our economic systems. - -# What can we do? -What can we do about this? Is there a hope for us trying to escape AI? Honestly, I am not sure. But I am definitely trying. I have removed copilot from my Windows install, and I refuse to use anything that forces me to use AI. Being concious about how you use AI is key. With so many of these models trained on the work of skilled creatives, it is _our_ responsibility as consumers of this technology to ensure that we are _always_ paying professionals for their work, and not using their skills for free via a heartless algorithm. Lastly, be causious of products that add AI for seemingly no reason. There is a good chance your data is being used to train it. - -# Thanks! -Do you have any thoughts on AI? Do you use it? If so, how? Feel free to reach out by email at [me@atri.dad](mailto:me@atri.dad). Until next time! 🫡 \ No newline at end of file diff --git a/pages/templates/partials/navitems.html b/pages/templates/partials/navitems.html index bd86bed..9bd8894 100644 --- a/pages/templates/partials/navitems.html +++ b/pages/templates/partials/navitems.html @@ -1,27 +1,17 @@ {{define "navitems"}}
  • - - Home - + Home
  • - - Projects - + Projects
  • - - Talks - + Talks
  • - - Tools - + Tools
  • - - Blog - + Posts
  • -{{end}} \ No newline at end of file +{{end}}