Jump to content

edwinyzh

Members
  • Content Count

    69
  • Joined

  • Last visited

Community Reputation

20 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Same feeling here. I thought they would build something like IntraWeb or UniGUI after buying Sencha.
  2. Oops, typo, I meant Northern Ireland :P But it's still not a good comparison. OK, let's stop at this point.
  3. Sorry, posted the wrong link, it should be https://github.com/FMXExpress/swig-delphi as AlekXL has found out.
  4. Sorry, I will, and all of us should stop it. Sorry, but I couldn't resist to clarify misinformation about my beloved country in this forum which is all about my beloved Delphi (which is obvious not suitable for political topics).
  5. This is definitely off-topic, but Joseph Mitzen's reply contains a lot of inaccurate information that needs to be clarified. And a note to the administrators - if you'd delete my reply, please also delete Joseph's misinformed previous reply. After clarifying things I'll back to the topic. There is nothing in my reply were to against Joseph, he's just misinformed by the mainstream western media, just like many of my fellow Chinese people are misinformed by the local media. I'll clarify it one by one. Do you know the history of Taiwan? If you don't I'm afraid you have to read little about it before you can seriously discuss this topic. It's one part of the China, it's closer to the China mainland than Northern Ireland is to the UK. Either the Taiwan government to unify the mainland or the other way around. Just for the record - I wish there will be no war involved. I'm one of those who suffer from this evil operation by the local gov. I hate it more than you can imagine. I don't know too much about the Globalization thing, but I am honestly not sure if it's more or less moral than the wall street capital to greatly benefit from low paying workers around the world, including China Those Canadians violate local laws in here, so it's an international convention to arrest them. On the other hand, it's ironic that the Canada government arrest a Chinese industrialist because the US thinks she violated the US sanctions - not the UN's sanctions, so that they can use that to negotiate with China in the trade war. Who's holding a hostage if you read more and think carefully? I think it's much more reasonable than the US is sending young lives to kill lives and die in the Middle East for the sand (or for the oil?) It's designed to punish those who borrow other's money and intentionally not to repay, so it's a protection to innocent people. US is the key to this and history will tell. But "enslaving" is a wrong wording for China who is bringing infrastructure enhancements, instead of wars like the West has done in the pas centries, to other countries. Read the world history, note which country actually enslaving other populaces (one of the key words - indian). I hate this, on the other hand, the upside is that we innocent people is safer here. True, that's a bad thing and I wish it will not lead to very bad situation here. For other points I have no information so not commenting on them. And thanks for wasted hours of my time. Back to the topic === Now back to the topic - as opposed to hoping Delphi (only the compiler doesn't make to much sense) to be open sourced, I guess the following things will be more practical to achieve the goal of being safe just in case EMBT drop Delphi: Use only FPC-compatible language features. Pursue 3rd party library/component vendors to support FPC. TMS and Synopse (mORMot) is doing very well in this regard. Contribute to FPC to make it more compatible with Delphi.
  6. wrongly pressed Ctrl + Enter, will be posted as a new reply.
  7. There is a modified version of SWIG that includes support for Delphi & Object Pascal - https://github.com/FMXExpress/swig-delphi But I've never used it. Another excellent tool which utilize CLang to convert C (not C++) header files to Delphi: https://github.com/neslib/Chet Another tool that does source to source conversion: https://github.com/WouterVanNifterick/C-To-Delphi
  8. I'm no expert in the crypto field, how's the SynECC unit? https://github.com/synopse/mORMot/blob/master/SynEcc.pas
  9. edwinyzh

    Tool to convert form components to run-time and vice-versa

    GExperts. Once installed you'll see the Component to Code menu item when you right click on any components on a form at design time.
  10. @Stefan Glienke Even due to the lack of interface issue historically, the RTL/VCL is ok, because: It's designed by talented people so the class hierarchy is well designed, and it's well documented. We usually only use them from an external perspective and don't need to think about their internal relations. In case of designing our program, we do. We couldn't change that fact :) Interface is the BEST, but the 'composition over inheritance' approach still apply even if the language has no interface support. For example, let's say we need a class to perform FTP upload, we have two options: Inheritance - inherit from TIdFTP (in case of using Indy). Composition - create a new TFtpUpload class and use a TIdFTP object inside. With composition, the second approach, we'll gain the following benefits, as concluded by Nicolò Pignatelli: isolated, side effect free code units; injecting interfaces only as dependencies will remove every nasty side effect around the code you are working on; changing an interface implementation won’t affect other concrete classes, since they depend only on the interface abstraction; low, manageable complexity; as everything is isolated, you won’t need to worry about rippling changes; this dramatically decreases the complexity of your code; low cognitive load; with decreased complexity, your brain will be free to focus on what matters; Thank you for all the discussion, my thoughts on this issue is clearer now :)
  11. Well, maybe there is some misunderstanding here. Actually I mean 'consider', NOT 'use composition without considering inheritance' as you said. If I didn't describe it clearly, any native English speaking members here to correct me :P In other words, one should consider composition first, put composition in the first place, only if it doesn't fit, then try consider inheritance. Why so? That's the conclusion I made after I have read a bunch of articles on the topic of 'Prefer composition over inheritance', some of which I listed in my original post. Please note the word 'prefer', it doesn't mean 'conditioning yourself to use composition without considering inheritance' as you said above. And as A.M. Hoornweg above has pointed out: That's exactly what I meant in my original post: The coupling here is conceptual, not on the compiler level - the descendant class and the client knows too much methods about the base class, and that's where the unclearness begins. Finally, let me quote from the first linked article by Nicolò Pignatelli, he describes the idea of 'composition over inheritance' much better than me:
  12. Let me reiterate it - need not to say, both inheritance and composition have their own application situations, there is no doubt about it. The point is, to simply put, always consider composition first before you inheriting a class, if both can do the job, prefer composition over inheritance. That's all about the point.
  13. Hello @Uwe Raabe, Assume I've just opened the method editing window, and I want to quickly select the second parameter then make modifications. What's the fastest shortcut for it? The one I know is [Alt + M] to jump to 'Modifier', the npress [Shift + Tab] to jump back to the Parameter List, and then press Down Array to select the next parameter. I wonder if there is any faster way? Thanks.
  14. You miss the 'code reuse' part of the original question. In other words, if your purpose is code reuse, think twice before using inheritance, in most cases, maybe composition is more suitable, this may sound extreme, but just as the first linked article said, I tend to try use as less inheritance as possible. And that's the question I want to discuss with your guys here. I didn't mean never use inheritance - when your purpose is polymophism, you need inheritance. Do you know the circle-ellipse problem? That's the problem of inheritance.
×