# reusable code

Reusable code is documented, portable, organized, version-controlled code intended for reuse as generalized software tools, libraries, or routines.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Making Twig Macros Work Like Functions

DevFeed: [Making Twig Macros Work Like Functions](<https://devfeed.tech/articles/making-twig-macros-work-like-functions-31280.md>)

Original publisher: [Read original article](<https://nystudio107.com/blog/making-twig-macros-work-like-functions>)

Author: andrew@nystudio107.com (Andrew Welch)

Published: 2023-07-14T18:38:00Z

Content type: tutorial

Language: en

Sources: [nystudio107 | Articles on modern web development.](<https://devfeed.tech/sources/nystudio107-articles-on-modern-web-development.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Development](<https://devfeed.tech/topics/development.md>), [reusable code](<https://devfeed.tech/topics/reusable-code.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [functions](<https://devfeed.tech/tags/functions.md>), [insights](<https://devfeed.tech/tags/insights.md>), [just](<https://devfeed.tech/tags/just.md>), [languages](<https://devfeed.tech/tags/languages.md>), [learn](<https://devfeed.tech/tags/learn.md>), [like](<https://devfeed.tech/tags/like.md>), [macros](<https://devfeed.tech/tags/macros.md>), [make](<https://devfeed.tech/tags/make.md>), [manipulate](<https://devfeed.tech/tags/manipulate.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [return](<https://devfeed.tech/tags/return.md>), [returning](<https://devfeed.tech/tags/returning.md>), [reusable-code](<https://devfeed.tech/tags/reusable-code.md>), [twig](<https://devfeed.tech/tags/twig.md>), [value](<https://devfeed.tech/tags/value.md>), [values](<https://devfeed.tech/tags/values.md>)

### AI overview

A tutorial on making Twig macros return values that can be manipulated like function results. It demonstrates a sales-calculation macro, whitespace control, and returning a value for further computations such as sales tax.

### Source excerpt

Learn how to make Twig macros return values you can manipulate, just like functions in other programming languages

## Why Are There Functions?

DevFeed: [Why Are There Functions?](<https://devfeed.tech/articles/why-are-there-functions-32236.md>)

Original publisher: [Read original article](<https://bruceeckel.com/2022/09/29/why-are-there-functions/>)

Author: Bruce Eckel

Published: 2022-09-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [function](<https://devfeed.tech/topics/function.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [C](<https://devfeed.tech/topics/c.md>), [reusable code](<https://devfeed.tech/topics/reusable-code.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [c](<https://devfeed.tech/tags/c.md>), [code](<https://devfeed.tech/tags/code.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [reusable-code](<https://devfeed.tech/tags/reusable-code.md>)

### AI overview

The article examines why programmers write functions, drawing on the author's experience with assembly language for embedded systems. It argues that functions reduce repeated code, memory use, duplicate debugging effort, and reliability risks, while enabling reusable code; C automates much of the calling work required in assembly language.

### Source excerpt

Returning from giving my Polymorphism Unbound presentation at StrangeLoop (not yet available on YouTube, but all the examples and presentation slides are on Github), I found myself dissatisfied. Part of this was certainly my failure to cram a 2-hour presentation into 40 minutes (after cutting it down from a day-long, workshop-length size). The bigger issue was my inability to answer the essential question at the end of the presentation: why are we writing polymorphic functions?

## Learning From npm's Rough Few Months

DevFeed: [Learning From npm's Rough Few Months](<https://devfeed.tech/articles/learning-from-npm-s-rough-few-months-36865.md>)

Original publisher: [Read original article](<https://shostack.org/blog/learning-from-npms-rough-few-months/>)

Author: Adam

Published: 2017-08-15T00:00:00Z

Content type: opinion

Language: en

Sources: [Shostack & Friends Blog](<https://devfeed.tech/sources/shostack-friends-blog.md>)

Topics: [npm](<https://devfeed.tech/topics/npm.md>), [Package manager](<https://devfeed.tech/topics/package-manager.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Critical Infrastructure](<https://devfeed.tech/topics/critical-infrastructure.md>), [Security](<https://devfeed.tech/topics/security.md>), [reusable code](<https://devfeed.tech/topics/reusable-code.md>)

Tags: [critical-infrastructure](<https://devfeed.tech/tags/critical-infrastructure.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [npm](<https://devfeed.tech/tags/npm.md>), [reusable-code](<https://devfeed.tech/tags/reusable-code.md>), [security](<https://devfeed.tech/tags/security.md>)

### AI overview

This commentary examines npm's difficult recent period, what npm and other package managers could do, and what policy lessons may follow from treating package infrastructure as critical infrastructure.

### Source excerpt

[no description provided]

## MVVM-C A simple way to navigate

DevFeed: [MVVM-C A simple way to navigate](<https://devfeed.tech/articles/mvvm-c-a-simple-way-to-navigate-27947.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/2016-08-26-mvvmc/>)

Author: Susann Proszak Follow

Published: 2016-08-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [iOS development](<https://devfeed.tech/topics/ios-development.md>), [mvc](<https://devfeed.tech/topics/mvc.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [reusable code](<https://devfeed.tech/topics/reusable-code.md>)

Tags: [architectures](<https://devfeed.tech/tags/architectures.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [ios-development](<https://devfeed.tech/tags/ios-development.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mvc](<https://devfeed.tech/tags/mvc.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [reusable-code](<https://devfeed.tech/tags/reusable-code.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

An introduction to the MVVM-C design pattern for iOS development. The article explains how coordinators handle application navigation and flow while view models contain business logic, using a small demo app to illustrate the approach.

### Source excerpt

When thinking about design patterns and architectures in iOS development, MVC might be the first thing that comes to mind for most of you. But throughout the last years, MVC got a really bad reputation. Probably a lot of you heard about MVC as the massive view controller.