Ask HN: Do you mostly program in a non-FP or non-OO style? Why?
Even in OO languages, I&#x27;m almost exclusively in an FP style because that style focuses on minimizing redundant code (e.g., don&#x27;t write loops write loop transformer functions), minimizing redundant top level functions (segmentations, hand-tuned stateful getter&#x2F;setters, etc), and maximizing the opportunity for correctness.<p>The last part is pretty important because properly testing software that talks to an external service is essentially impossible. Either you test in an integration setting where repeatable results are difficult to maintain, or you mock out your services and then you&#x27;re testing your opinions against other opinions.<p>Here&#x27;s an example of how I push this style to typescript, heavily redacted to remove company-specific marks, names and strutures: (this code is simple by intention; we may have a jr dev on the team soon and an excessive number of generator abstractions could help with this process but would cause readability issues).<p><pre><code>    function splitOrders(orders: e.OrderResult[]): {[key:string]: e.OrderResult[]} {
        return orders.reduce(
            (accum, borders) =&gt; {
                &#x2F;&#x2F; I sure would love a better idiom for non-destructive map updates but
                &#x2F;&#x2F; this isn&#x27;t my primary language. Suggestions welcome!
                let next = {...accum};
                next[borders.datatype] = (next[borders.datatype] || []).concat([borders])
                return next
            }, {})
    }

    export async function undoifyUserProcess(env: any,
                                            tolkien: client.tolkien,
                                            token: client.APIToken,
                                            spotData: IThingData): Promise&lt;any&gt; {

        const legendaryCustomer = await e.getCustomerById(env, spotData.customer_id);
        const orderResults = await e.findThingContractDetails(env, +spotData.spot_id);
        const workSchedule = splitOrders(orderResults);

        
        let btasks = scheduler.undoifyCustomerFromOrders(
            env, 
            token, 
            { key: legendaryCustomer.userKey }, 
            workSchedule[&#x27;newstyle&#x27;].map((wi =&gt; wi.bigId)));

        let ltasks = (workSchedule[&#x27;legacy&#x27;] || []).map(async (workItem) =&gt; {
            &#x2F;&#x2F; .. process elided but...
            const nodeKey, groupKey = [&quot;things&quot;, &quot;were&quot;, &quot;removed&quot;];
            const customerEmail = legendaryCustomer.some_field + &quot;removed work&quot; 
            &#x2F;&#x2F; Factoring this out would have introduced a function with a bunch of parameters
            &#x2F;&#x2F; or state that is only synthesized here, so we left it embedded &amp; closed over.
            try {
                return await omg.undoifyUserWithTagGroup(env, tolkien, customerEmail, nodeKey, groupKey);
            } catch(e) {
                console.log(`... malformed database call your mom for help ...`);
                throw e;
            }
        })

        try { 
            const work: Promise&lt;any&gt;[] = [btasks, ...ltasks];
            const result = await Promise.all(work);
            return await e.recordUndoifyingThing(env, +spotData.spot_id);
        } catch(e) {
            console.log(`...`);
        }
    }

</code></pre>
If a language can&#x27;t express a decently abstract functional style, I do my best to avoid it. Still, I&#x27;ve had to write a bit of Golang at my current job despite its utter lack of descriptive capabilities. It&#x27;s poignantly frustrating to deal with, but a good reminder of how bad life used to be for programmers.