hello Javascript, oh how I've missed you

Web Dev Cody
14 Aug 202427:51

Summary

TLDRIn this video, the creator reflects on their two-week journey with Go, HTMX, and Temple, initially attracted by Go's performance but eventually returning to Next.js due to a better developer experience. They discuss the verbosity of Go, its superior error handling, and the frustrations with HTMX's mental model compared to React and Svelte. Despite recognizing Go's strengths, they prioritize developer experience and productivity, choosing familiarity with JavaScript and TypeScript over exploring new technologies.

Takeaways

  • 🎥 The speaker transitioned back to Next.js after a two-week experiment with Go and HTMX, finding the developer experience with JavaScript more enjoyable.
  • 📉 Despite Go's performance benefits, the speaker missed JavaScript's features like string interpolation and the flexibility of TypeScript.
  • 🛠 Go's error handling was appreciated for its explicitness, but it also added verbosity that the speaker found cumbersome for quick prototyping.
  • 🔄 The speaker encountered issues with HTMX's mental model, preferring the reactive data model of frameworks like React, Vue, and Svelte.
  • 💻 The use of VS Code with Go and Temple was problematic, with the speaker experiencing a disconnect in the editor when working with templates.
  • 📝 The speaker found Go's package system to be rigid, making simple tasks like file-based routing more complicated than necessary.
  • 🔧 The speaker's experimentation with different stacks, including Laravel and Elixir, ultimately led to a reaffirmation of their preference for JavaScript and TypeScript.
  • 🚀 The productivity and vast ecosystem of Next.js, React, and associated libraries were highlighted as significant advantages for quick feature implementation.
  • 🔍 Debugging and maintaining UI states were easier with React's data-driven approach compared to HTMX's server-driven component updates.
  • 🛑 The speaker faced bugs and inconsistencies with HTMX and Temple, which added to the decision to switch back to familiar technologies.
  • 🔗 The speaker values the lack of context-switching between front-end and back-end development when using JavaScript/TypeScript for both, streamlining the development process.

Q & A

  • Why did the author initially decide to create a video about saying goodbye to JavaScript?

    -The author created the video 'Goodbye JavaScript' after experiencing performance issues with their Node server and discovering the superior performance and simplicity of Go and HTMX.

  • What was the reaction to the author's video titled 'Goodbye JavaScript'?

    -The video received more views than expected and notably, the Prime Engine reacted to it, which the author was excited about.

  • What issues did the author encounter when transitioning to Go and HTMX?

    -The author faced several issues such as verbosity in Go, disconnect in the editor experience with HTMX templates, and difficulties with error handling and package system rigidity.

  • How does the author feel about Go's error handling compared to Node.js?

    -The author finds Go's error handling to be significantly better than Node.js due to its explicit error returns and the ability to anticipate potential errors at function definitions.

  • What was the author's experience with HTMX's syntax and template handling?

    -The author found HTMX's syntax and template handling to be less intuitive, especially when dealing with inline templates and the disconnection in the editor when navigating between files.

  • Why did the author decide to switch back to Next.js?

    -The author decided to switch back to Next.js due to the developer experience, the familiarity with JavaScript and TypeScript, and the ease of maintaining and debugging complex UIs.

  • What are some benefits of using Go according to the author?

    -The author acknowledges that Go is simple to learn, performant, and has a good error handling system. It also compiles down to a small binary that is easy to deploy.

  • What challenges did the author face with HTMX in terms of UI complexity and maintenance?

    -The author found HTMX challenging when dealing with complex UIs due to the need to manage IDs and the lack of type safety, which made it difficult to maintain and debug.

  • How does the author view the mental model of HTMX compared to other frontend frameworks?

    -The author prefers the mental model of other frontend frameworks like React, where the UI reflects the data model updates, as opposed to HTMX's model where the backend is responsible for sending components.

  • What was the author's experience when trying to implement a counter with HTMX in comparison to React?

    -The author found it cumbersome to implement a counter with HTMX, requiring inline JavaScript and dealing with IDs, whereas in React, it would be as simple as updating the state and recomputing the UI.

  • Why did the author decide to stop experimenting with different tech stacks?

    -The author decided to stop experimenting due to the time investment required to learn new stacks and the realization that their productivity and enjoyment were higher with their familiar JavaScript and TypeScript stack.

Outlines

00:00

😅 Struggling with Go and HTMX: A Developer's Dilemma

The speaker begins by expressing initial hesitance to create the video, reflecting on their two-week journey with Go and HTMX. They recount the attention their previous video, 'Goodbye JavaScript,' received and the contrasting experiences they had with Go's performance and verbosity compared to JavaScript. The speaker also acknowledges the superior error handling in Go but finds it cumbersome at times, especially when rapid prototyping is needed. They mention their comfort with Next.js and the biases that come from being a JavaScript developer, setting the stage for a detailed discussion of their dislikes and challenges with Go and Temple.

05:00

🤔 Go's Verbosity and Error Handling: A Double-Edged Sword

The speaker delves into the verbosity of Go, particularly when it comes to string interpolation and the absence of features like JavaScript's template literals. They contrast this with Go's robust error handling, which, while more explicit and safer, can become verbose and tedious. The speaker also discusses the challenges of working with databases and third-party APIs in Go, where error handling becomes crucial but also cumbersome. Despite recognizing Go's strengths in error management, they express a preference for the flexibility and rapid development capabilities of Node.js and JavaScript.

10:01

😐 Navigating Go's Package System and Temple's Syntax

