|
|
|
|
|
by throwawaymaths
1426 days ago
|
|
IP.subnet.is_in is a guard, so there are different constraints. You could still use the `in` keyword. Honestly my experience with python has been "the solution you're looking for probably exists, but using it will require a lot of effort, and heaven help you if you need to debug someone else's code", but I have mostly dealt with Django which is a nightmare of hidden code and tensorflow. Maybe it's just I've worked with shitty python devs and on the other project Google's notoriously bad engineering practices in some of their public facing OS projects (angular, tf) |
|
Does that mean you can do something to make it transparently support IPv4 and IPv6 even though the docs mentions it only supports IPv4? Will it be more than 1 line of code?
> Honestly my experience with python has been "the solution you're looking for probably exists, but using it will require a lot of effort..."
I found it to be the opposite approach. The last time I wanted to increment a counter outside of a nested loop in Elixir it sprawled into a multi-week conversation with the author of Elixir, a git repo with 100+ programming language examples to solve the same problem[0] and a proposal on potentially altering Elixir itself to make this process a bit easier. The Python solution was about 2 minutes typing into my code editor and moving on with life.
Elixir solution: https://github.com/nickjj/nested-data-structure-traversal/bl...
Python solution: https://github.com/nickjj/nested-data-structure-traversal/bl...
I'm not saying either language is better than the other but there's certain things that can done a lot easier in Python and on the flip side I'm sure there's things you can do a lot easier in Elixir.
I found in practice for me personally when building typical web apps I kept running into roadblocks left and right with Elixir where as I never had these issues with Python or Ruby. That's why I stopped using Elixir.
> I have mostly dealt with Django which is a nightmare of hidden code
I think that'll happen with any big framework, especially if you haven't contributed a ton of code to it. The Rails code base can be intimidating too and Phoenix's code isn't any more approachable to someone who isn't already at the high end of expert with the language.
[0]: https://github.com/nickjj/nested-data-structure-traversal