3 ms·
That's all well and good for Linux-style C programming maybe, but it would be painful in languages like C#. EG the simplest function in a Unity game, that prin
by sk0g 5y ago
That's all well and good for Linux-style C programming maybe, but it would be painful in languages like C#.
EG the simplest function in a Unity game, that prints "hello world" for the player only would be something like:
namespace Something
{
class SomeClass
{
void Awake()
{
if (CompareTag("Player"))
{
print("Hello, world")
print("This line's closing bracket is at # 80")
}
}
}
}
- catmanjan 5y agoThe new C# 6 templates don't require namespace or class blocks - for this reason I suppose.
- sk0g 5y agoI do like having the namespace there, if only to gently nudge you towards better architecture. As a temp fix I have overridden Rider's code formatting to not indent within the namespace, but C# 10 will bring file scoped namespaces. You can just declare the namespace between the imports and the classes, and everything in the file will be namespaced automatically.
- fingerlocks 5y agoPretty much every language with a class that contains a function with a loop that breaks on an inner condition would be 4 levels deep. I suppose Objective-C would only be 3 deep, but I can't think of any others off the top of head.