The speaker discusses the rigidity of Go's package system and the challenges it presents when organizing code, especially when compared to the flexibility of JavaScript's module system. They share frustrations with Temple's syntax and the disconnect it creates within the editor environment, such as the inconvenience of navigating between template files and their compiled Go counterparts. The speaker also touches on the overhead of managing multiple file types generated by Temple, which they find clutters their codebase and detracts from the development experience.

15:03

🔧 Experimenting with HTMX and Hono: A JavaScript Developer's Perspective

The speaker shares their experience trying HTMX with Hono, a JavaScript framework, to see if the language familiarity would make a difference. They find themselves writing JavaScript in an unconventional way to achieve simple tasks, which highlights the friction they feel when using HTMX compared to the reactive data models of React or Vue. Despite HTMX's innovative approach to handling UI updates through server responses, the speaker finds it less maintainable and more complex than the state-driven approaches they are accustomed to.

20:04

😓 HTMX's Complexity in Sophisticated UIs and Debugging Challenges

The speaker elaborates on the difficulties they encountered with HTMX, especially when dealing with complex user interfaces and the need for precise debugging. They express a preference for the straightforward data model updates in React or Vue, which automatically reflect in the UI, as opposed to HTMX's approach, which requires manual management of UI state through server interactions. The speaker also mentions specific issues they faced, such as persistent loading indicators and buttons not re-enabling, which led them to contribute to HTMX's development by reporting and fixing bugs.

25:05

🛑 Embracing JavaScript and Next.js: A Return to Familiar Productivity

In the final paragraph, the speaker concludes their experimentation with various new technologies and frameworks, deciding to return to their roots as a JavaScript and Next.js developer. They reflect on the productivity and ease of implementation that Next.js and React offer, especially when compared to the challenges faced with Go, Temple, and HTMX. The speaker acknowledges the learning experiences from trying new technologies but ultimately prioritizes the efficiency and joy of coding with the tools they know best.

Mindmap

Keywords

💡Nextjs

Next.js is a JavaScript framework for building user interfaces and web applications. It is known for its server-side rendering capabilities and ease of use with React. In the video, the creator expresses a preference for returning to Next.js after experimenting with other technologies, citing familiarity and good developer experience as reasons.

💡Go

Go, often referred to as Golang, is a statically typed, compiled programming language designed at Google. It is known for its simplicity, performance, and efficiency in terms of memory usage. The video discusses the creator's experience with Go, highlighting its performance benefits but also verbosity in certain aspects like string interpolation.

💡HTMX

HTMX is a JavaScript library that allows developers to create dynamic and interactive websites using HTML and server-side technologies without writing much JavaScript. The script mentions the creator's dissatisfaction with HTMX due to its complexity and lack of maintainability for sophisticated UIs.

💡Error Handling

Error handling refers to the process of responding to the occurrence of various types of operational faults programmed within a software system. The video contrasts error handling in Go, which is explicit and part of the language's design, with the more implicit handling in Node.js, where developers must anticipate and manage exceptions.

💡Type Safety

Type safety is a property of a programming language that prevents type errors by enforcing rules on the types of values at compile time. The creator appreciates the type safety in Go but finds it restrictive compared to the flexibility of TypeScript, which allows for rapid prototyping and less strict type enforcement.

💡Verbosity

Verbosity in programming refers to the use of more words or code than necessary to achieve a particular task. The video script mentions Go's verbosity, particularly when it comes to string formatting and error handling, which the creator finds cumbersome compared to JavaScript's more concise syntax.

💡Developer Experience

Developer experience (DX) is a measure of how easily and efficiently a programmer can work with a particular tool, framework, or environment. The video emphasizes the importance of a good developer experience, with the creator opting for technologies that enhance productivity and enjoyment while coding.

💡Performance

In the context of software, performance refers to how fast and efficiently a program runs. The script discusses the superior performance of Go in terms of memory usage and execution speed compared to Node.js, which was a significant factor in the creator's initial attraction to Go.

💡Concurrent Programming

Concurrent programming involves writing programs that can execute multiple tasks simultaneously. The video mentions Go's built-in constructs for handling concurrency, such as channels, which the creator finds more elegant and convenient than Node.js's approach using workers.

💡Ecosystem

In software development, an ecosystem refers to the community, tools, libraries, frameworks, and platforms that support a particular programming language or technology. The creator expresses a preference for the JavaScript ecosystem due to its vast array of packages and the ability to quickly implement features without context switching.

💡Indie Hacker

Indie Hacker is a term used to describe an individual or small team that creates and operates a software product independently. The video's creator identifies with this mindset, valuing the ability to quickly prototype and ship projects, which influenced their decision to return to familiar technologies like JavaScript and Next.js.

Highlights

Creator's transition from JavaScript to Go and HTMX, and eventual return to Next.js due to developer experience preferences.

Go's performance advantages and simplicity in creating bundles compared to Node.js, but verbosity in string interpolations.

Go's superior error handling compared to Node.js, with explicit error returns and handling at function calls.

The frustration with Go's verbosity, especially when dealing with simple tasks like writing to a database and wanting to panic on errors.

The creator's preference for JavaScript's flexibility in quickly prototyping without strict type enforcement.

The benefits of Go's compiled binaries for easy deployment, contrasting with the interpreted nature of JavaScript.

The rigidity of Go's package system and the difficulty in organizing code across different directories and packages.

The creator's dissatisfaction with HTMX's approach to frontend development, preferring React's data-driven UI updates.

HTMX's lack of type safety and the difficulty in maintaining UI state, especially with complex applications.

The challenges with HTMX's mental model of having backends responsible for UI components, leading to unmaintainable code.

The creator's unsuccessful attempts to enjoy HTMX after trying it with different backends like Go and Hono.

The productivity and ease of use of JavaScript and Next.js ecosystems, especially for quickly integrating third-party packages.

The creator's realization of the limitations of trying new stacks and the decision to focus on their strengths with JavaScript.

The comparison of different backend frameworks like Laravel and Elixir, and the creator's preference for flexibility over built-in functionality.

The creator's decision to embrace their identity as a JavaScript developer and the commitment to focus on Next.js for future projects.

Reflection on the learning process and the value of exploring different technologies despite returning to familiar tools.

The importance of developer experience and productivity in choosing the right technology stack for project success.

Transcripts

play00:00

so I feel kind of dumb making this video

play00:02

and I was honestly just going to like

play00:04

not even make this video and just let my

play00:06

slow transition back to nextjs but I

play00:08

figured maybe you all can just hear my

play00:10

perspective on the go htx journey I went

play00:12

on for two weeks so two weeks ago I made

play00:14

a video called goodbye Java Script it

play00:16

got a lot more views than I was

play00:18

expecting and also the prime engine

play00:20

reacted to it which I was actually

play00:21

psyched about I appreciate you reacting

play00:23

to my video but with that all being said

play00:25

and all the complaining that I did in

play00:26

that video about like the performance of

play00:29

my node server eating up memory and how

play00:31

go is like so much more performant and

play00:33

just simpler to create a bundle with as

play00:36

I started coding with go and HTM X and

play00:38

Temple there's just so much stuff I ran

play00:41

into and I realized that I would rather

play00:44

have a hit in performance if I have a

play00:47

good developer experience and so this

play00:49

video I'm going to talk about some of

play00:50

the things I ran into when coding with

play00:52

go Temple HTM X and things that I'm just

play00:55

like I don't really like this i' rather

play00:57

just switch back to nextjs maybe it's

play00:59

because just a JavaScript developer and

play01:01

I'm familiar with nextjs and so my

play01:04

opinions are probably going to be biased

play01:06

secondly it's also because I'm using vs

play01:08

code a lot of these complaints are

play01:09

because I'm using vs code and not neov

play01:11

but let me just list out some of the

play01:12

things that bothered me about go and

play01:15

Temple and and I would say these

play01:17

concerns like impacted me enough where I

play01:21

just felt a relief cing in nextjs again

play01:24

so let's talk about some of these things

play01:26

and you guys can leave comments I know

play01:27

you guys are going to leave comments and

play01:28

be angry because I'm not um embracing go

play01:30

fully let's talk about the good about go

play01:33

I'm not writing go off I think go is a

play01:36

very simple language to learn I think

play01:38

it's very performant like I mentioned

play01:39

before but at the same time it's very

play01:43

verbose um I miss my string

play01:45

interpolations like I'm noticing I have

play01:46

to do a lot of format you know print F

play01:49

let's see where I'm doing that print

play01:51

FS okay I'm doing a lot of format print

play01:54

FS just to interpolate a string it's not

play01:57

that big of a deal but it's enough where

play01:59

I'm like dude it's just kind of annoying

play02:01

that I can't just say like user

play02:03

subscribed email okay this is more

play02:07

concise than this and when you write

play02:09

this enough throughout your application

play02:11

you start missing it in nextjs okay not

play02:14

a big deal it's not a deal breaker but

play02:16

again it's just the little things and

play02:17

the little things add up let's talk

play02:19

about the error handling and go I think

play02:21

the error handling and go is Light Years

play02:24

better than node when you are calling a

play02:27

node function you have no idea if it

play02:29

could even throw an exception and you

play02:32

need to make sure you are putting TR

play02:33

catches at least somewhere up higher in

play02:35

your application so you can handle when

play02:38

whatever arbitrary function you call

play02:39

throws an exception it's very like uh

play02:43

obscure you don't know what the function

play02:44

is going to do and go the errors are

play02:47

returned and so when you call a function

play02:49

usually you know just by looking at the

play02:51

function definition that hey this thing

play02:53

could potentially error out you probably

play02:55

want to handle it now granted this can

play02:58

be ignored like I don't actually have to

play03:00

handle the errors right so just like

play03:01

wrap this whole thing in a try catch

play03:03

bubble the air up to the user tell the

play03:06

user to try again that type of sloppy

play03:08

coding right so there is a lot of

play03:10

benefit to the error handling in go and

play03:12

I'm definitely going to give it the win

play03:13

there but I will say that it gets a

play03:15

little verbose at times and I'm like

play03:17

dude if I can't write to my

play03:20

database like I just want this thing to

play03:22

error out like right here I just want

play03:25

this thing to panic now granted there

play03:26

are some errors that you actually want

play03:28

to check and make sure that like hey

play03:30

if this was just like a connection reset

play03:32

error or a connection timed out error

play03:34

when trying to write to my database or

play03:36

trying to make a fetch request to a

play03:37

third party API then yeah maybe I could

play03:40

just wrap it and retry logic in my Go

play03:42

app and do something different based on

play03:44

the error but there's something nice

play03:45

about node.js and like I can just hack

play03:47

stuff together and like if it just

play03:49

throws an error whatever like the UI

play03:51

will show an alert saying try again and

play03:54

again this is from a Indie hacker

play03:55

standpoint this isn't I'm working at a

play03:57

Fortune 500 company I need to make sure

play03:59

every single error is handled this is

play04:01

more of the context of my mindset of

play04:04

what I want to achieve in my spare time

play04:07

after work handling all these errors is

play04:08

just something I just don't care about

play04:10

but again I'm going to give go the win

play04:11

on that because I do think it's a better

play04:12

way to handle errors I hear Russ is also

