编程思想和软件开发目录规范


一、编程思想的转变

在我们从开始学习到目前为止,编程思想经历了三个阶段:

1、面条版阶段

也就是刚学完流程控制的时候的代码,全部内容都需要一一细分,详细编写,这个阶段并没有持续很久。

2、函数版阶段

当我们学习了函数后我们知道了把功能类似的代码整合成函数,需要使用的时候统一调用就可以实现同样的功能。

3、模块阶段

也就是到昨天为止,我们根据不同的作用,把功能相似的代码整合到一个模块中,在使用的时候导入模块就一样可以实现功能。

这三个阶段可以用我们管理电脑上的文件来进行类比记忆,当我们在使用第一个阶段的时候,就相当于我们把所有常用的文件都放在桌面,第二个阶段就相当于我们对文件进行了分类整理,第三个阶段就相当于我们在分类的基础上进行了优化提高了资源管理效率,把桌面的文件分散到其他盘中。

二、软件开发目录规范

根据上面的编程思想,我们了解到在使用第三类思想进行编程的时候需要根据功能进行详细分类,虽然在开发的时候名称不一样,但是基本思想一致,因此产生了软件开发目录规范:

1、bin目录

内部存放程序的执行文件,文件名称可以是start.py

2、conf目录

内部存放配置文件,比如我们的桌面上的一些设置就是存在对应的配置文件中的,文件名称一般是settings.py

3、core目录

内部存放核心功能的代码,文件名称一般是src.py

虽然说是存放核心功能,但是并不意味着主体功能就需要放在这里,可以放到下面的interface目录

4、lib目录

内部存放一些公共功能的代码文件,文件名称一般是common.py

5、db目录

用于存储数据文件,比如之前编写的员工信息管理系统,我们可以把员工信息的txt文件放到这个目录下

6、interface目录

内部存放端口文件,上面说了,核心功能的文件写在core目录中,但是主体功能是从interface目录下的代码中调用过去的。需要根据具体的业务逻辑划分对应的文件,通常的命名是goods.py等见名知意的名字

7、log目录

这里是日志目录

内部文件就是记录一下平时我们的操作记录

文件名一般是log.log

8、readme文件

通常是一个文本文件用于说明项目相关信息

9、requirements.txt文件

内部存项目所需要的模块以及版本信息


posted @   致丶幻  阅读(65)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
  1. 1 So Far Away (Acoustic) Adam Christopher
  2. 2 雪 Distance Capper&罗言RollFlash
  3. 3 CollapsingWorld
  4. 4 Call You Tonight Johnta Austin
So Far Away (Acoustic) - Adam Christopher
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.

作曲 : David Guetta/Giorgio H Tuinfort/Jamie Scott/Martijn G Garritsen

Light ‘em up, light ‘em up

Tell me where you are, tell me where you are

The summer nights, the bright lights

And the shooting stars, they break my heart

I‘m calling you now, but you‘re not picking up

Your shadows so close if you are still in love

Then light a match, light a match

Baby, in the dark, show me where you are

Oh, love

How I miss you every single day when I see you on those streets

Oh, love

Tell me there‘s a river I can swim that will bring you back to me

‘Cause I don‘t know how to love someone else

I don‘t know how to forget your face

Oh, love

God, I miss you every single day and now you‘re so far away

It‘s breaking me, I‘m losing you

We were far from perfect, but we were worth it

Too many fights, and we cried, but never said we‘re sorry

Stop saying you love me

You‘re calling me now, but I can‘t pick up

Your shadow‘s too close, and I‘m still in love

The summer‘s over now, but somehow, it still breaks my heart

We could have had the stars, oh

Oh, love

How I miss you every single day when I see you on those streets

Oh, love

Tell me there‘s a river I can swim that will bring you back to me

‘Cause I don‘t know how to love someone else

I don‘t know how to forget your face

Oh, love

God, I miss you every single day and now you‘re so far away

Oh, love

How I miss you every single day when I see you on those streets

Oh, love

Tell me there‘s a river I can swim that will bring you back to me

‘Cause I don‘t know how to love someone else

I don‘t know how to forget your face

Oh, love

God, I miss you every single day when you‘re so far away

点击右上角即可分享
微信分享提示