Skip to content

[Feature] Change file *Value.hpp* Coding Style #70

@SegmentationFaultCD

Description

@SegmentationFaultCD

确认事项

  • 我已经搜索了现有的issues,确认这不是重复请求
  • 我已经查看了项目的路线图和文档
  • 这个功能与Lamina的设计目标一致(专注于精确数学计算)

功能类型

开发体验改进

问题描述

When I was reading codes about Lamina/interpreter/value.hpp, I found the class Value is too big. It is seriously inconsistent with OOP SOLID principle. (Especially Single Responsibility Principle - SRP and Open/Closed Principle - OCP).

Many constructor nearly do same thing. I think it is very hard for us to read it, and it is very harmful to further develop.

the project's coupling is too high.

建议的解决方案

The target is to reduce coupling, and improve cohesion.

I strongly recommended that you can divide the "god class" into many small single classes, and use template to manage these classes.

BTW, I found that the class has a std::variant data member. In the other side, why not use variant to replace the ugly constructors? So far, I haven't clearly found that the mean that use std::variant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions