3 ms·
My biggest issue with C# is around communicating with other platforms/systems. In PHP: return base64($myText); is all I need (or sha1(), etc). The standa
by withinboredom 3y ago
My biggest issue with C# is around communicating with other platforms/systems.
In PHP:
return base64($myText);
is all I need (or sha1(), etc). The standard library (with it's bizarre inconsistencies that you stop noticing after half a decade) is quite complete.
In C#, it's much more involved to do these "easy" things. Even reflection is easy in PHP:
$class->$dynamicMethod(...$props);
I moved away from C# about 3-4 years ago, and I don't miss it.
- neonsunset 3y agoReflection is notoriously problematic in regards to type safety in many languages and often isn't the right tool for the job, including C#. The base64, in most languages, requires importing the right package or namespace. Converting bytes to Base64 is just Convert.ToBase64String/CharArray(bytes). I can't believe someone would seriously and unironically suggest PHP. It does not even compete at the only area it's applicable at being back-end or server-side rendering.
- withinboredom 3y agoIt wasn't always that easy in C#, fwiw. > It does not even compete at the only area it's applicable at being back-end or server-side rendering. I'm not sure what you mean here. I've deleted my blog, but I once published benchmarks showing PHP was faster than C# in some cases. I'm currently working on a reimplementation of some C# stuff in PHP and competing with C# quite well. PHP is written in C; it's quite fast.
- neonsunset 3y agoPHP is an interpreted dynamically typed language. It would always be slower and would always have strict performance ceiling. Given sufficiently competent compilers of similar level of engineering effort, that would always be true. PHP is within the same performance weight category as JavaScript. C# is in the same weight category as Kotlin ad Java, sometimes Rust and C++. It is guaranteed in the same category as Rust and C++ for performance-oriented code (struct generics and spans). To think that an interpreter, where each single instruction is, in the very best case, a computed goto jump with args evaluation, would execute the code faster or comparable to code that is compiled to CPU instructions, is insanity. Even when/if PHP gets JIT compiled, it still has the same language constraints where even something as sophisticated as V8 has to contend with language spec so it cannot optimize away e.g. property access. It might be best to re-evaluate prior assumptions and knowledge which do not correspond to reality.
- withinboredom 3y ago> It might be best to re-evaluate prior assumptions and knowledge which do not correspond to reality. heh, right back at you dude. Opcache JIT is running on an actual CLR just like C#, it can even AOT compile.
- neonsunset 3y ago[flagged]
- withinboredom 3y ago> I suppose mental afflictions come in all shapes and forms. Yes, I suppose some people need proof of things; especially things that aren't that easy to google because it's new and the language has been around since the web's infancy.