3 ms·
Main selling point for me is productivity. Performance benefits are just icing on the cake. Being explicit about types allows the IDE and platform to help you
by hakanderyal 2y ago
Main selling point for me is productivity. Performance benefits are just icing on the cake.
Being explicit about types allows the IDE and platform to help you write & refactor code, allowing your brain to work on the actual problem instead.
This may sound surprising but modern C#/.NET is almost as expressive as Python. You don`t need unnecessary boilerplate or AbstractBaseFactorySingletonProxyDecoratorAdapterWrapper style types. LINQ alone is a game changer. I`m still writing code with almost same style as Python in C#, but now with the power of IDE behind me. I`m much more productive.
Interfaces are duck typing in an explicit form. Being explicit about it may sound more work, but you also need that work in Python if you want your solution to become maintainable, in the form of tests.
I`ve been using Python for ~10 years (with years of PHP/Ruby before) and written probably hundreds of thousands of lines of code. One thing I don`t like while programming is doing unnecessary work myself if the computer can do it. So I do a lot of meta programming and build abstractions when it becomes annoying to repeat myself. There had been a lot of moments where I return to a highly dynamic part of code that I`ve written months before to fix a bug and spend a lot of time trying to figure out how everything is connected. Same code in C# is both quicker to write (once you grok how reflection works and how everything is tied together), and infinitely more maintainable for less work.
Give C#/.NET a serious try. You may become surprised. I was.
- necovek 2y ago> LINQ alone is a game changer. I`m still writing code with almost same style as Python in C#,... That's very curious: do you have any quick examples that you could point me to? I was generally intrigued by C# and .NET way back when it was introduced and especially when Mono started shipping the runtime for Linux, but I hated the boilerplate and couldn't move away from Python for that reason.
- necovek 2y agoFWIW, I've read up on LINQ and it strikes me as having exactly the same issues as any ORM generally does: you lose on the expressiveness needed to get most optimal querying capabilities for the tool in use (eg. Postgres specifics or SQLite specifics or...). This is not to say that one should use string concatenation to construct queries, but that you want smart tools that do just enough. I.e. I like Storm expression language or sqlalchemy-core to express SQL as Python, but getting into deeper ORM level stuff generally harms what you can achieve once you need more complex stuff.