2 ms·
> ... are done with plain JS, with as few libraries as possible ... I was having the same opinion and practice. However, I'm kind regret it as well. Even if y
by nirui 5y ago
> ... are done with plain JS, with as few libraries as possible ...
I was having the same opinion and practice. However, I'm kind regret it as well.
Even if you done everything with plain JS, eventually, one day some idea will float into your head such as "Hey... I want to automatically compress the script file/snip", "Hey I wonder if I can polyfill all my script", "Automatically bundle assets?", "Compress assets images?" etc.
Then, you start to learn Webpack/Gulp/Grunt (if the last two are still alive), and commit your entire soul to it few minutes later.
I think the reason for the messy front-end tech is, the Web itself is messy. You have to consider a lots of things, networking, file management, cache management, cookie, user-side storage, security etc. Some eyes saw the problem and then built a framework to address it, then others discovered some other issues in the framework ... the circle of life.
I guess we'll eventually settle down on something when people finally figure out what they want from the Web technology, or when the Web is "dead" (no dramatic changes anymore, like what happened to Desktop Applications today).
- alanbernstein 5y agoI have lots of tiny hobby projects. I never want to do any of those things you mentioned. Just a simple page, with the minimum amount of javascript to make it work.
- majewsky 5y ago> Hey... I want to automatically compress the script file The trick is to write so little JS that its bandwidth usage does not even register. I'm recently going as far as to include licensing headers and extensive comments in my website JS, see e.g. <https://xyrillian.de/res/chapter-marks.js https://xyrillian.de/res/chapter-marks.js>.
- MereInterest 5y agoI can't find a link at the moment, but there was an article on Hacker News a few years ago defending the use of plain text web pages with minimal styling. The page loaded amazingly fast, rendered well on both desktop and mobile, and had fast interactions with the page. The author had also included the full text of Moby Dick, more content than is ever served in a typical webpage. It was a fun and cheeky demonstration that it isn't the content of a webpage that results in poor performance, but all the frameworks, ad targeting, and client-side compiling of a webpage. (Side rant: I refuse to use the term "client-side rendering", because dang it, "rendering" makes an image. "Client-side rendering" as web developers use the term doesn't actually render anything, but instead compiles the page down to HTML, which is then rendered by the browser.)
- MereInterest 5y agoI'd put that as a difference between hobby projects and work projects. For work projects, there is some amount of time that can be allocated to continual development. The project itself has value, and needs to stay up to date, and so sure, it may use the framework of the day. For a hobby project, if I personally don't have fun with it, then nothing gets done on it. If I decide after a few years that I want to pick a project up again in order to add a new feature, the last thing I want is to find out that framework X needs to be replaced with framework Y, and so the two weekends I had expected becomes two months of weekends to rewrite the whole thing.
- nirui 5y agoI must say it's a valid point. After all it's a hobby project, having fun is the first priority :D However, one could also say "Well, it's a hobby project, so I'll just slap this framework on to save my time..." or "What? I have to manually deploy this hobby thing every time I made a change? I'll just put it on a CI and let Webpack pack the thing for me"... My method is this: I will start the project with all new tech/frameworks/lib/"display: grid", then I publish the project, if it turns out to be a success, I'll maintain it (including upgrade the framework, bug fix etc); if it's not, I'll just put it aside and start another one. This way, I can touch/learn many new stuffs that might later benefit me in my day job without any risk. So, I believe it eventually boils down to personal preference (based on objective information on hand, of course) :D
- MereInterest 5y agoMakes sense. For me, I like to get hobby projects for my own personal use. The "publishing" involves pushing it to github, then doing absolutely nothing additional with it. But because I use it on my own, I may want to add more features to it later. For frameworks, I'm sure they save time once you are familiar with them, but that also requires evaluating which frameworks to use and how to go about using them. That ends up taking a lot more time than throwing something together with plain JS. That definitely makes sense, especially if you're using the hobby projects to learn about frameworks that you'll later use elsewhere. I tend to do the same thing on the compiled side, trying out different libraries and languages. (For example, picking up Rust for last December's Advent of Code challenges, then porting some of my other projects over to make some performance comparisons.) Part of this is also that my dayjob has very little interaction with JS. If/when I use JS in my dayjob, I'm usually picking something minimal so that it can be used/expanded on by others without framework-specific JS knowledge. My goal is to make sure that I leave behind a codebase that can be read/understood by as many people as possible, which may mean picking a software stack that has a bit worse usability, in exchange for ease of finding developers.