# doggerel

Published articles for doggerel.

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

## Using Fleet 1.19's AI Assistant to Convert Kotlin Between Imperative and Functional Styles

DevFeed: [Using Fleet 1.19's AI Assistant to Convert Kotlin Between Imperative and Functional Styles](<https://devfeed.tech/articles/the-imitation-tortoise-s-song-a-fleety-conversion-from-imperative-to-functional-will-you-join-the-dance-32082.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/the-imitation-tortoises-song-a-fleety-conversion-from-imperative-to-functional-will-you-join-the-dance/>)

Published: 2023-06-10T13:12:44Z

Content type: article

Language: en

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

Topics: [coding style](<https://devfeed.tech/topics/coding-style.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [coding](<https://devfeed.tech/topics/coding.md>), [Code](<https://devfeed.tech/topics/code.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-assistant](<https://devfeed.tech/tags/ai-assistant.md>), [code](<https://devfeed.tech/tags/code.md>), [coding-style](<https://devfeed.tech/tags/coding-style.md>), [doggerel](<https://devfeed.tech/tags/doggerel.md>), [fleet](<https://devfeed.tech/tags/fleet.md>), [functional](<https://devfeed.tech/tags/functional.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [imperative](<https://devfeed.tech/tags/imperative.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [word-games](<https://devfeed.tech/tags/word-games.md>)

### AI overview

The article experiments with Fleet 1.19's integrated AI assistant by converting Kotlin code for the Advent of Code 2022 Day 10 puzzle between imperative and functional styles, comparing the results, and generating poetry.

### Source excerpt

Once upon a time I admit. I have a penchant for word games and weird segues. So I will tell you what this post is about off the bat. You can skip to the code, I won't be offended. Fleet 1.19 was released this week with an integrated AI assistant. I took it for a spin and used it to convert Kotlin code from imperative style to functional and back again. I used some Kotlin code, which solves the Advent of Code 2022 Day 10 puzzle. I had written the solution in two styles and I had the AI assistant do the same conversion and compared the code. And then I played around and generated some poetry. Follow links at your peril, there are rabbit holes, it might make you late or change the size of your free time. Segue the first of many Oh you are still here! You didn't jump to the code starts here section? Why am I doing this? A long time ago, I read a lot of Lewis Caroll, Alice in Wonderland. In one scene Alice talks to the Mock Turtle. He sings a song about sea creatures dancing. When the first language translators appeared on the scene, Altavisa babelfish or perhaps it was the early Google Translate, I converted passages from Alice in Wonderland to French and then back again to see what the machines could do. The Mock Turtle was transformed into an Imitation Tortoise. In this way the reference to the original mock turtle soup was lost in translation. In a roundabout way I was wondering what would be uncovered or lost if I used the AI assistant for some translations in coding style. Couplets of doggerel My trusty and non emotional assistant had no opinion on Lewis Caroll but it made this for me. A definition of functional programming style in rhyming couplets: Functional programming's way, treats functions as the play. Immutable states they use, side effects they refuse. Declarative code is their choice, with functions, they rejoice. Nested functions map, filter, reduce, a clean, elegant code they produce. Compare this with the imperative version: Imperative code, step by st