使用 Wt C++ 框架的经验?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1737324/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 21:04:15  来源:igfitidea点击:

Experiences using Wt C++ framework?

c++wt

提问by StackedCrooked

  • Has anyone seriouslyused Wt?
  • Did it work well?
  • Did you experience certain limitations? Or advantages?
  • 有人认真用过Wt吗?
  • 效果好吗?
  • 您是否遇到过某些限制?还是优势?

Wtis a C++ library for developing web applications.

Wt是一个用于开发 Web 应用程序的 C++ 库。

Please avoid the discussion of whether C++ is a good language for web development. I just want to give Wt a try because it seems like it could be a fun thing to do.

请避免讨论 C++ 是否是 Web 开发的好语言。我只是想尝试一下 Wt,因为这似乎是一件有趣的事情。

采纳答案by messedup

I have not personally used the framework, but have discussed it with a few people that have. They didn't really have any limitations, but I found it hard to believe they were compiling every time. Their main comment was that it was quite a light load on the server in terms of memory usage. Personally, I think the interpreted languages of php, python, ruby, etc work well with the nature of web development - but that's not the question you asked. Probably the biggest advantage is being able to use your existing skill set to work in a new medium.

我没有亲自使用过该框架,但与一些使用过的人进行了讨论。他们真的没有任何限制,但我发现很难相信他们每次都在编译。他们的主要评论是,就内存使用而言,服务器上的负载相当轻。就个人而言,我认为 php、python、ruby 等的解释性语言与 Web 开发的性质很相配——但这不是你问的问题。最大的优势可能是能够使用您现有的技能组合在新媒体中工作。

There are also a few good comments online discussing pros and cons. Here is one I found http://discuss.joelonsoftware.com/default.asp?biz.5.599655.33

网上也有一些很好的评论讨论利弊。这是我找到的一个http://discuss.joelonsoftware.com/default.asp?biz.5.599655.33

However, I think the main answer here is that without a specific project requirement in mind, it is going to be difficult to evaluate any framework for suitability. If you think it will be fun to try coding a few things with it, then give it a go. That is going to be the best (if not only) way to determine if it suits your needs.

但是,我认为这里的主要答案是,如果没有考虑到特定的项目要求,就很难评估任何框架的适用性。如果您认为尝试使用它编写一些代码会很有趣,那么请试一试。这将是确定它是否适合您的需求的最佳(如果不是唯一的话)方法。

回答by BD at Rivenhill

I've been using Wt to build apps that directly link to C++ libraries but don't particularly make a lot of effort to exercise the layout features such as CSS. So far, it works great as a replacement for GTK when building these kind of applications. I'm a Linux user exclusively and I'm also one of the unwashed heathen who actually enjoys programming in C++, and this framework is a perfect way for me to build an application that can actually be used across many platforms.

我一直在使用 Wt 来构建直接链接到 C++ 库的应用程序,但并没有特别努力地练习诸如 CSS 之类的布局功能。到目前为止,在构建此类应用程序时,它可以很好地替代 GTK。我只是一个 Linux 用户,而且我也是真正喜欢用 C++ 编程的未受洗礼的异教徒之一,这个框架是我构建一个可以在许多平台上实际使用的应用程序的完美方式。

回答by ravenspoint

I have tried several C++ embedded web servers. They tend to be a challenge to use, and not Windows friendly.

我尝试了几个 C++ 嵌入式 Web 服务器。它们在使用上往往是一个挑战,而不是 Windows 友好的。

( You do not mention your platform. If you are on Unix, then I suspect you will find the available servers easier to use, and can probably ignore this answer. If you are on Windows, read on ... )

(您没有提到您的平台。如果您使用的是 Unix,那么我怀疑您会发现可用的服务器更易于使用,并且可能可以忽略此答案。如果您使用的是 Windows,请继续阅读...)

I have tried Wt, but was defeated by the massive installation, which takes hours to compile and generates page after page of warnings, and the extensive learning curve. Wt is modeled on Qt, so if you are familiar with Qt, the learning curve will be much less of a challenge.

我尝试过 Wt,但被大规模安装打败了,它需要数小时的时间来编译并生成一页又一页的警告,以及广泛的学习曲线。Wt 以 Qt 为模型,因此如果您熟悉 Qt,学习曲线将不会那么困难。

I have tried Webio by John BartasI liked the concept and it worked well. However, I found it overly complicated to use and the server code hard to understand. A lot of the complexity of Webio is caused by using an “HTML compiler” to hide the HTML pages that control the appearance of the GUI inside a file system embedded inside the application code. I prefer to have the HTML pages outside in plain view where I can adjust the GUI without recompiling the application.

我尝试过 John Bartas 的 Webio,我喜欢这个概念并且效果很好。但是,我发现它使用起来过于复杂,而且服务器代码难以理解。Webio 的许多复杂性是由于使用“HTML 编译器”将控制 GUI 外观的 HTML 页面隐藏在嵌入在应用程序代码中的文件系统中造成的。我更喜欢将 HTML 页面放在外面的普通视图中,这样我就可以在不重新编译应用程序的情况下调整 GUI。

I have also looked at TWSThis is by Richard Hipp who is responsible for SQLITE and FOSSIL and of whom I am a great fan. However, TWS has not been maintained since 2001 and is not really WINDOWS, so I reluctantly decided not to pursue it.

我也看过TWSThis is by Richard Hipp 他负责 SQLITE 和 FOSSIL,我是他的忠实粉丝。不过TWS从2001年就没有维护了,也不是真正的WINDOWS,所以无奈决定不去追求了。

In the end I rolled my own, called WEBEMbased on a minimally modified version of the boost::asio web server. In concept similar to, but simpler than TWS, it permits html code to execute C++ methods.

最后,我推出了自己的名为WEBEM 的基于 boost::asio Web 服务器的最小修改版本。在概念上类似于但比 TWS 更简单,它允许 html 代码执行 C++ 方法。

回答by Artyom

To be honest, I had looked on it but I see one significant Wt design flaw -- it modeled after Qt. Trying to make web applications to look and behave like GUI.

老实说,我看过它,但我发现了一个重要的 Wt 设计缺陷——它以 Qt 为模型。试图使 Web 应用程序的外观和行为类似于 GUI。

I think, this approach is wrong. There should be clear separation between client side and server side.

我认为,这种做法是错误的。客户端和服务器端之间应该有明确的分离。

If you are interested in C++ web programming take a look on CppCMSwhich has more traditional MVC model.

如果您对 C++ Web 编程感兴趣,请查看具有更传统 MVC 模型的CppCMS

Note, I have biased opinion, because I'm developer of CppCMS.

请注意,我有偏见,因为我是 CppCMS 的开发人员。

回答by mempko

Made a todo list app using it. works great, no problems.

使用它制作了一个待办事项列表应用程序。效果很好,没有问题。

回答by Kapoios

I currently use it to develop a GPS measurements processing web application, based on processing algorithms implemented in C. It works well and has a good synergy with legacy C/C++ code.

我目前使用它来开发 GPS 测量处理 Web 应用程序,基于在 C 中实现的处理算法。它运行良好,并与遗留 C/C++ 代码具有良好的协同作用。

It's documentation its not so extensive and the lack of learning tutorials and related books makes it somehow hard to learn.

它的文档不是那么广泛,并且缺乏学习教程和相关书籍使其在某种程度上难以学习。