25 Matching Annotations
- Last 7 days
-
svelte.dev svelte.dev
-
It must be called during the component's initialisation (but doesn't need to live inside the component; it can be called from an external module).
-
- Dec 2020
-
github.com github.com
-
Jbuilder gives you a simple DSL for declaring JSON structures that beats manipulating giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops.
-
-
github.com github.com
-
Got a bit sidetracked into refactoring the Element visitor code, so haven't actually started on the event handler stuff per se, but that'll come soon. Element stuff is starting to feel a bit more logical and easier to follow.
-
- Nov 2020
-
codescene.com codescene.com
-
Refactoring at scale is challenging and a significant investment, so communicating the progress is important both from a business perspective but also as a motivational effect to developers. In this case we used a combination of complexity trend visualizations and Code Health Metric as shown in the preceding example.
[[refactoring at scale]]
-
-
dzone.com dzone.com
Tags
Annotators
URL
-
-
github.com github.com
-
I refactored quite a bit of tarball-fetcher now to use actual Promises and asyncawait instead of passing resolve / reject callbacks around. This makes the code quite a bit easier to follow in my opinion, but let me know if anything should be changed there.
-
I know this is existing code but we can probably use this as an opportunity to "fix" it: it is discouraged to use the async exists method to check for a file and try operating on it.
-
- Oct 2020
-
medium.com medium.com
-
We don’t need to apply refactorings we don’t want.
-
Here are few, real-life commits of refactorings that make use of this solution:
-
This does solve the problem, but now our project and API is structured differently. In large projects it might be very hard to determine how to pull this trick off, or even impossible!
-
-
-
hyperscript is much simpler to refactor and DRY up your code than with JSX, because, being vanilla javascript, its easier to work with variable assignment, loops and conditionals.
Tags
- reuse existing language constructs
- comparison with:
- it's just _
- template language vs. reusing existing language constructs
- JSX
- javascript
- template language: bad: by not reusing existing language constructs; forced to reinvent equivalents which are inferior and unfamiliar
- making it easy for later refactoring
- hyperscript
Annotators
URL
-
-
recoiljs.org recoiljs.org
-
Derived data can move between being synchronous and asynchronous without modifying the components that use it.
-
State can be replaced with derived data without modifying the components that use it.
-
-
-
Templates are prone to unnoticed runtime errors, are hard to test, and are not easy to restructure or decompose.
-
- Sep 2020
-
blog.carbonfive.com blog.carbonfive.com
-
This is pretty good, but I don’t love that $contactStore.length bit. If we wanted to change the shape of the store from an array to a key-value store or something, we’d have to remember to update this component too. Instead, we can define a new derived store: contactCountStore. It’ll always track the count, which lets this component have less knowledge about the structure of the store. That refactor looks like this:
-
-
github.com github.com
-
When a component reaches such a size that this becomes a problem, the obvious course of action is to refactor it into multiple components. But the refactoring is complex for the same reason: extracting the styles that relate to a particular piece of markup is an error-prone manual process, where the relevant styles may be interleaved with irrelevant ones.
-
-
github.com github.com
-
(At the point at which it does make sense to turn this into a separate Tooltip.svelte component, the extraction is a completely mechanical process that could even be automated by tooling.)
-
-
refactoring.guru refactoring.guru
-
Primitives are often used to “simulate” types. So instead of a separate data type, you have a set of numbers or strings that form the list of allowable values for some entity. Easy-to-understand names are then given to these specific numbers and strings via constants, which is why they’re spread wide and far.
Tags
Annotators
URL
-
- Jul 2020
-
rails.lighthouseapp.com rails.lighthouseapp.com
-
It would be nice if the tests weren't so implementation specific, but rather tested the essence of the functionality. I tried to make them less brittle but failed. To that end, re-writing all the tests in rspec would be (IMHO) a brilliant improvement and pave the way for better tests in the future and more flexibility in implementation.
-
- Jun 2020
-
en.wikipedia.org en.wikipedia.org
-
Prefactoring is the application of experience to the creation of new software systems. Its relationship to its namesake refactoring is that lessons learned from refactoring are part of that experience.
-
-
en.wikipedia.org en.wikipedia.org
-
Refactoring is intended to improve the design, structure, and/or implementation of the software (its non-functional attributes), while preserving its functionality.
First sighting: "non-functional attributes".
-
- May 2020
-
en.wikipedia.org en.wikipedia.org
-
However, since problems are only addressed when they arise, maintenance is reactive rather than proactive. Small problems left unaddressed can balloon into major failures due to focus on cost.
-
- Apr 2020
-
en.wikipedia.org en.wikipedia.org
-
Potential for political focus on building new features over technical improvements (such as refactoring)
-
-
code.visualstudio.com code.visualstudio.com
-
If you'd just like to see refactorings without Quick Fixes, you can use the Refactor command (Ctrl+Shift+R).
To easily see all the refactoring options, use the "Refactor" command
-
- Apr 2019
-
perfectial.com perfectial.com
-
What is code refactoring?Code refactoring means restructuring your existing code, in a way that improves the internal structure but doesn’t change its external behavior. This complex procedure is aimed at modernizing software. It is typically used to increase the system’s maintainability, enhance performance, scalability, security and so on. If performed well, it can help developers discover some hidden bugs or vulnerabilities in the system.Typically, refactoring is done in small steps, called micro-refactorings. Each of these steps is usually a tiny change to a source code that leaves the functionality of the system unchanged, it just makes the code cleaner and simpler. And if you do want to change some functionality of your code, it’s much easier to do with a clean, refactored code.
-