play04:14

really great at that too um stuff like

play04:17

this parsing an INT it's just so Bose

play04:21

now granted I am new to go and there

play04:23

might be better ways to do this but like

play04:25

the fact that I'm passing in an email

play04:27

and then I just need to convert it to a

play04:28

string and then this could potentially

play04:31

throw an error so now I need to say oh

play04:32

if it throws an error I need to panic

play04:34

granted I don't even know if fiber is

play04:36

going to return the correct status code

play04:39

when this thing errors so I don't think

play04:41

I'm doing this right either I should

play04:42

probably have like a higher order

play04:43

function that's wrapping all this to

play04:44

catch errors and maybe change the status

play04:47

code and return that U I think the

play04:49

proper way to do this would be like c.

play04:52

status of I don't know 500 or something

play04:55

I'm sorry it's fiber dot I don't know

play04:57

bad request so that's what I should be

play04:59

doing instead

play05:00

but I feel like it would just be nicer

play05:01

if instead maybe I could just like not

play05:03

catch these errors but I think if I do

play05:05

this then like this thing won't Panic

play05:08

like it'll just call this and this would

play05:11

probably throw an error at some point

play05:12

and then like I I don't know anyway let

play05:14

me move on from that because my lack of

play05:16

go is a shining through and you guys are

play05:18

going to call me out in the comments but

play05:19

I just don't care let's go to the temple

play05:22

syntax Temple there's something about

play05:24

Temple that I just don't like right when

play05:26

I'm making an

play05:28

endpoint often I wish I could just write

play05:31

a simple template right here like I just

play05:34

want to inline a little alert and send

play05:36

it back but what Temple you end up doing

play05:38

is you have to have these Temple

play05:40

files and the one thing that I hate the

play05:42

most about Temple especially in VSS code

play05:45

is when I command click on a template it

play05:48

takes me to my compiled generated go

play05:51

file which is completely pointless to

play05:53

load up and so then I end up going over

play05:56

here and I'm like okay well I open the

play05:57

wrong file let me click on this one

play06:00

and let me try to find the function I

play06:02

was originally trying to look for okay

play06:03

here it is and that disconnect in my

play06:06

editor is enough for me to say I do not

play06:08

want to use Temple okay it's small stuff

play06:11

like that where it's like I would rather

play06:13

just use

play06:14

jsx because it's just it just works

play06:16

better now again this is where I'm

play06:17

saying neoven may have solved this issue

play06:20

but it's just stuff like this and then

play06:21

you look over here and you're like you

play06:23

have a temple file and then you have a

play06:24

go file and there's also some text files

play06:27

in some of these that the temple file

play06:29

sometimes generate I don't know why

play06:30

there's no txt files now but they were a

play06:33

second ago so now you have like all

play06:35

these random files in your code base

play06:37

that kind of just

play06:39

pollute what you're trying to do it's

play06:41

like I don't care about these files and

play06:44

sometimes when I'm collapsing them they

play06:45

just automatically open back up again

play06:47

but overall I mean like if that wasn't

play06:49

an issue I think Temple's pretty good I

play06:51

mean like you have the type safety I can

play06:53

pass whatever types to this thing and

play06:56

it's going to error out if I'm passing

play06:57

the wrong types so some other complaints

play06:59

when I was using Temple I found that

play07:02

when I navigated between Pages sometimes

play07:04

the temple proxy which is something I'm

play07:06

using to basically force my browser to

play07:09

reload when I save a temple file or when

play07:12

I save a go file I'm using Temple

play07:14

generate watch with this proxy and that

play07:16

is basically treating like a live reload

play07:19

sometimes this whole thing would just

play07:20

block up my tab like my Chrome tab would

play07:22

freeze up I have to close it and then I

play07:24

have to open a new one I open an issue

play07:27

on the temple GitHub I believe that's

play07:29

been been fixed by the maintainer of

play07:31

Temple but it's just like enough of

play07:33

running into these little small issues

play07:35

where you're like okay there's another

play07:36

tick off the Box why I don't want to use

play07:38

this granted if someone else ran into

play07:40

that bug and this got fixed before I

play07:42

picked it up maybe I wouldn't be so

play07:44

frustrated with it but if you run into

play07:46

enough frustrations with trying out a

play07:48

stack you're like I just don't care

play07:51

about this stack anymore the great thing

play07:53

about nextjs and V and all these other

play07:55

things is that like typically they've

play07:57

done a very very good job just making

play08:00

the hot module reloading work perfectly

play08:02

fine um like with nextjs I save a file

play08:05

and typically I go back to my UI and

play08:07

it's automatically refreshed by the time

play08:09

I switch screens my page is already

play08:12

refreshed with my change granted I could

play08:14

just have a bad setup but again like

play08:15

that's another problem with using these

play08:17

type of stacks is that you end up like

play08:19

packing all these things together

play08:20

yourself trying to figure out your own

play08:22

solution to a problem that I'm sure

play08:24

every other developer who's doing the

play08:25

stack has solved already like I

play08:27

mentioned some good things about go I

play08:28

love how it compiles down to a binary

play08:30

and the binary is super small and I can

play08:32

deploy that super easily anywhere that's

play08:34

awesome I like that I do like the type

play08:37

safety and go um sometimes when I'm

play08:40

coding with go I feel like it's just

play08:43

missing something like it's just it's

play08:45

too rigid I don't know how to explain

play08:47

this it just feels sometimes very rigid

play08:49

and I'm coming from typescript where you

play08:51

can throw Ines on anything but again

play08:53

coming from the Indie hacker standpoint

play08:55

I just want to quickly prototype

play08:57

