如何减少编辑、编译、调试周期?
使用编译语言(我使用 Delphi 和 FreePascal)时,我总是遇到一件事,那就是繁琐的编辑、编译、调试周期。最近情况变得越来越糟,现在每当我必须进行一些更改时,我都开始害怕整个过程,尤其是当它们只是小的 GUI 更改时。
我必须等待每次生成现在接近 60Mb 的启用调试的 exe,然后才能开始调试,而且我担心我开始显示出 ADD 的迹象。我倾向于在做饭的同时用我能做的事情来进行开发。
问题在于,盯着屏幕的时间太长,而在返回屏幕之前又太短,无法将注意力转移到其他事情上。
我想对于编译语言来说,ObjectPascal 还不错,我相信对于 C++ 程序员来说更糟糕。
我可能需要配备具有 24Gb RAM 的六核 CPU 和最快的 SSD,以使该过程可以忍受。一些托管提供商的收费约为每月 100 欧元。
现在开始业务
很简单,我正在考虑一种分部分创建应用程序的方法,以便包含新功能的部分可以作为独立程序(甚至可能是控制台程序)单独开发。
这就提出了如何传递过程参数和结果的问题,这些是最初想到的选项。
找到一种方法来自动将简单变量、记录结构或对象转换为文本,并通过命令行或管道传递它们。也许这里可以使用 JSON、XML 或简单的名称-值对。将参数设计为流式传输为文本形式的 TPersistent 对象可能是一个更好的选择。
不要使用命令行,而是让它们成为网络服务并以这种方式传递参数,或者可以使用所有新的 webby 东西使它们成为 RESTful/XML-RPC(我现在正在研究其中的一些东西)
设计它们最初将它们设计为 DLL - 我怀疑这会带来一系列不同的问题。
一旦它们经过充分测试,我就可以将它们合并到主要的可执行文件中。
我怀疑其他人以前使用 ObjectPascal 甚至其他语言也遇到过这个问题,并且已经找到了缓解该问题的方法。
如果我必须照常做生意,使用界面之类的东西会有帮助吗?
我真的需要一些帮助,否则我可能不得不求助于 PHP(喘息!!)甚至 Java(更大的喘息!!震惊!!恐怖!)或 Zen(不是编程语言)
One thing that has always gotten to me when using compiled languages, (I use Delphi and FreePascal) the tedious edit, compile, debug cycle. It has been growing worse of late that now I am beginning to dread the whole process any time I have to make some changes, especially when they are just minor GUI changes.
I have to wait for what is now approaching 60Mb of debugging enabled exes to be generated every time before debugging can start and I'm afraid I am beginning to show signs of an ADD. I tend to approach development with what I can do in the mean time whilst stuff is cooking.
The problem is the is duration too long to be staring at the screen, and too short to give something else your attention before coming back to it.
I guess for compiled languages ObjectPascal isn't bad, I believe it is even worse for C++ programmers.
I may have to get a hex core CPU with 24Gb of RAM, and the fastest SSDs to make the process tolerable. Some hosting providers are doing them for circa €100 a month.
Now to Business
Quite simply I am thinking of a way to create the application in parts, so that the parts containing the new functionality can be developed separately as standalone programs, perhaps even console programs.
This raises the question of how procedure parameters and results can be passed, and these are the options that have initially come to mind.
Find a way to automatically translate simple variables, record structures, or objects into text and pass them via the command line or pipes. Perhaps JSON, XML or simple name-value pairs can be used here. Designing the parameters as TPersistent objects that are streamed into text form may be a better option here.
Rather than using the command line, make them network services and pass the parameters that way, or may make them RESTful/XML-RPC with all the new webby stuff( I am getting into some of that stuff now)
Design them as DLLs initially - I suspect that will bring along a different set of problems.
Once they are well tested I can incorporate them into the main executables.
I suspect that others have come across this problem before, with ObjectPascal and perhaps other languages and have found a way to mitigate the problem.
If I have to do business as usual, will using stuff like interfaces help?
I really need some help here or else I may have to resort to PHP(gasp!!) or even Java (bigger gasp!! shock!! horror!) or Zen (not the programming language)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将解释性语言集成到您的应用程序中。如果您有一种与 C 兼容的语言(我不是 Delphi 或 FreePascal 方面的专家),您可以轻松集成许多常见的解释语言,例如 Lua、Python 或 JavaScript。
同样,我想说,如果您因为更改了 GUI 而重新编译了整个内容,那么是时候更改您的构建过程了。将不同的模块编译到不同的库中,并且仅重新编译有问题的库。这也有助于强制封装,因为一个 DLL 不可能使用非导出函数调用另一个 DLL。
Integrate an interpreted language into your application. If you have a C-compatible language (I'm no expert on Delphi or FreePascal) you could easily integrate a number of common interpreted languages, like Lua, Python, or JavaScript.
Equally, I'd say that if you're recompiling the whole thing because you made a GUI change, then it's time to alter your build process. Compile the different modules into different libraries and only recompile the library in question. This also helps to enforce encapsulation, as it's impossible for one DLL to call another DLL with a non-exported function.