当前位置:网站首页>Functions should not specify operation types through variables
Functions should not specify operation types through variables
2022-06-25 08:00:00 【Channing Lewis】
To reduce code repeatability , I wrote a general function , Various similar operations are implemented by specifying parameters .
But my colleagues suggested that I should encapsulate a separate interface for each parameter even in this way , Because the name of the specified parameter may change , If you want to change it, you should change every place where you call this function , Or I need to convert the parameter name inside the function again .
This does not take into account the parameter name changes , The old parameter name is used by another operation , If you don't change it, you can't tell whether to execute the old operation or the new operation .
So a generic interface should only be used internally , External or need a separate interface .
边栏推荐
- Linux上oracle和mysql的启动,关闭,重启
- Atlas conference vulnerability analysis collection
- Application of can optical transceiver of ring network redundant can/ optical fiber converter in fire alarm system
- This article uses pytorch to build Gan model!
- 使用报文和波形记录分析仪RoyalScope的帧统计功能排查CAN总线偶发性故障
- 黑点==白点(MST)
- Anaconda navigator启动慢的一个解决方法
- 取消word文档中某些页面的页眉
- MySQL简单权限管理
- 【Unexpected token o in JSON at position 1出错原因及解决方法】
猜你喜欢

唐老师讲运算放大器(第七讲)——运放的应用

Do you know why the PCB produces tin beads? 2021-09-30

How much do you know about electronic components on PCB?

C#中如何调整图像大小

420-二叉树的层序遍历2(429. N 叉树的层序遍历、515.在每个树行中找最大值、116.填充每个节点的下一个右侧节点指针、104.二叉树的最大深度、111.二叉树的最小深度)

c#磁盘驱动器及文件夹还有文件类的操作
![[little knowledge] PCB proofing process](/img/bf/f66677294a14baf08cc35d1e8c1e31.jpg)
[little knowledge] PCB proofing process

剑指 Offer II 027. 回文链表

基于RBAC 的SAAS系统权限设计

Three Siemens fire-fighting hosts fc18 are equipped with can optical transceiver for optical fiber redundant ring network networking test
随机推荐
Requirements for Power PCB circuit board design 2021-11-09
50 pieces of professional knowledge of Product Manager (IV) - from problem to ability improvement: amdgf model tool
Tips 𞓜 how to clean PCB boards 2021-10-22
新版USBCAN卡CAN分析仪的CAN&CANFD综合测试分析软件LKMaster主要功能介绍
Authority design of SaaS system based on RBAC
【红旗杯?】补题
One "stone" and two "birds", PCA can effectively improve the dilemma of missing some ground points under the airborne lidar forest
Force deduction 76 questions, minimum covering string
Debugging mipi-dsi screen based on stm32mp157
Atlassian Confluence 远程代码执行漏洞(CVE-2022-26134漏洞分析与防护
50. pow (x, n) - fast power
共话云原生数据库的未来
2160. 拆分数位后四位数字的最小和
洛谷P5994 [PA2014]Kuglarz(异或思维+MST)
MySQL simple permission management
电子学:第010课——实验 8:继电振荡器
To understand the difference between Gram-positive and Gram-negative bacteria and the difference in pathogenicity
ffmpeg+SDL2实现音频播放
基于Anaconda的模块安装与注意事项
力扣 272. 最接近的二叉搜索树值 II 递归