something and typescript definitely

play08:58

takes the win with that because if I'm

play09:00

not in the mood to type stuff or create

play09:04

a type or if I just want to throw on a

play09:06

union type somewhere I can do that in

play09:09

typescript very easily right you might

play09:10

argue well that's bad coding again I'm

play09:13

coming from an indie hacker mindset of I

play09:15

just want to move fast prototype

play09:16

something throw it away refactor it make

play09:18

it better later and that's just a

play09:20

trade-off between like a strongly type

play09:22

or strictly type language versus

play09:23

typescript which is I don't know what

play09:25

you call that it's just a monstrosity

play09:27

but it works right and it get that

play09:29

flexibility to like turn off typing when

play09:32

you truly just want to like I have this

play09:34

this idea and I need to implement it and

play09:36

I don't want the type system telling me

play09:38

no stop your whole thought process

play09:40

because you need to actually put a type

play09:42

on this parameter here it's like no I

play09:44

don't care I already know it's an app

play09:45

let me call a method on it you know

play09:47

anyway that is a complete side tangent

play09:49

so some good things is I am using fiber

play09:51

and I do feel like fiber was super fast

play09:54

and it feels like I'm writing expressjs

play09:56

or like any other type of you know micro

play09:59

backend framework where I can just do

play10:01

routes and middlewares and stuff like

play10:03

that so it I felt familiar in that

play10:05

aspect and uh it was pretty nice I won't

play10:07

complain about that now granted I didn't

play10:09

really prepare for this video I'm just

play10:10

kind of going off the top of my head the

play10:11

things that I like the things I didn't

play10:12

like and so there's no structure to this

play10:15

but one thing that started to annoy me a

play10:17

lot is how rigid the package system is

play10:20

in go and what I mean by that is that

play10:22

like it feels very rigid that the

play10:25

package you're in has to match the

play10:27

directory that you're in okay I tried to

play10:29

do like a file based route approach here

play10:32

where I'd have like a dashboard page a

play10:34

login page a log out page an unsubscribe

play10:37

page stuff like that and inside the

play10:39

dashboard page I'm like well I just want

play10:41

to go ahead and just put a couple of

play10:42

like

play10:43

components um inside a subfolder so I

play10:46

can easily find them when I'm just like

play10:48

navigating this but when you do that

play10:49

you're forced to basically make these be

play10:52

in a package that like matches the name

play10:55

of the folder and then you have to like

play10:57

remember well you have to make this

play10:59

public because although this is a

play11:01

dashboard only component you got to make

play11:04

it public so that I can actually import

play11:06

it from

play11:08

another page or route that lives on my

play11:10

dashboard and so I feel like the

play11:12

packaging system is very strict or rigid

play11:15

in the sense that like you have to

play11:17

basically either put everything in the

play11:18

same folder or you just basically do

play11:21

what I just did and like you have to

play11:22

like put make some stuff public and then

play11:24

you find yourself going through here and

play11:25

just like changing the capital case of

play11:27

all this stuff as you're moving stuff

play11:29

around it just feels like busy work

play11:31

versus I don't know it just feels a lot

play11:32

more flexible in typescript and node

play11:34

where like I can just import that thing

play11:37

like here's a function I just want to

play11:38

import it from this file that lives who

play11:40

knows where I don't care just give me

play11:42

that file that's all I want to invoke

play11:44

and then if I want it to be a private

play11:46

module or a private function I literally

play11:48

just don't export it so that everything

play11:50

in this file can have access to that so

play11:52

that's kind of something that I miss

play11:53

about no but again that's just more of a

play11:54

mindset shift I have to get used to how

play11:56

go works with packages and stuff and

play11:58

it's kind of like well you just have to

play11:59

do it that way that's just how it works

play12:01

overall when it comes to go my final

play12:04

opinions are if you came to me and said

play12:07

hey Cody we need you to build the most

play12:09

performant backend you can do how would

play12:12

you do it don't worry about the front

play12:14

end you never have to touch front end

play12:15

code again I would pick go honestly I

play12:18

would still pick go I think having this

play12:21

type of strict language where everything

play12:23

is typed and you have like these

play12:25

built-in constructs for doing channels

play12:27

it just has a better concurrency model

play12:29

than node.js in my opinion like in a in

play12:32

another video I just did the other day I

play12:33

kind of talked about node workers and

play12:36

node workers are just like a nightmare

play12:37

compared to like pushing to a channel

play12:40

right it's just so convenient and

play12:41

elegant and go of like I just need to do

play12:44

some work on a queue here just push into

play12:46

a channel that'll get picked up by some

play12:48

other process it's just nice so like I

play12:50

said if you came to me and said you are

play12:52

in charge of like building out a

play12:53

complete rest API or just backend

play12:56

microservices you don't ever have to

play12:57

worry about a front end and you're on a

play12:59

larger team I would say go is probably a

play13:01

really good choice but if you said hey

play13:03

Cody you're a oneman team I need you to

play13:06

work on three different projects and I

play13:08

need you to context switch between them

play13:11

possibly multiple times a day that's

play13:13

when I'm like okay I'm probably going to

play13:15

pick nextjs or some type of

play13:18

allinclusive uh framework that uses

play13:21

typescript on the front end in the

play13:23

backend granted I know people hate

play13:25

typescript they say that typescript

play13:26

should never run in the back end but in

play13:28

my op opinion there are a lot of

play13:30

benefits of not having the context

play13:32

switch between two ecosystems whether

play13:34

you agree with it or not but when your

play13:36

back in as written and go you then have

play13:38

a completely different mindset you have

play13:40

to think about a different package

play13:42

