# literals

Published articles for literals.

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

## Basic values in Kotlin

DevFeed: [Basic values in Kotlin](<https://devfeed.tech/articles/basic-values-in-kotlin-39341.md>)

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

Published: 2023-02-27T00: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>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [format](<https://devfeed.tech/tags/format.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [literals](<https://devfeed.tech/tags/literals.md>), [number](<https://devfeed.tech/tags/number.md>), [operations](<https://devfeed.tech/tags/operations.md>), [precision](<https://devfeed.tech/tags/precision.md>), [readability](<https://devfeed.tech/tags/readability.md>), [types](<https://devfeed.tech/tags/types.md>), [values](<https://devfeed.tech/tags/values.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial introduces Kotlin's basic value types and literals, including numbers, booleans, characters, strings, and arrays. It explains Kotlin's object model, compiler optimization of some types, numeric ranges and precision, explicit type conversions, and underscore formatting in number literals.

### Source excerpt

Learn about the basic Kotlin values, types and operations.

## Maintainability and Expect Literals

DevFeed: [Maintainability and Expect Literals](<https://devfeed.tech/articles/maintainability-and-expect-literals-31920.md>)

Original publisher: [Read original article](<http://blog.jayfields.com/2016/06/maintainability-and-expect-literals.html>)

Author: Jay (noreply@blogger.com)

Published: 2016-06-16T11:21:00Z

Content type: opinion

Language: en

Sources: [Jay Fields](<https://devfeed.tech/sources/jay-fields.md>)

Topics: [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [test](<https://devfeed.tech/topics/test.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [formatting](<https://devfeed.tech/topics/formatting.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [code](<https://devfeed.tech/tags/code.md>), [formatting](<https://devfeed.tech/tags/formatting.md>), [function](<https://devfeed.tech/tags/function.md>), [literals](<https://devfeed.tech/tags/literals.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [readability](<https://devfeed.tech/tags/readability.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [wewut](<https://devfeed.tech/tags/wewut.md>), [xunit](<https://devfeed.tech/tags/xunit.md>)

### AI overview

The author argues that literal expected values in unit tests improve readability and keep failures focused, while helper functions can broaden the scope of maintenance and couple tests. For changing or inconsistent strings, the article suggests duplication with bulk edits or testing variable-dependent behavior separately from formatting.

### Source excerpt

Recently, Stephen Schaub asked the following on the wewut group: Several of the unit test examples in the book verify the construction of both HTML and plain text strings. Jay recommends using literal strings in the assertions. However, this strikes me as not a particularly maintainable approach. If the requirements regarding the formatting of these strings changes (a very likely scenario), every single test that verifies one of these strings using a literal must be updated. Combined with the advice that each test should check only one thing, this leads to a large number of extremely brittle tests. Am I missing something here? I can appreciate the reasons Jay recommends using literals in the tests. However, it seems that we pay a high maintainability price in exchange for the improved readability. I responded to Stephen; however, I've seen similar questions asked a few times. Below are my extended thoughts regarding literals as expected values. In general, given the option of having many similar strings (or any literal) vs a helper function, I would always prefer the literal. When a test is failing I only care about that single failing test. If I have to look at the helper function I no longer have the luxury of staying focused on the single test; now I need to consider what the helper function is giving me and what it's giving all other callers. Suddenly the scope of my work has shifted from one test to all of the tests coupled by this helper function. If this helper function wasn't written by me, this expansion in scope wasn't even my decision, it was forced upon me by the helper function creator. In the best case the helper function could return a single, constant string. The scope expansion becomes even worse when the helper function contains code branches. As for alternatives, my solution would depend on the problem. If the strings were fairly consistent, I would likely simply duplicate everything knowing that any formatting changes can likely be addressed usin

## Keyword arguments in C

DevFeed: [Keyword arguments in C](<https://devfeed.tech/articles/keyword-arguments-in-c-35428.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/keyword-arguments-in-c/>)

Author: Graham King

Published: 2013-01-15T05:03:49Z

Content type: article

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [structure](<https://devfeed.tech/topics/structure.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [introduced](<https://devfeed.tech/tags/introduced.md>), [literals](<https://devfeed.tech/tags/literals.md>), [macros](<https://devfeed.tech/tags/macros.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [null](<https://devfeed.tech/tags/null.md>), [optional](<https://devfeed.tech/tags/optional.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

The article explains how C99 features can be combined with macros and structures to implement optional keyword arguments in C. It discusses compound literals, designated initializers, and variadic macros, including default values and zero or null initialization for unspecified arguments.

### Source excerpt

C99 brings the magic: Keyword arguments in C!