Hi! I was using the templates from epic, but i have question about their aesthetics, they are a good place to start, but shouldn’t they make it clean? Random comments, multiple public/protect scopes in one file… why is that?
Hi there @Tarkin1230
Hope you’re having a good night! Which template/templates are you referring to?
The sleep time is only then when I add new thing to my game ;D. I think all of them to be honest, but let’s do a first person shooter as an example:
- Comments that are to be honest bad?
// Create a CameraComponent
FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));
or
// Jumping
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &ACharacter::Jump);
They state obvious things instead of describing process or some kind of math.
- Multiple scopes. When using Rider as IDE, it gives me non stop warning that there is too much “useless” scopes (at least I think that’s how you call it?). Double public, double protects… etc.
public:
AfsagdsfavdasfcvCharacter();
protected:
/** Called for movement input */
void Move(const FInputActionValue& Value);
/** Called for looking input */
void Look(const FInputActionValue& Value);
protected:
// APawn interface
virtual void NotifyControllerChanged() override;
virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;
// End of APawn interface
public:
/** Returns Mesh1P subobject **/
USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; }
/** Returns FirstPersonCameraComponent subobject **/
UCameraComponent* GetFirstPersonCameraComponent() const { return FirstPersonCameraComponent; }
This thing really keeps me awake ;D
Haha. I see! I’d recommend dropping a feedback to the devs on it. They do read those and you’re not the first person I’ve saw mention that.
Ok ok, I thought I was missing some kind of hidden aesthetic, cuz everyone else on youtube tutorials wasn’t using this kind of writing ;D
Standard useless comments, if you’re a programmer.
Rider and probably literally everyone else on earth have different coding standards. Disable that warning.
Most every C++ shop I’ve ever worked in wants the functions in the headers grouped by related ness, not by scope.
Good info! Thank you!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.