manager a different like make files it

play13:45

depends on how you're doing like your

play13:46

builds and your runs and then you have

play13:48

your front end that's using a completely

play13:50

other set of tools and ecosystem like I

play13:52

don't know es build or Turbo pack and

play13:55

nextjs and esm modules for me in my

play13:58

brain

play14:00

not having the context switch between

play14:01

two different languages and two

play14:03

completely different ecosystems is a

play14:04

huge win especially if you have to

play14:07

maintain multiple projects at the same

play14:10

time and you have to switch between them

play14:11

often throughout the day uh my goals on

play14:14

this channel and everything I do on my

play14:16

channel is just on the side I just do

play14:17

this with some extra free time after

play14:19

work I'm trying to do that whole Indie

play14:22

hacker thing where I build a project I

play14:23

try to launch it I try to get some users

play14:25

if it doesn't work I move over to

play14:27

another project sometimes I'll work on

play14:29

two or three different projects in a day

play14:30

and I'll just ship one feature for one

play14:32

product move on to the next ship another

play14:34

feature having a separated front end and

play14:36

backend is hard enough to get all set up

play14:39

and automated with cicd and then add on

play14:42

top of that your back ends in a

play14:43

completely different language and

play14:45

ecosystem that's not complexity that I'm

play14:47

willing to uh trade off all right let's

play14:50

move on to HTM X HTM X overall I mean

play14:53

from the get- go I'll say no I don't

play14:56

like HTM X I think the idea is pretty

play14:59

cool but I think the mental model with

play15:03

all these frontend Frameworks like view

play15:05

spell to react the model is you have a

play15:09

data model and when that data model

play15:11

updates your UI reflects that data model

play15:14

and I think that is a lot easier to

play15:16

reason about at least for in my brain

play15:19

then your backend is responsible for

play15:21

sending over the components when your

play15:23

front end does certain actions and the

play15:26

reason I find that very painful is that

play15:29

you have like

play15:30

IDs that are spread out through all your

play15:33

components and then when you click a

play15:35

button or submit a form your your

play15:37

backend has to like keep that in mind of

play15:39

like your controller needs to know okay

play15:40

now we need to send over a different

play15:42

template and then we have to basically

play15:44

Target different IDs in the front end to

play15:47

swap out like an alert or show uh you

play15:49

know I think somewhere over here I show

play15:51

like an error and then the backend has

play15:53

to basically keep those IDs in its head

play15:56

again like there's no type safety with

play15:57

any of this stuff so I have to like find

play16:00

certain IDs and then like use ataban

play16:03

swaps to throw an error alert somewhere

play16:05

on the page or swap out some content

play16:08

down here and I just find this very

play16:11

unmaintainable granted I've only been

play16:13

playing around with this for like 2

play16:14

weeks and so maybe I just haven't drank

play16:16

the Kool-Aid enough but coming from

play16:18

react and spelt and view I just don't

play16:21

think this is a long-term maintainable

play16:23

solution um especially if your UI starts

play16:26

getting more and more complex over time

play16:28

now granted I do think there's some

play16:30

really nice things in HTM X for example

play16:32

like the indicators are pretty cool like

play16:33

when I submit a button I can just

play16:35

basically say fine my indicator that

play16:38

lives in this button I have like a

play16:40

component here that basically loads up

play16:42

an indicator and then I have an htx

play16:44

indicator here which shows a spinner and

play16:47

I mean that's like one line right I just

play16:49

have to add one attribute to my dom to

play16:52

have the indicator automatically show

play16:55

but kind of looking at this code it's

play16:57

like some of the things I ran into is

play16:59

like when I'm trying to get the UI back

play17:02

into the same state that I need it to be

play17:04

in to debug sometimes you might have a

play17:07

page and it takes submitting a form and

play17:11

then the backend does something and then

play17:13

the form changes to a state then inside

play17:16

that new state there was a tab that you

play17:17

clicked so it takes like three actions

play17:20

to get back to the same state as it was

play17:23

and the only way to get to that state is

play17:25

by doing all these actions manually

play17:29

versus in View and spelt and react I

play17:31

mean you have like this this data model

play17:34

you go in here you flip some flags and

play17:36

now you're UI is in the exact state that

play17:38

you need it to be as you're doing

play17:39

development and debugging that is just

play17:41

much easier in my opinion um there's

play17:43

other stuff over here like this HX

play17:45

include I have a subject an HTML and a

play17:47

text these are just arbitrary inputs on

play17:50

this page that I want to include when

play17:52

someone clicks this button and it does a

play17:55

post request to this endpoint to me this

play17:58

just doesn't seem like a good approach

play18:00

right there's just arbitrary IDs on

play18:02

these inputs we're just saying include

play18:04

them when the form submits yeah I don't

play18:06

know I'm just not a fan like I I I tried

play18:08

to give HTM x a solid try I truly did um

play18:12

I tried to come in here with like a cool

play18:13

mindset of like oh this is awesome I can

play18:15

like have buttons do stuff and call end

play18:17

points and the end points return back

play18:18

some arbitrary stuff it just feels more

play18:21

difficult like it feels like there's

play18:22

more friction to build something simple

play18:24

compared to when I'm using like and so

play18:26

somewhere through this journey um I was

play18:28

like you know what maybe it's just go

play18:29

and Temple that's really distracting me

play18:32

from HTM X maybe HTM X is actually

play18:34

pretty cool and so what I did was I

play18:37

built an entire application using HTM X

play18:40

in hono okay so here's another

play18:43

application I said you know what let's

play18:45

just move away from go for a little bit

play18:47

and give htx another try using hono

play18:51

