Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post/python_position_of_adjective/ #6

Open
utterances-bot opened this issue Mar 9, 2022 · 2 comments
Open

post/python_position_of_adjective/ #6

utterances-bot opened this issue Mar 9, 2022 · 2 comments

Comments

@utterances-bot
Copy link

Python 系列:变量命名时形容词应该放在名词前面还是后面? - 炸鸡人博客

A minimal Hugo theme with nice theme color.

https://zhajiman.github.io/post/python_position_of_adjective/

Copy link

ghost commented Mar 9, 2022

是否可以理解为越是强调的某个类就越需要往前放,那自然而然就会遇见诸如dataset和dataloader这种对称情况即会产生:

  • dataset_val
  • dataset_train
  • dataloader_val
  • dataloader_train
    或者说这样的版本:
  • val_dataset
  • val_dataloader
  • train_dataset
  • train_dataloader

似乎采用哪种都可以,又似乎哪种都不方便

Copy link
Owner

ZhaJiMan commented Mar 9, 2022

你这只有两种类配上两种成员,我觉得两种写法都行,而且官网文档用的就是后者。但当类的子成员非常多时,我感觉前者会更整洁,阅读负担也更低。如果是用 pandas 或 xarray 存储这些数据的话,自然也会形成 df.valdf.train 这样的写法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants