为什么我们仍然使用平面文件进行编程?(Why do we still program with flat files? [closed])

编程入门 行业动态 更新时间:2024-10-25 00:34:53
为什么我们仍然使用平面文件进行编程?(Why do we still program with flat files? [closed])

为什么平面文本文件是表示源代码的最新技术?

当然 - 预处理器和编译器需要查看文件的平面文件表示,但很容易创建。

在我看来,某种形式的XML或二进制数据可能代表很多难以追踪的想法,否则。

例如,您可以将UML图嵌入到代码中。 它们可以半自动生成,并由开发人员注释,以突出设计的重要方面。 特别是互动图。 嵌入任何用户图纸可能会使事情更加清晰。

另一个想法是将代码评论中的注释嵌入到代码中。

可以有各种各样的辅助工具,使多个分支的合并更容易。

我热衷于关注的不仅仅是跟踪代码覆盖,还要查看自动测试覆盖的代码部分。 困难的部分是跟踪该代码,即使源被修改。 例如,将功能从一个文件移动到另一个文件等。这可以使用GUID完成,但是它们相当侵入到嵌入到文本文件中。 以丰富的文件格式,它们可以是自动且不引人注目的。

那么为什么还没有IDE(据我所知),这样可以通过这种方式处理代码?

编辑: 2009年10月7日。

大多数人在我的问题上非常挂上“二进制”这个词。 我收回它 图片XML,极少地标记您的代码。 在将其提交到正常的预处理器或编译器之前,您将删除所有XML标记,并仅传递源代码。 在这种形式下,您仍然可以在文件中执行所有正常操作:diff,merge,edit,在一个简单而最小的编辑器中使用,将它们提供给数千种工具。 是的,差异,合并和编辑,直接与最小的XML标记,确实会变得更加复杂。 但我认为这个价值可能是巨大的。

如果存在尊重所有XML的IDE,那么可以添加比现在我们可以做的更多的功能。

例如,您的DOxygen注释实际上可能看起来像最终的DOxygen输出。

当有人想要执行代码审查(如代码协作者)时,他们可以标记源代码。

XML甚至可以隐藏在注释之后。

// <comment author="mcruikshank" date="2009-10-07"> // Please refactor to Delegate. // </comment>

然后如果你想使用vi或emacs,你可以跳过评论。

如果我想使用最先进的编辑器,我可以看到在十几种不同的有用的方式。

所以,这是我粗暴的想法。 这不是你在屏幕上拖动的图片的“积木”...我不是那么坚果。 :)

Why are flat text files the state of the art for representing source code?

Sure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created.

It seems to me that some form of XML or binary data could represent lots of ideas that are very difficult to track, otherwise.

For instance, you could embed UML diagrams right into your code. They could be generated semi-automatically, and annotated by the developers to highlight important aspects of the design. Interaction diagrams in particular. Heck, embedding any user drawing might make things more clear.

Another idea is to embed comments from code reviews right into the code.

There could be all sorts of aids to make merging multiple branches easier.

Something I'm passionate about is not just tracking code coverage, but also looking at the parts of code covered by an automated test. The hard part is keeping track of that code, even as the source is modified. For instance, moving a function from one file to another, etc. This can be done with GUIDs, but they're rather intrusive to embed right in the text file. In a rich file format, they could be automatic and unobtrusive.

So why are there no IDEs (to my knowledge, anyway) which allow you to work with code in this way?

EDIT: On October 7th, 2009.

Most of you got very hung up on the word "binary" in my question. I retract it. Picture XML, very minimally marking up your code. The instant before you hand it to your normal preprocessor or compiler, you strip out all of the XML markup, and pass on just the source code. In this form, you could still do all of the normal things to the file: diff, merge, edit, work with in a simple and minimal editor, feed them into thousands of tools. Yes, the diff, merge, and edit, directly with the minimal XML markup, does get a tad more complicated. But I think the value could be enormous.

If an IDE existed which respected all of the XML, you could add so much more than what we can do today.

For instance, your DOxygen comments could actually look like the final DOxygen output.

When someone wanted to do a code review, like Code Collaborator, they could mark up the source code, in place.

The XML could even be hidden behind comments.

// <comment author="mcruikshank" date="2009-10-07"> // Please refactor to Delegate. // </comment>

And then if you want to use vi or emacs, you can just skip over the comments.

If I want to use a state-of-the-art editor, I can see that in about a dozen different helpful ways.

So, that's my rough idea. It's not "building blocks" of pictures that you drag on the screen... I'm not that nuts. :)

最满意答案

你可以分辨他们 你可以合并它们 任何人都可以编辑它们 它们是简单易用的 它们可以通过数千种工具进行访问 you can diff them you can merge them anyone can edit them they are simple and easy to deal with they are universally accessible to thousands of tools

更多推荐

本文发布于:2023-07-22 18:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1222305.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平面   文件   program   closed   files

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!