Menu

Post image 1
Post image 2
1 / 2
0

CLAUDE.md for Scala: 13 Rules That Make AI Write Idiomatic Functional Code

DEV Community·Olivia Craft·27 days ago
#LWLGcQnP
Reading 0:00
15s threshold

CLAUDE.md for Scala: 13 Rules That Make AI Write Idiomatic Functional Code You ask Claude to "add a Subscription service that calls Stripe" inside your Scala codebase, and you get back something that compiles cleanly and is still wrong: A function that returns null when the user isn't found, instead of Option[User] . Three Future { … } blocks chained with .map / .flatMap and an Await.result at the bottom — inside a service that's otherwise running on cats-effect. A class Order(var status: String, var total: Double) with seven mutable fields, when Order is obviously a closed sum of states ( Draft , Submitted , Paid , Shipped , Cancelled ). A try { … } catch { case _: Throwable => default } that swallows everything, including the OutOfMemoryError you'd actually want to crash on. A def transfer(from: String, to: String, amount: Double) that takes the world's three most ambiguous primitives and trusts that callers pass them in the right order.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More