ChipTuner on Nostr: ``` C++ auto p = MyType(); ... 20+ lines // what tf is p? even if it's named ...
``` C++
auto p = MyType();
... 20+ lines
// what tf is p? even if it's named correctly it should be named for it's purpose, mutually exclusive to it's type.
```
Same with C#
``` C#
var p = new MyType();
```
My preferred style in all C-ish languages
```C
void Foo(void)
{
//Declaration, tells me and my compiler what memory will be in use throughout the function
int myInt, myInt2;
int* myPtr;
//Assignment is it's own statment
myInt = 0x01;
myInt2 = 0x02;
// easily cleanup or destroy memory if needed because I know at the top what's been created
}
```
auto p = MyType();
... 20+ lines
// what tf is p? even if it's named correctly it should be named for it's purpose, mutually exclusive to it's type.
```
Same with C#
``` C#
var p = new MyType();
```
My preferred style in all C-ish languages
```C
void Foo(void)
{
//Declaration, tells me and my compiler what memory will be in use throughout the function
int myInt, myInt2;
int* myPtr;
//Assignment is it's own statment
myInt = 0x01;
myInt2 = 0x02;
// easily cleanup or destroy memory if needed because I know at the top what's been created
}
```