which is in JavaScript which is what I'm

play18:52

familiar with and then I end up writing

play18:55

some weird stuff like this where when I

play18:57

type into an input box I I want a

play18:59

counter to basically decrement as the

play19:01

user types into this text area and you

play19:03

end up writing some weird stuff like

play19:05

this granted if you're an htx expert or

play19:07

an Alpine expert there might be a super

play19:09

easy way to do this but just by using

play19:12

HTM X alone the fact that I'm like

play19:13

writing JavaScript code like

play19:15

this I would much rather there be some

play19:19

State called remaining characters or

play19:21

some deriv State and react where I can

play19:24

just get the input value do the length

play19:27

on it and just like subtracted by 10,000

play19:30

and then just render that out and I

play19:32

actually did that over here right I have

play19:34

a remaining characters over here and

play19:37

they kind of show you what I mean I'm

play19:38

actually rewriting this application back

play19:40

in nextjs because I just I cannot

play19:43

swallow HTM there's something about it I

play19:45

cannot just agree with it um maybe you

play19:48

love it but I just can't so again this

play19:51

is easier to reason about for me and so

play19:53

this is the code basically I just do

play19:55

10,000 minus what the current length is

play19:57

of my form value

play19:59

and then I display

play20:01

it it's like the little things like that

play20:04

which it's very nice to have view or

play20:06

react or spelt where you have like this

play20:08

data model and then all you need to do

play20:10

is just update that data model recompute

play20:12

it and then all of a sudden your UI is

play20:14

going to reflect that state

play20:16

automatically versus if you want to get

play20:18

that with HTM X you end up writing some

play20:20

vanilla javascripts maybe doing it

play20:22

inline wasn't the best approach but if

play20:23

you don't do it in line what you end up

play20:24

doing is you put it in some script tag

play20:27

down below and then that becomes even

play20:29

harder to maintain because now the

play20:30

script tag has to reference this text

play20:32

area using an ID and then you're like

play20:34

going back and forth between like random

play20:36

IDs and stuff and then keep in mind

play20:38

there's no type safety right so like I

play20:40

don't know what IDs are on the page that

play20:42

I can even reference or are being used

play20:44

and so now you just have a bunch of IDs

play20:45

that are like oh look at this I have an

play20:47

ID called remaining I better make sure I

play20:49

never remove this ID because then this

play20:50

functionality will break it's just

play20:52

easier to see with typescript that

play20:56

hey that thing is derived from this and

play20:59

this thing depends on this but overall I

play21:01

mean I think the idea of HTM X is pretty

play21:03

cool like the the swapping the ability

play21:05

to basically call an endo the endpoint

play21:07

returns from H you can swap it out on

play21:08

the page really really cool especially

play21:11

for a really basic

play21:13

application um but I feel like as your

play21:15

apps get a little bit more complex or

play21:17

you have multiple things that need to

play21:19

happen on a page it's just harder to

play21:22

maintain and again this is like another

play21:24

thing where I started using htx I legit

play21:26

ran into various bugs related to like

play21:28

indicators and buttons not not

play21:31

re-enabling when I switch pages and then

play21:34

I opened like pull requests to the htx

play21:36

library and the maintainer actually

play21:37

fixed those bugs so there's two bugs

play21:39

that I pointed out and I complained

play21:41

about on Twitter the maintainer fixed

play21:43

them but it just goes to show that's

play21:45

like bro I just picked this up within

play21:46

like a week and I've I'm hitting bugs in

play21:48

Temple I'm hitting bugs in HTM X and I'm

play21:52

curious are other people not building

play21:55

uis that are sophisticated because like

play21:57

if I'm hitting this day one

play21:59

because if I'm hitting issues with like

play22:00

loading indicators staying up or buttons

play22:02

not disabling either I'm using HT Max

play22:05

the completely wrong way or like people

play22:07

are not actually building sophisticated

play22:09

software with HTM X but again those are

play22:11

just more hurdles that I run into oh

play22:12

look here's another idea a random error

play22:15

ID I'm assuming that somewhere on the

play22:17

back end this is going to swapped out

play22:19

with an error so yeah I don't know I'm

play22:22

just not a fan of it but yeah I tried to

play22:24

give it two solid tries again I only do

play22:27

this part-time I only do this in my

play22:28

spare time if I had a whole month of

play22:30

playing around with htx maybe my

play22:32

opinions would change a little bit maybe

play22:34

I would not be so harsh on it but I just

play22:36

don't have that much time to like really

play22:38

investigate these tools um but at least

play22:40

I am investigating it I feel like a lot

play22:42

of people online were hyping up htx and

play22:45

no one actually uses it like no one

play22:47

actually built anything with it um I'm

play22:49

actually trying to build something with

play22:50

it and I'm realizing I don't want to

play22:52

build with it anymore all right I don't

play22:54

even know what else to talk about I mean

play22:55

I talked about go I talked about Temple

play22:57

and how I don't like it I talk about htx

play22:59

how I don't like that so at this point

play23:01

I'm okay just swallowing the fact that

play23:04

I'm just going to become a nextjs

play23:05

developer I'm just going to be a

play23:07

JavaScript Dev you back and devs can

play23:09

make fun of me for just wanting to be a

play23:10

JavaScript Dev but I have been coding a

play23:13

JavaScript for almost 10 years now in

play23:15

typescript and at this point I am so

play23:17

used to coding in typescript and having

play23:19

like in toin type safety and having like

play23:23

the flexibility to move fast like any

play23:25

package you'd ever need like you're

play23:27

going to find it and react and you can

play23:29

probably implement it in like 30 minutes

play23:30

