-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
enhancementNew feature or requestNew feature or request
Description
As title suggests, I think it'd be nice to be able to write code without using classes. It'd be nice for languages which don't strictly have to be encased in classes (basically all except Java and C#).
Then what to do with pure OOP languages?
Either throw a compiler error (easy way) or encase top level functions in class with filename as name (hard way).
Another possibility (combined with compile error if this pattern is missing):
// oop is defined when compiling to java or csharp
#if OOP
class Something {
#endif
// top level functions
#if OOP
}
#endifWhy?
Majority of languages don't strictly require everything to be inside of classes and class-based language promotes certain way of writing API and libraries (i.e builder pattern), being able to mix and match top level functions and classes would allow for greater freedom.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request