php++i和i++区别

tech2023-10-22  99

php++i和i++区别

We’ve talked about a lot of weird things so far on SitePoint (well, at least I think some of them are weird), but this may take the cake. In this series I want to talk to you about PHP – and the IBM I. That’s right, the IBM i, formerly known as System i and before that as the AS/400. Let’s start by dispelling the myth that the i is dinosaur; it’s actually a very wonderful machine, and there are lot of opportunities for brave PHP programmers who venture into this realm.

到目前为止,我们已经在SitePoint上谈论了很多奇怪的事情(好吧,至少我认为其中有些很奇怪),但这可能会使事情变得艰难。 在本系列中,我想向您介绍PHP –和IBMI。是的,IBM i,以前称为System i,在此之前称为AS / 400。 让我们从消除“我是恐龙”这一神话开始。 它实际上是一台非常出色的机器,勇敢PHP程序员冒险进入这个领域有很多机会。

关于我的真相 (The Truth About the i)

Before you get up in my face about the i being a dinosaur, not a real option in the high tech Windows 8 world of today, let me caution you that the closest I’ve ever come (as an adult) to getting into a fight in a bar was over the i. In my defense, I had just gotten off a four hour flight, it was late, and I was trying to catch the NFL scores for the day. Still, you might want to tread lightly here.

在您对我是恐龙,而不是当今的高科技Windows 8世界中的真正选择站起来之前,让我告诫您,我(成年后)是最接近战斗的人在酒吧里过i。 为了辩护,我刚下了四个小时的航班,已经很晚了,我正努力赶上当天的NFL成绩。 不过,您可能要在这里稍稍踩一下。

Yes, the IBM i has been around since the late 70’s or early 80’s depending on how you look at it. But it’s not an old fashioned machine and the kernel for Windows and Unix date from roughly the same time period.

是的,IBM i自70年代末或80年代初以来一直存在,这取决于您的看法。 但这不是一台老式机器,Windows和Unix的内核大约是同一时期的。

If the adage comparing Unix to buying a car that you have to assemble yourself, and Windows to a car that needs to be repaired before you can drive it, is true, then it’s also true that the i is like getting a car off the showroom floor completely assembled and ready to go.

如果将Unix与购买自己必须组装的汽车,将Windows与需要修理才能驾驶的汽车进行比较的格言是正确的,那么我也很喜欢把汽车从陈列室里拿出来,这确实是正确的。地板完全组装好并可以使用了。

The hallmark of the i is its level of integration. All aspects of the machine are integrated: the language, the database, the operating system. It’s a very fast machine (up to Power-7 chips now), is very scalable (from blade servers to mega systems), and has a very advanced operating system that separates the hardware from the software (making it very easy and transparent to switch from 32-bit hardware to 64-bit with no changes required to the programs – this happened in the late 90’s; all i programs are 64 bit) and has a security structure that is unrivaled. No IBM i system has ever been successfully hacked.

i的标志是其集成度。 机器的所有方面都集成在一起:语言,数据库,操作系统。 这是一台非常快的机器(现在最多可以使用Power-7芯片),具有很高的可扩展性(从刀片服务器到大型系统),并且具有非常先进的操作系统,可以将硬件与软件分离(切换非常容易且透明)从32位硬件到64位,而无需更改程序–这发生在90年代后期;所有i程序都是64位),并且具有无与伦比的安全性结构。 从未成功入侵过IBM i系统。

OMG – it’s a system from heaven! So why doesn’t everybody have one? The i is a clear winner if you look at any study that focuses on the total cost of ownership over several years, but we are a quarterly-driven society. The acquisition price of the i is more expensive than a Windows server. Moreover, IBM has never seen fit to provide a native GUI interface to the i. Those who use green screens are loath to switch to a GUI or browser configuration because it’s so much easier to enter data and commands directly, but today’s reality is that you have to have a pretty GUI.

天哪-这是一个来自天堂的系统! 那么为什么每个人都没有一个? 如果您研究任何关注几年总拥有成本的研究,i无疑是赢家,但我们是一个季度驱动的社会。 i的收购价格比Windows服务器贵。 而且,IBM从未认为适合为i提供本机GUI界面。 那些使用绿屏的用户不愿切换到GUI或浏览器配置,因为直接输入数据和命令要容易得多,但是今天的现实是,您必须拥有漂亮的GUI。

i和GUI (The i and GUI)

So, we’ve proven that I love the i, but what does that have to do with you? For the past 40 years, RPG programmers on the i have been churning out green screens at an incredible rate. And now, suddenly, everyone wants them to produce browser-based screens. The problem is, there’s no native way to do this on the i (this isn’t the same as saying that there is no way to do this on the i, but rather that doing it is not something that RPG programmers naturally have their hands around).

因此,我们证明我爱i,但这与您有什么关系? 在过去的40年中,i上的RPG程序员一直在以惊人的速度生产绿色屏幕。 现在,突然之间,每个人都希望他们产生基于浏览器的屏幕。 问题是,没有在i上执行此操作的本地方法(这与说没有在i上执行此操作的方法不同,而是说这样做并不是RPG程序员自然而然地会做的事情周围)。

