# functions

A programming construct consisting of statements or a subroutine used to compute and return an output value.

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

## Suspending functions into blocking functions or CompletableFuture

DevFeed: [Suspending functions into blocking functions or CompletableFuture](<https://devfeed.tech/articles/suspending-functions-into-blocking-functions-or-completablefuture-39325.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-coroutines-to-blocking>)

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

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Java](<https://devfeed.tech/topics/java.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [blocking](<https://devfeed.tech/tags/blocking.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A guide to converting suspending functions into blocking functions or CompletableFuture in Kotlin Coroutines, with advice for APIs used by Java or non-coroutine Kotlin callers.

### Source excerpt

A guide on how to correctly convert suspending functions into blocking functions or CompletableFuture in Kotlin Coroutines.

## Flow from suspending functions and vice versa

DevFeed: [Flow from suspending functions and vice versa](<https://devfeed.tech/articles/flow-from-suspending-functions-and-vice-versa-39328.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-suspending-functions-flow>)

Published: 2025-08-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [coroutines](<https://devfeed.tech/tags/coroutines.md>), [functions](<https://devfeed.tech/tags/functions.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A guide to converting suspending functions to Flow and converting Flow back to suspending functions in Kotlin Coroutines.

### Source excerpt

A guide on how to convert suspending functions to Flow and vice versa in Kotlin Coroutines.

## How to turn callback functions into suspend functions or Flow

DevFeed: [How to turn callback functions into suspend functions or Flow](<https://devfeed.tech/articles/how-to-turn-callback-functions-into-suspend-functions-or-flow-39322.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-callbacks-to-coroutines>)

Published: 2025-07-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [callback](<https://devfeed.tech/topics/callback.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Continuation](<https://devfeed.tech/topics/continuation.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [continuation](<https://devfeed.tech/tags/continuation.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [functions](<https://devfeed.tech/tags/functions.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [suspend](<https://devfeed.tech/tags/suspend.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A guide to adapting callback-based APIs for Kotlin Coroutines. It explains how to convert callbacks that return one value into suspending functions and how to adapt callbacks that emit multiple values into Flows, including handling cancellation and exceptions.

### Source excerpt

A guide on how to correctly convert callback-based functions into suspending functions or Flows in Kotlin Coroutines.

## Kotlin/Wasm interop with Javascript - Gustavo Fão Valvassori

DevFeed: [Kotlin/Wasm interop with Javascript - Gustavo Fão Valvassori](<https://devfeed.tech/articles/kotlin-wasm-interop-with-javascript-gustavo-fao-valvassori-38285.md>)

Original publisher: [Read original article](<https://touchlab.co/kotlin-wasm-js-interop>)

Published: 2024-03-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [wasm](<https://devfeed.tech/topics/wasm.md>), [function](<https://devfeed.tech/topics/function.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [functions](<https://devfeed.tech/tags/functions.md>), [interop](<https://devfeed.tech/tags/interop.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-wasm](<https://devfeed.tech/tags/kotlin-wasm.md>), [wasm](<https://devfeed.tech/tags/wasm.md>), [web-assembly](<https://devfeed.tech/tags/web-assembly.md>)

### AI overview

This tutorial explains bidirectional interoperability between Kotlin/Wasm and JavaScript. It covers calling JavaScript from Kotlin/Wasm, exposing Kotlin/Wasm functions to JavaScript, export limitations, name collisions, and using JavaScript-defined types and browser APIs.

### Source excerpt

Kotlin/Wasm provides a bi-directional interoperability between Kotlin and Javascript, allowing you to call functions on either side. Let's dive into the topic and explore its limitations and workarounds.

## Effective Kotlin Item 20: Do not repeat common algorithms

DevFeed: [Effective Kotlin Item 20: Do not repeat common algorithms](<https://devfeed.tech/articles/effective-kotlin-item-20-do-not-repeat-common-algorithms-39294.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-utils>)

Published: 2024-01-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [functions](<https://devfeed.tech/tags/functions.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This Effective Kotlin article explains why developers should extract common, non-project-specific algorithms into named utility functions or libraries. It argues that reuse improves programming speed, readability, maintenance, and consistency, while reducing noise and repeated implementation. The article recommends learning and using standard-library functions where appropriate.

### Source excerpt

Why extracting utility functions is so important for our programs.

## The names of birds, part 4

DevFeed: [The names of birds, part 4](<https://devfeed.tech/articles/the-names-of-birds-part-4-38664.md>)

Original publisher: [Read original article](<https://ericlippert.com/2023/02/03/the-names-of-birds-part-4/>)

Author: ericlippert

Published: 2023-02-03T17:17:57Z

Content type: article

Language: en

Sources: [Eric Lippert](<https://devfeed.tech/sources/eric-lippert.md>)

Topics: [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>), [function](<https://devfeed.tech/topics/function.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [computer](<https://devfeed.tech/tags/computer.md>), [lambda-calculus](<https://devfeed.tech/tags/lambda-calculus.md>), [logic](<https://devfeed.tech/tags/logic.md>), [turing-machine](<https://devfeed.tech/tags/turing-machine.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

### AI overview

This article explains combinatory logic through the fictional identities of birds representing the S and K combinators. It shows how these combinators can produce the identity combinator and the duplication combinator, then connects combinatory logic with lambda calculus and computation.

### Source excerpt

The European starling is a lovely looking bird, though territorial, noisy and aggressive up close. Unfortunately, they are very invasive in North America. Most of the hundreds of millions of European starlings now living in the Americas can be found ... Continue reading ->

## Scope functions

DevFeed: [Scope functions](<https://devfeed.tech/articles/scope-functions-39306.md>)

Original publisher: [Read original article](<https://kt.academy/article/fk-scope-functions>)

Published: 2022-09-23T00:05:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Library](<https://devfeed.tech/topics/library.md>), [object](<https://devfeed.tech/topics/object.md>), [Streams](<https://devfeed.tech/topics/streams.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [also](<https://devfeed.tech/tags/also.md>), [apply](<https://devfeed.tech/tags/apply.md>), [backend](<https://devfeed.tech/tags/backend.md>), [functions](<https://devfeed.tech/tags/functions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [let](<https://devfeed.tech/tags/let.md>), [scope-functions](<https://devfeed.tech/tags/scope-functions.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [with](<https://devfeed.tech/tags/with.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A tutorial on Kotlin scope functions, including let, also, apply, and with. It explains how these standard-library extension functions transform or configure objects, presents application examples, and notes that scope-function-heavy code can make debugging harder.

### Source excerpt

What is let, also, apply and with, and how to use them in our applications.

## Function references

DevFeed: [Function references](<https://devfeed.tech/articles/function-references-39304.md>)

Original publisher: [Read original article](<https://kt.academy/article/fk-function-references>)

Published: 2022-07-29T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [function](<https://devfeed.tech/topics/function.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A Kotlin tutorial explaining how to reference existing functions instead of using lambda expressions. It covers top-level function references, reflection-related capabilities, function types, default arguments, and method references with receivers.

### Source excerpt

How do we reference functions in Kotlin, to replace lambda expressions. All functions, including constructors, getters, extensions and more.

## Coroutines under the hood

DevFeed: [Coroutines under the hood](<https://devfeed.tech/articles/coroutines-under-the-hood-39241.md>)

Original publisher: [Read original article](<https://kt.academy/article/cc-under-the-hood>)

Published: 2021-09-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [functions](<https://devfeed.tech/topics/functions.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [continuation](<https://devfeed.tech/tags/continuation.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [functions](<https://devfeed.tech/tags/functions.md>), [internals](<https://devfeed.tech/tags/internals.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [stack](<https://devfeed.tech/tags/stack.md>), [state](<https://devfeed.tech/tags/state.md>), [union-types](<https://devfeed.tech/tags/union-types.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A deep dive into Kotlin coroutine implementation details, explaining suspension as state machines and describing how continuations preserve local state and represent the call stack. It also introduces continuation-passing style and the altered result types used under the hood.

### Source excerpt

A deep dive into how suspension and continuations work under the hood.

## Effective Kotlin Item 32: Consider factory functions instead of secondary constructors

DevFeed: [Effective Kotlin Item 32: Consider factory functions instead of secondary constructors](<https://devfeed.tech/articles/effective-kotlin-item-32-consider-factory-functions-instead-of-secondary-constructors-39279.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-factory-functions>)

Published: 2021-07-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [functions](<https://devfeed.tech/topics/functions.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [object](<https://devfeed.tech/topics/object.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [constructor](<https://devfeed.tech/tags/constructor.md>), [functions](<https://devfeed.tech/tags/functions.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [object](<https://devfeed.tech/tags/object.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains why Kotlin factory functions are often preferable to secondary constructors for complex object creation. It covers clearer naming, avoiding constructor conflicts, returning subtype implementations behind interfaces, and allowing platform-specific or optimized implementations.

### Source excerpt

What factory functions are and why they are so important patterns for object creation.

## Alive2 Part 3: Things You Can and Can't Do with Undef in LLVM

DevFeed: [Alive2 Part 3: Things You Can and Can't Do with Undef in LLVM](<https://devfeed.tech/articles/alive2-part-3-things-you-can-and-can-t-do-with-undef-in-llvm-39743.md>)

Original publisher: [Read original article](<https://blog.regehr.org/archives/1837>)

Author: regehr

Published: 2020-07-31T20:33:05Z

Content type: tutorial

Language: en

Sources: [Embedded in Academia](<https://devfeed.tech/sources/embedded-in-academia.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [computer-science](<https://devfeed.tech/tags/computer-science.md>), [functions](<https://devfeed.tech/tags/functions.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [software-correctness](<https://devfeed.tech/tags/software-correctness.md>), [transformation](<https://devfeed.tech/tags/transformation.md>), [undef](<https://devfeed.tech/tags/undef.md>)

### AI overview

This article explains how LLVM handles undef and poison values and why they complicate compiler transformations. It uses equivalent C and C++ functions to show that LLVM can replace addition with a shift under refinement, but cannot generally reverse that transformation.

### Source excerpt

[Also see Part 1 and Part 2 in this series.] Let's talk about these functions: unsigned add(unsigned x) { return x + x; } unsigned shift(unsigned x) { return x << 1; } From the point of view of the C and C++ abstract machines, their behavior is equivalent: in a program you're writing, you [...]

## Dear Postgres

DevFeed: [Dear Postgres](<https://devfeed.tech/articles/dear-postgres-41201.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2017/10/12/Dear-Postgres/>)

Author: Map

Published: 2017-10-12T20:55:56Z

Content type: opinion

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Database](<https://devfeed.tech/topics/database.md>), [data](<https://devfeed.tech/topics/data.md>), [Geographic Information System](<https://devfeed.tech/topics/gis.md>), [JSON](<https://devfeed.tech/topics/json.md>), [functions](<https://devfeed.tech/topics/functions.md>), [XML](<https://devfeed.tech/topics/xml.md>)

Tags: [b-tree](<https://devfeed.tech/tags/b-tree.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [gis](<https://devfeed.tech/tags/gis.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [json](<https://devfeed.tech/tags/json.md>), [jsonb](<https://devfeed.tech/tags/jsonb.md>), [location-based](<https://devfeed.tech/tags/location-based.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [window-functions](<https://devfeed.tech/tags/window-functions.md>)

### AI overview

An appreciative commentary on Postgres describes how it has expanded beyond traditional relational database capabilities while retaining a focus on data durability, standards, and steady improvement. The article discusses indexes, GIS and PostGIS, analytical features such as window functions and CTEs, and JSON and JSONB support.

### Source excerpt

Dear Postgres, I've always felt an affinity for you in my 9 years of working with you. I know others have known you longer, but that doesn't mean they love you more. Years ago when others complained about your rigidness or that you weren't as accommodating as others I found solace in your steadfast values: Don't lose data Adhere to standards Move forward with a balancing act between new fads of the day while still continuously improving You've been there and seen it all. Years ago you were being disrupted by XML databases. As companies made heavy investment into what such a document database would do for their organization you proceeded to "simply" add a datatype that accomplished the same and brought your years of progress along with it. In the early years you had the standard format of index b-tree that most database engines leveraged. Then quietly but confidently you started adding more. Then came K-nearest neighbor, generalized inverted indexes (GIN), and generalized search-tree (GiST), only to be followed by space partitioned GiST and block range indexes (BRIN). Now the only question is which do I use? All the while there was this other camp using for something that felt cool but outside my world: GIS. GIS, geographical information systems, I thought was something only civil engineers used. Then GPS came along, then the iPhone and location based devices came along and suddenly I wanted to find out the nearest path to my Peets, or manage geographical region for my grocery delivery service. PostGIS had been there all along building up this powerful feature set, sadly to this day I still mostly marvel from the sideline at this whole other feature set I long to take advantage of... one day... one day. A little over 5 years ago I fell in love with your fastly improving analytical capabilities. No you weren't an MPP system yet, but here came window functions and CTEs, then I almost understood recursive CTEs (still working on that one). I can iterate over data in a recurs

## Why Short Methods Improve Code Readability and Testability

DevFeed: [Why Short Methods Improve Code Readability and Testability](<https://devfeed.tech/articles/short-methods-ftw-39031.md>)

Original publisher: [Read original article](<https://vladimirj.dev/short-methods-ftw/>)

Author: Vladimir Jovanović

Published: 2017-10-02T22:44:00Z

Content type: opinion

Language: en

Sources: [Vladimir Jovanović](<https://devfeed.tech/sources/vladimir-jovanovic.md>)

Topics: [functions](<https://devfeed.tech/topics/functions.md>), [Code](<https://devfeed.tech/topics/code.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [context](<https://devfeed.tech/topics/context.md>), [test](<https://devfeed.tech/topics/test.md>)

Tags: [clean-code](<https://devfeed.tech/tags/clean-code.md>), [code](<https://devfeed.tech/tags/code.md>), [context](<https://devfeed.tech/tags/context.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [functions](<https://devfeed.tech/tags/functions.md>), [programming](<https://devfeed.tech/tags/programming.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

The author argues that methods should generally be short--often around 10 lines, with 25 lines as an upper limit--because they are easier to read, understand, test, and maintain. The article also explains how developers' implicit context can make long methods seem clearer to their authors than to future maintainers.

### Source excerpt

My boss came to me and said: "Every method that you write should be less than 25 lines long" and I laughed, I laughed hard, right in his face. I was such a plonker!

## Working with time in Postgres

DevFeed: [Working with time in Postgres](<https://devfeed.tech/articles/working-with-time-in-postgres-41196.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2017/06/08/working-with-time-in-postgres/>)

Author: Map

Published: 2017-06-08T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Time Series](<https://devfeed.tech/topics/time-series.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>), [Data analysis](<https://devfeed.tech/topics/data-analysis.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [data](<https://devfeed.tech/tags/data.md>), [data-analysis](<https://devfeed.tech/tags/data-analysis.md>), [database](<https://devfeed.tech/tags/database.md>), [functions](<https://devfeed.tech/tags/functions.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [time-series](<https://devfeed.tech/tags/time-series.md>)

### AI overview

This tutorial explains how to work with time in Postgres, covering interval-based date arithmetic, built-in date functions such as date_trunc, weekly aggregation, and generating missing time ranges for reports.

### Source excerpt

A massive amount of reporting queries, whether really intensive data analysis, or just basic insights into your business involving looking at data over a certain time period. Postgres has really rich support for dealing with time out of the box, something that's often very underweighted when dealing with a database. Sure, if you have a time-series database it's implied, but even then how flexible and friendly is it from a query perspective? With Postgres there's a lot of key items available to you, let's dig in at the things that make your life easier when querying. Date math The most common thing I find myself doing is looking at users that have done something within some specific time window. If I'm executing this all from my app I can easily inject specific dates, but Postgres makes this really easy for you. Within Postgres you have a type called an interval that is some window of time. And fortunately Postgres takes care of the heavy lifting of how might something translate to or from hours/seconds/milliseconds/etc. Here's just a few examples of things you could do with interals: '1 day'::interval '5 days'::interval '1 week'::interval '30 days'::interval '1 month'::interval A note that if you're looking to remove something like a full month, you actually want to use 1 month instead of trying to calculate yourself. With a given interval you can easily shift some window of time, such as finding all users that have signed up for your service within the past week: SELECT * FROM users WHERE created_at >= now() - '1 week'::interval Date functions Date math makes it pretty easy for you to go and find some specific set of data that applies, but what do you do when you want a broader report around time? There's a few options here. One is to leverage the built-in Postgres functions that help you work with dates and times. date_trunc is one of the most used ones that will truncate a date down to some interval level. Here you can use the same general values as the above, bu

## Voltage, Temperature, and Harmonic Functions

DevFeed: [Voltage, Temperature, and Harmonic Functions](<https://devfeed.tech/articles/voltage-temperature-and-harmonic-functions-40405.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2016/09/26/voltage-temperature-and-harmonic-functions/>)

Published: 2016-09-26T09:00:52Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [math](<https://devfeed.tech/topics/math.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [functions](<https://devfeed.tech/tags/functions.md>), [math](<https://devfeed.tech/tags/math.md>)

### AI overview

A guest post introduces harmonic functions through familiar examples involving voltage, temperature, potential energy, fluid dynamics, random walks, and electrical circuits. It begins by relating harmonic motion to oscillations and then connects higher-dimensional harmonics to Laplace's equation.

### Source excerpt

This is a guest post by my friend and colleague Samantha Davies. Samantha is a math Ph.D student at the University of Washington, and a newly minted math blogger. Go check out her blog, With High Probability. If I said "let's talk about temperature and voltage", you might be interested, but few would react the same if instead I suggested an umbrella term: harmonic functions. Harmonic functions are often introduced as foreign operators that follow a finicky set of rules, when really they're extremely natural phenomena that everyone has seen before.

## Type Punning Functions in C

DevFeed: [Type Punning Functions in C](<https://devfeed.tech/articles/type-punning-functions-in-c-37904.md>)

Original publisher: [Read original article](<https://www.evanmiller.org/type-punning-functions-in-c.html>)

Author: Evan Miller

Published: 2016-08-10T15:20:00Z

Content type: article

Language: en

Sources: [Evan Miller](<https://devfeed.tech/sources/evan-miller.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [functions](<https://devfeed.tech/topics/functions.md>), [x86](<https://devfeed.tech/topics/x86.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [cpu](<https://devfeed.tech/topics/cpu.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [c](<https://devfeed.tech/tags/c.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [functions](<https://devfeed.tech/tags/functions.md>), [standard](<https://devfeed.tech/tags/standard.md>), [unix](<https://devfeed.tech/tags/unix.md>), [windows](<https://devfeed.tech/tags/windows.md>), [x86-64](<https://devfeed.tech/tags/x86-64.md>)

### AI overview

This article demonstrates how C function pointers can be used with incompatible argument orders, producing type-punning behavior that depends on x86 calling conventions rather than the C standard. It explains how register-based argument passing contributes to the observed results and warns that the technique is architecture-dependent and unsafe.

### Source excerpt

Making C more flexible, with the help of x86_64 calling conventions: Type Punning Functions in C

## Flag-oriented Programming

DevFeed: [Flag-oriented Programming](<https://devfeed.tech/articles/flag-oriented-programming-37716.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/flag-oriented-programming/>)

Author: Carlos Alexandro Becker

Published: 2016-02-10T00:00:00Z

Content type: opinion

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [clean-code](<https://devfeed.tech/topics/clean-code.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>)

Tags: [clean-code](<https://devfeed.tech/tags/clean-code.md>), [code](<https://devfeed.tech/tags/code.md>), [feature](<https://devfeed.tech/tags/feature.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

The article argues that adding boolean flags to methods leads to flag-oriented programming: code becomes harder to understand, maintain, maintain, extend, and test as features accumulate. It presents decorators as a more readable and composable alternative.

### Source excerpt

booleans, am I right? What a wonderful piece of technology! They help us solve so many problems...

## What is good code?

DevFeed: [What is good code?](<https://devfeed.tech/articles/what-is-good-code-37741.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/good-code/>)

Author: Carlos Alexandro Becker

Published: 2015-12-27T00:00:00Z

Content type: opinion

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [clean-code](<https://devfeed.tech/topics/clean-code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [functions](<https://devfeed.tech/topics/functions.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [classes](<https://devfeed.tech/topics/classes.md>), [object](<https://devfeed.tech/topics/object.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [clean-code](<https://devfeed.tech/tags/clean-code.md>), [code](<https://devfeed.tech/tags/code.md>), [functions](<https://devfeed.tech/tags/functions.md>), [object](<https://devfeed.tech/tags/object.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

A personal essay reevaluates common ideas about good code, including small methods and classes, meaningful names, unit tests, and refactoring. The author reflects on how experience and studying object-oriented programming changed their view of Clean Code guidance.

### Source excerpt

I've been wanting to write this for a long time, just to clarify my thoughts on the subject. Now, on vacations, I took a couple of days and finally did it. This is a personal opinion based on my personal experience and tons of books I have read, and I am not, by any means, the supreme holder of the truth, so you will probably disagree with me at some point.

## Updates to the tco and word\_wrap Gems

DevFeed: [Updates to the tco and word\_wrap Gems](<https://devfeed.tech/articles/small-gem-updates-40740.md>)

Original publisher: [Read original article](<https://radek.io/posts/small-gem-updates/>)

Published: 2014-05-05T00:00:00Z

Content type: release

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [file](<https://devfeed.tech/topics/file.md>), [functions](<https://devfeed.tech/topics/functions.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [changes](<https://devfeed.tech/tags/changes.md>), [github](<https://devfeed.tech/tags/github.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [release](<https://devfeed.tech/tags/release.md>), [updates](<https://devfeed.tech/tags/updates.md>)

### AI overview

A short release update covering fixes and improvements to the tco and word_wrap gems. tco 0.1.1 resolves an ANSI palette display bug and adds block-based reconfiguration, while word_wrap 0.2.1 adds in-place file editing and string-modifying functions.

### Source excerpt

A short summary of the recent changes made to the tco and word_wrap gems

## Examining Postgres 9.4 - A first look

DevFeed: [Examining Postgres 9.4 - A first look](<https://devfeed.tech/articles/examining-postgres-9-4-a-first-look-41160.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2014/02/02/Examining-PostgreSQL-9.4/>)

Author: Map

Published: 2014-02-02T20:55:56Z

Content type: article

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [aggregate-functions](<https://devfeed.tech/tags/aggregate-functions.md>), [cache](<https://devfeed.tech/tags/cache.md>), [failover](<https://devfeed.tech/tags/failover.md>), [pg-stat-statements](<https://devfeed.tech/tags/pg-stat-statements.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>)

### AI overview

A first look at PostgreSQL 9.4 while it is still in its final commit fest. The article discusses pg_prewarm for loading data into memory, concurrent materialized-view refreshes, and ordered-set aggregates, while noting that additional features may still change before release.

### Source excerpt

PostgreSQL is currently entering its final commit fest. While its still going, which means there could still be more great features to come, we can start to take a look at what you can expect from it now. This release seems to bring a lot of minor increments versus some bigger highlights of previous ones. At the same time there's still a lot on the bubble that may or may not make it which could entirely change the shape of this one. For a peek back of some of the past ones: Highlights of 9.2 pg_stat_statements Index only scans JSON Support Range types Huge performance improvements Highlights of 9.3 Postgres foreign data wrapper Materialized views Checksums On to 9.4 With 9.4 instead of a simply list lets dive into a little deeper to the more noticable one. pg_prewarm I'll lead with one that those who need it should see huge gains (read larger apps that have a read replica they eventually may fail over to). Pg_prewarm will pre-warm your cache by loading data into memory. You may be interested in running pg_prewarm before bringing up a new Postgres DB or on a replica to keep it fresh. Why it matters - If you have a read replica it won't have the same cache as the leader. This can work great as you can send queries to it and it'll optimize its own cache. However, if you're using it as a failover when you do have to failover you'll be running in a degraded mode while your cache warms up. Running pg_pregwarm against it on a periodic basis will make the experience when you do failover a much better one. Refresh materialized view concurrently Materialized views just came into Postgres in 9.3. The problem with them is they were largely unusable. This was because they 1. Didn't auto-refresh and 2. When you did refresh them it would lock the table while it ran the refresh making it unreadable during that time. Materialized views are often most helpful on large reporting tables that can take some time to generate. Often such a query can take 10-30 minutes or even more to run.

## The Universal Properties of Map, Fold, and Filter

DevFeed: [The Universal Properties of Map, Fold, and Filter](<https://devfeed.tech/articles/the-universal-properties-of-map-fold-and-filter-40331.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2013/09/30/the-universal-properties-of-map-fold-and-filter/>)

Published: 2013-09-30T09:00:53Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Category Theory](<https://devfeed.tech/topics/category-theory.md>), [functions](<https://devfeed.tech/topics/functions.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [categories](<https://devfeed.tech/tags/categories.md>), [category-theory](<https://devfeed.tech/tags/category-theory.md>), [foldr](<https://devfeed.tech/tags/foldr.md>), [free-object](<https://devfeed.tech/tags/free-object.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [functions](<https://devfeed.tech/tags/functions.md>), [list](<https://devfeed.tech/tags/list.md>), [monoids](<https://devfeed.tech/tags/monoids.md>), [programming](<https://devfeed.tech/tags/programming.md>), [standard-ml](<https://devfeed.tech/tags/standard-ml.md>), [universal-properties](<https://devfeed.tech/tags/universal-properties.md>)

### AI overview

This article gives category-theoretic characterizations of the functional programming functions map, fold, and filter. It argues that fold has the strongest universal characterization among the three and introduces a generalization related to transformations of standard compound data types.

### Source excerpt

A lot of people who like functional programming often give the reason that the functional style is simply more elegant than the imperative style. When compelled or inspired to explain (as I did in my old post, How I Learned to Love Functional Programming), they often point to the three "higher-order" functions map, fold, and filter, as providing a unifying framework for writing and reasoning about programs. But how unifying are they, really?

## Computed Property Macros

DevFeed: [Computed Property Macros](<https://devfeed.tech/articles/computed-property-macros-40621.md>)

Original publisher: [Read original article](<https://eviltrout.com/blog/2013-07-07-computed-property-macros/>)

Published: 2013-07-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Robin Ward](<https://devfeed.tech/sources/robin-ward.md>)

Topics: [Ember](<https://devfeed.tech/topics/ember.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Handlebars](<https://devfeed.tech/topics/handlebars.md>), [conditionals](<https://devfeed.tech/topics/conditionals.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [caching](<https://devfeed.tech/tags/caching.md>), [conditionals](<https://devfeed.tech/tags/conditionals.md>), [ember](<https://devfeed.tech/tags/ember.md>), [functions](<https://devfeed.tech/tags/functions.md>), [templates](<https://devfeed.tech/tags/templates.md>)

### AI overview

This tutorial explains how Ember computed property macros can simplify computed properties in applications using Handlebars templates. It describes their use as shorter, clearer alternatives for common computed-property patterns and notes that they can reduce repeated property names while supporting cached intermediate results.

### Source excerpt

Computed Properties By design, Handlebars templates don't allow complex expressions. You are given an {{#if}} block helper, but it can only evaluate whether something is "truthy" (aka true, a non-empty string or array or other value that is not undefined or null.) For example, you can't do something like this: {{#if (eyes.length == 1) && (horns.length == 1) && flies && (color == 'purple') && eatsDudes}} <i>It was a one-eyed, one-horned, flying purple people eater!</i> {{/if}} Handlebars encourages you to use a single evaluation for your logic:

## Methods of Proof -- Contrapositive

DevFeed: [Methods of Proof -- Contrapositive](<https://devfeed.tech/articles/methods-of-proof-contrapositive-40304.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2013/02/22/methods-of-proof-contrapositive/>)

Published: 2013-02-22T20:43:25Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [function](<https://devfeed.tech/topics/function.md>), [functions](<https://devfeed.tech/topics/functions.md>), [object](<https://devfeed.tech/topics/object.md>)

Tags: [contrapositive](<https://devfeed.tech/tags/contrapositive.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [injective-functions](<https://devfeed.tech/tags/injective-functions.md>), [methods-of-proof](<https://devfeed.tech/tags/methods-of-proof.md>), [object](<https://devfeed.tech/tags/object.md>), [pigeonhole-principle](<https://devfeed.tech/tags/pigeonhole-principle.md>), [truth-tables](<https://devfeed.tech/tags/truth-tables.md>)

### AI overview

This post introduces the contrapositive as one of four basic proof methods and begins developing the mathematical definition of functions on sets. It explains functions as sets of ordered pairs, with each input associated with exactly one output.

### Source excerpt

In this post we'll cover the second of the "basic four" methods of proof: the contrapositive implication. We will build off our material from last time and start by defining functions on sets. Functions as Sets So far we have become comfortable with the definition of a set, but the most common way to use sets is to construct functions between them. As programmers we readily understand the nature of a function, but how can we define one mathematically?