# Why Svelte Favors Writing Less Code

DevFeed: [Why Svelte Favors Writing Less Code](<https://devfeed.tech/articles/write-less-code-3129.md>)

Original publisher: [Read original article](<https://svelte.dev/blog/write-less-code>)

Author: Rich Harris

Published: 2019-04-20T00:00:00Z

Content type: opinion

Language: en

Sources: [Svelte blog](<https://devfeed.tech/sources/svelte-blog.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Svelte](<https://devfeed.tech/topics/svelte.md>), [React](<https://devfeed.tech/topics/react.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Vue.js](<https://devfeed.tech/topics/vue.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [react](<https://devfeed.tech/tags/react.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [svelte](<https://devfeed.tech/tags/svelte.md>), [vue](<https://devfeed.tech/tags/vue.md>)

## AI overview

The article argues that writing less code can reduce development time, bug risk, and cognitive overhead when readability is preserved. It presents Svelte's concise component syntax and compares example component sizes with React and Vue.

## Source excerpt

All code is buggy. It stands to reason, therefore, that the more code you have to write the buggier your apps will be. Writing more code also takes more time, leaving less time for other things like optimisation, nice-to-have features, or being outdoors instead of hunched over a laptop. In fact it's widely acknowledged that project development time and bug count grow quadratically, not linearly, with the size of a codebase. That tracks with our intuitions: a ten-line pull request will get a level of scrutiny rarely applied to a 100-line one. And once a given module becomes too big to fit on a single screen, the cognitive effort required to understand it increases significantly. We compensate by refactoring and adding comments -- activities that almost always result in more code. It's a vicious cycle. Yet while we obsess -- rightly! -- over performance numbers, bundle size and anything else we can measure, we rarely pay attention to the amount of code we're writing. Readability is important I'm certainly not claiming that we should use clever tricks to scrunch our code into the most compact form possible at the expense of readability. Nor am I claiming that reducing lines of code is necessarily a worthwhile goal, since it encourages turning readable code like this... for (let let i: numberi = 0; let i: numberi <= 100; let i: numberi += 1) { if (let i: numberi % 2 === 0) { var console: Console The console module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers. The module exports two specific components: A Console class with methods such as console.log(), console.error() and console.warn() that can be used to write to any Node.js stream. A global console instance configured to write to process.stdout and process.stderr. The global console can be used without importing the node:console module. Warning: The global console object's methods are neither consistently synchronous like the browser APIs they resemble