We could replace RPG on the i with something that is browser-based. Maybe Java. Or .Net. The problem with this is that for business logic, which involves a lot of logic and calc and case structures, there is nothing better than RPG (unless you use COBOL to which most i people are severely allergic). As a result, RPG is here to stay and the basic programs required by the ERP systems that run on the i will continue to use RPG.

我们可以用基于浏览器的东西代替i上的RPG。 也许是Java。 或.Net。 这样做的问题是,对于涉及大量逻辑,计算和案例结构的业务逻辑,没有什么比RPG更好的了(除非您使用大多数人都对之过敏的COBOL)。 因此,RPG仍然存在,并且在i上运行的ERP系统所需的基本程序将继续使用RPG。

In the i world there are a number of options to creating the screens and then interfacing them with the RPG logic. And every educator in the i world is busy trying to entice RPG programmers to learn one of a number of options, PHP being one of them.

在i世界中,有很多选项可以创建屏幕,然后将它们与RPG逻辑接口。 而且,i世界中的每位教育工作者都在努力吸引RPG程序员学习众多选项之一,PHP是其中之一。

The problem that most RPG people face is that they have gone through multiple head count reductions over the past 10 years and most of them don’t have time to do what they need to do with RPG, much less learn something new. That means that the i world is in a position to use people who have PHP knowledge but don’t know anything about RPG.

大多数RPG人士所面临的问题是,在过去的10年中,他们经历了多次裁员,并且大多数人没有时间去做他们需要做的RPG工作,更不用说学习新知识了。 这意味着i世界可以使用具有PHP知识但对RPG一无所知的人。

角色扮演和东西 (RPG and Stuff)

For those of you who don’t know anything about RPG (and I would guess that is most of you), RPG started out as a simple report writer. But nothing stays simple forever.

对于那些对RPG一无所知的人(我想是你们中的大多数人),RPG最初只是一个简单的报告编写者。 但是,没有什么能永远保持简单。

Initially, RPG people tended to write big programs, with a single program containing screen build, control logic, and business logic. But with the introduction of RPG ILE about 10 years ago, the tide began to turn. ILE made RPG much more efficient in how it called sub programs and now a lot of people are pushing the MVC pattern with RPG handling the model and controller but something else, like PHP, to do the view.

最初,RPG人员倾向于编写大型程序,而单个程序包含屏幕构建,控制逻辑和业务逻辑。 但是大约10年前,随着RPG ILE的推出,潮流开始转向。 ILE使RPG更加高效地调用子程序,现在很多人都在推动MVC模式,RPG处理模型和控制器,而其他方法(例如PHP)来执行视图。

Most companies would use MVC except for one problem; their normal RPG programmers may be able to do ‘Hello World’ in PHP but they aren’t ready to develop complicated screens or deal with the network consequences of those screens (sessions, cookies, REST, etc.). That opens a real opportunity for PHP programmers who can do those kinds of things and who are willing to work within an i framework.

除了一个问题,大多数公司都会使用MVC。 他们的普通RPG程序员也许可以用PHP编写“ Hello World”,但他们还不准备开发复杂的屏幕或处理这些屏幕的网络后果(会话,Cookie,REST等)。 这为那些可以做这些事情并且愿意在i框架内工作PHP程序员提供了一个真正的机会。

入门 (Getting Started)

So with a potential revenue stream waiting to be tapped, the question is how do you, the PHP programmer, do just that?

因此,随着潜在的收入流等待挖掘,问题是,PHP程序员如何做到这一点?

First, get over thinking of the i as an outdated machine. I have yet to see anyone who gets familiar with the environment who doesn’t wonder why all computer systems are not like it.

首先,将i视为过时的机器。 我还没有看到任何熟悉环境的人,不奇怪为什么所有计算机系统都不喜欢它。

Second, you need to gain some familiarity with RPG. No, you don’t need to know how to code it, but you should know how to deal with it. That is, how does RPG ILE work and how can you use it to allow you to do the screens (pages) for the RPG applications in PHP. Often, the people you will be dealing with will need to be helped to understand how PHP can fit into their plans and what they have to do to set RPG up to be PHP friendly.

其次,您需要对RPG有所了解。 不,您不需要知道如何编写代码,但是您应该知道如何处理它。 也就是说,RPG ILE的工作方式以及如何使用它来允许您为PHP中的RPG应用程序做屏幕(页面)。 通常,将需要帮助您与之打交道的人员,以了解PHP如何适合他们的计划,以及如何将RPG设置为对PHP友好。

Third, setting up business pages is different from pages for web sites, so one of the things you should do is become familiar with the differences and how to set them up for maximum efficiency.

第三,设置业务页面不同于网站页面,因此您应该做的一件事情就是熟悉差异以及如何设置差异以实现最大效率。

结论 (Conclusion)

That’s all they’ll let me write for this part. But stay tuned dear reader, as next week I’ll dive into what developing on the i is like for the brave PHP programmers who venture into this realm!

这就是他们要让我写的全部内容。 但是敬请关注,亲爱的读者, 下周我将深入探讨i方面的发展,这是勇于闯入这一领域的勇敢PHP程序员的!

Image via Fotolia

图片来自Fotolia

翻译自: https://www.sitepoint.com/php-and-the-i-1/

php++i和i++区别

最新回复(0)