What was the nicest codebase you've inherited without the original author(s)?
140 pointsby _randyr68 comments
class OnListItemSelected {
OnListItemSelectedData data;
void operator()(int selectedIndex) { ... }
}
Perhaps I'm mistaken in what the author is trying to accomplish though? if Code.ensure_loaded?(SomeModuleFromAnotherLib) do
# Some lib is loaded, add code to integrate with it.
end
I think that could only be solved if that integration were extracted into another lib with properly setup deps, but due to how common this pattern is I don't think it's ever possible to switch to parallel dep compilation. Recipe:
directions: rich text
storageInstructions: rich text
prepTime: minutes
cookTime: minutes
priceEstimateperServing: money
ingredients: RecipeIngredient[]
// other fields (e.g. tags, id, name, slug, purchaseableAt, nutrients, etc)
RecipeIngredient:
recipeId: reference to recipe
ingredientId: reference to recipe as well
// Allows grouping ingredients (e.g. "sauce", although the sauce could be a recipe of its own instead)
group: string | null
There's some challenges with this though: "file.json"
|> File.read!()
|> Jason.decode!()
|> Stream.flat_map(& &1["children"])
|> Map.new(fn child -> {child["id"], child} end) with {:ok, x} <- {:ok, "Example"},
IO.puts(x),
len = String.length(x) do
IO.puts(len)
end
Did you mean something else?