to an hour like no joke for everything

play23:33

in Project planner AI which is another

play23:35

application that I worked on using next

play23:37

Chas and comvex everything you see in

play23:39

this

play23:40

application literally like oh we need to

play23:44

have some con Bon board we just went and

play23:46

found some arbitrary

play23:48

package brought it in and now we have

play23:51

combon functionality like it took us

play23:53

like 30 minutes to an hour to get a

play23:55

basic conon board set up and then we

play23:58

just spend a little bit more time adding

play23:59

like drag drop functionality and

play24:01

honestly I just don't think it's

play24:03

possible to achieve this level of

play24:05

productivity using go or HTM X like

play24:08

there's probably not libraries and

play24:09

packages already set up for you where

play24:11

you can just bring them in import a

play24:13

module throw in a random component

play24:16

somewhere and then you have like drag

play24:17

and drop functionality out of the box

play24:19

again like I said like when you have

play24:20

more sophisticated uis like we have a

play24:23

bunch of cards these cards can be

play24:25

searched over these cards can be

play24:26

filtered over these cards can have

play24:27

multiple different filters on at the

play24:29

same time I can turn on and off manual

play24:31

ordering of these cards when you have

play24:35

state and then you have actions that

play24:38

drive the view from that state it's such

play24:41

an easier mental model to like Implement

play24:44

nice sophisticated uis oh we can even

play24:46

swap between tables and cards just by

play24:48

clicking a button I'm not saying that

play24:50

you can't implement this with go and HTM

play24:52

X and Temple I'm just saying I have not

play24:54

found a stack out there that gives me

play24:56

the same level of productivity as nextjs

play24:58

does and react does and this whole

play25:01

ecosystem that I've been using on my

play25:02

channel for a while I've tried using

play25:04

laravel earlier this year uh there's a

play25:06

whole like Fiasco about laravel I made

play25:08

fun of it and I decided to try it out

play25:10

and then I end up just missing

play25:12

typescript I ended up missing my auto

play25:13

completion of my editor my in type

play25:15

safety I felt like the intellisense was

play25:17

not good again the recommendations were

play25:19

well you should stop using VSS code and

play25:21

switch over to something else it's like

play25:23

I don't want to have to learn a new

play25:24

editor just to use your stack like

play25:26

laravel is pretty cool I would say larel

play25:28

has a a bunch of bakedin functionality

play25:30

which can be very appealing to a lot of

play25:32

people but I don't know I just like the

play25:35

flexibility of like I want to install

play25:37

some random orm package and not have to

play25:38

use what laravel prescribes me and when

play25:40

I say I tried laravel like I legit

play25:43

cloned or I forked kify I made a PO

play25:45

request I tried to fix some

play25:47

functionality with the registration page

play25:49

I made this PO request and I got merged

play25:51

and I'm actually excited about that um

play25:53

Andre who shout out to him for doing

play25:54

coolify like this is a really cool

play25:56

product he says he's not even aware of

play25:58

the old function I used so it's like I

play26:00

picked up larel in a day or two and I'm

play26:02

using stuff that the person who's

play26:03

maintaining this project doesn't even

play26:05

know about and I'm not saying that to

play26:06

like bash Andre I'm saying that to say

play26:08

that I'm not just like saying oh I tried

play26:11

larabel like I legit read through the

play26:13

documentation I learned some some stuff

play26:16

I applied it to the UI that I was trying

play26:19

to fix um and overall I mean it's just

play26:22

like it works I just it's not for me

play26:24

another project I tried forking and

play26:26

playing around with was Tech romany's

play26:28

dble zero this is a emailer that I kind

play26:30

of talked about in my project before

play26:31

he's using Elixir I read through this I

play26:34

tried to play around with it the Elixir

play26:36

syntax is just very interesting like I

play26:38

just something about it I just don't

play26:39

like I guess what I'm getting at is over

play26:41

the past like month or so I've been

play26:43

trying to push into different directions

play26:46

of like let's try a little bit of

play26:47

laravel let's try a little bit of Elixir

play26:49

let's try a little bit of go let's try a

play26:51

little bit of HTM x uh in Temple and

play26:53

stuff like that and at the end of the

play26:55

day it's like I'm kind of done trying bu

play26:58

new stuff like I've just come to pallet

play27:01

the fact that I'm just an xjs JavaScript

play27:04

developer and I'm able to ship stuff

play27:06

very fast with it and I'm okay with that

play27:09

and that's what I'm going to stick with

play27:10

and I'm going to stop wasting your time

play27:12

switching between various stacks and I'm

play27:14

going to go back to what I know and what

play27:16

I enjoy and what I actually love coding

play27:18

with and that is typescript and

play27:20

JavaScript so sorry for wasting your

play27:22

time and hyping you up on go if you guys

play27:24

got excited but I'm going to switch back

play27:27

to my normal SCH content maybe I'll do

play27:29

some Go stuff once in a while like this

play27:31

isn't the first Adventure Time I've done

play27:33

with go if you scroll back I was doing

play27:35

like a distributed key value store with

play27:36

go a long time ago and played around

play27:38

with that for about 2 weeks and I

play27:40

learned a little bit about kubernetes

play27:41

and stuff so uh so yeah um I don't know

play27:44

what I'm even saying at this point hope

play27:45

you guys enjoyed watching have a good

play27:46

day happy coding and uh yeah let's just

play27:49

get back to nextjs and actually shipping

play27:50

stuff

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
Next.jsGoHTMXDeveloper ExperiencePerformanceTypeScriptJavaScriptWeb DevelopmentEcosystem ComparisonProductivity
¿Necesitas un resumen en inglés?