Caveman
- 0 Posts
- 4 Comments
Joined 2 years ago
Cake day: August 19th, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
It’s a common practice but not required. Python behaves like JS where it just runs whatever you wrote. If you don’t want it to run when importing the file you can put the main() inside the if so it only runs when you run the actual file.
You can use it when developing a function or a class to run a simple test without running the whole program.
Bash combines quick, dirty and fast in exchange for readable. Bash is also nice for terminal functions like opening a set of programs and whatever
The MS style guide, which most C# code follows, says so.
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names#pascal-case
I personally hate it and I prefer the java/js style. The braces are also horrible. Here’s an example.
public class ExampleEvents { public bool IsValid; public IWorkerQueue WorkerQueue { get; init; } public event Action EventProcessing; public void StartEventProcessing() { static int CountQueueItems() => WorkerQueue.Count; // ... } }