Showing posts with label license. Show all posts
Showing posts with label license. Show all posts

Thursday, February 15, 2018

Cool features and functions in Delphi

 

List of IDE features that are cool (when they work)

  • Search backwards - Ctrl+F to do a search in your code. F3 to go to the next position Shift+F3 to go to previous position.
  • Move/Relocate/Rename project's files directly from Project Manager
  • Navigate to recently modified code - Ctrl+Shift+F7 and Ctrl+Shift+F8
  • Search for usage - Right click a variable and invoke 'search for usage'. A panel will list all places in current project where that variable is used. In my cases this will make the IDE to freeze. 
  • UML diagrams (Live Diagrams) - simply doesn't work 
  • IDE insight (F6) - It could be useful but seems to list a lot of random items.
  • CodeSite - a logging system - I couldn't really find it useful
  • AQTime - Performance profiler + memory allocation debugger - I couldn't really find it useful


List of functions/units/classes that are cool (when they work)

  • SysUtils.GetHomePath - Returns c:\users\username\appdata\roaming.
  • IOUtils - Lots of new cool functions. Totally broken.
  • SplitString - Example of usage at the end of this document. Unfortunately, the function is VERY slow!
  • FindCmdLineSwitch - Example: System.SysUtils.FindCmdLineSwitch('-f', sFileName)
  • TThread.ProcessorCount;   { Specifies the number of CPU cores in the system }
  • TBinaryReader / TBinaryWriter - Nice but only half ass - Interesting but I recommend this library which is much faster: https://stackoverflow.com/questions/5639531
  • System.Diagnostics.TStopWatch - Can be used to precisely time your code.
  • $WeakLinkRTTI - Put these two directives in your DPR file (at the very top) to reduce exe size with 4%: {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
  • TStringBuilder - It was supposed to help you build strings. But it is horrible! Simply don't use it. It is painful slow.
  • PtInCircle & PtInRect - Tells you if a point is located in a circle. Could be handy one day.
  • TTimeSpan (System unit) is a data structure used for holding information about a period of time. The smallest unit of time is a tick which is 100 nanoseconds. The largest unit of time is a day.
CONST
  • SLineBreak - global constant that changes its value depending on target platform (Win/Linux/Mac)
  • Win32MajorVersion & Win32MinorVersion - To get current Windows version


List of VCL controls that are cool (when they work)

  • TJumpList - To list a custom file in a JumpList your program must be registered (in Windows registry) to be able to open that type of file. Another problem is that when the user clicks a 'recent file' in the JumpList, the message is not sent to your app directly. You need to intercept that message.









_________________________________

function CountWords(CONST s: string): Integer; { Might be faster than the one above }
VAR
   sArray: TStringDynArray;
begin
  sArray:= System.StrUtils.SplitString(s,  '.,? =<>*!-:;()/\'+cr+lf);
  Result:= Length(sArray);
end;


Thursday, April 2, 2015

Giving up on Delphi

Some months ago I upgraded from Delphi XE to Delphi XE7. Boy! What a mistake!
As EurekaLog people put it, Delphi XE7 is a "train wreck".
Now I am on the way of contacting Embarcadero and asking for a refund.
I will keep you updated to see how it goes.



You can find the word 'refund' only once in their huge EULA document. Not a good sign.

...Other than with respect to any indemnification hereunder, Licensor’s entire liability and Licensee’s exclusive remedy under this provision will be for Licensor to use commercially reasonable efforts to remedy defects covered by this warranty and condition within a reasonable period of time or, at Licensor’s option, either to replace the defective Product or to refund the amount paid by Licensee to license the use of the Product. Licensor does not warrant or condition that the operation of the Product will be uninterrupted or error free or that all software defects can be corrected. This warranty and condition shall not apply if... 
http://edn.embarcadero.com/article/43347

Here is related discussion about the disturbing changes Embarcadero make in their license and marketing approach: http://tech.turbu-rpg.com/429/if-this-is-true


Tuesday, June 1, 2010

Delphi 2007 - (bad) Review

Delphi 2007 - Same old stuff under a new hat?


We all love Delphi. It is smart, easy to understand, really fast and user friendly.
But is the IDE the one that makes is so nice or the language?
Every time Borland released a new version forced as to go through a painful learning and re-adaptation process. But not because of the language but because of the buggy IDE.
You can't argue with me: there are HUGE lists of unresolved bugs for every possible version released.
It is the same for Delphi 2007? Let’s find out. I just installed Delphi 2007 on my computer. First time I was really glad to have it because people ware speaking nice about this new version.
After the first attempt to install it failed, I tried again and I somehow succeed.

Until now I can report more bad stuff that good ones. Anyway I am still happy that I can report also good stuff.
Compared with Delphi 2005, Delphi 2007 is a charm. Compared with Delphi 2006 it is a little bit better. Compared with Delphi 7 it is worst.

* I thought that Delphi 2007 is free of .Net. Well that was a lie. Delphi 2007 refuses to install without .Net 2.0 (and other craps like this).

* The first bug I saw few minutes after I open the IDE for the first time was the fast blinking icons in the tool bar. I had the same problem with Delphi 2005 and 2006.

* The next bug, this time a really big one was the help system which in 30% is working. Imagine yourself what is with the rest of 70%.
The help system is a disaster. It takes much more time to load than Delphi itself. If you ask help for an instruction/window on IDE it always answers: 'Error. No help found for 2029. OK | Details'.
When it does not display that stupid answer then it returns allot of garbage from MS .Net and MS API help. In most cases the right answer is not there.
For example after pressing F1 for while the cursor was on the reserved word 'Function', the help system returned (after 37 seconds!).




Conclusions?

* Sometimes the cursor has the same color as the IDE background. You can have big fun trying to figure out where is your cursor on the screen. The solution is to restart the IDE and pray to work. If not, restart again (and pray harder).

* Delphi 2007 takes a lot of time to load to memory (my system is AMD 64 x2 4.6GHz and 1GB DDR2 at 800MHz). The average amount of memory for small projects is 50-120MB. But sometimes if goes to 600-1000MB.


So you need at least 2GB or RAM to work with this version of Delphi.

* Other small problems can be observed in IDE. Many windows behave strange or you have no buttons to configure them. For example if you have error when you compile a program, the 'Messages' will pop-up at the bottom of the IDE. This is ok. Right? But after you fix the problem the window does not close itself as in Delphi 7. So every time you compile a program you need to go and manually close that window.

* The undo system is also a disaster. Sometimes is working, sometimes (most of the cases) is not. So if you made a mistake you can't undo it so you need to rewrite all that code.

I don't think that Delphi 2007 is better than Delphi 7. Actually it is a disaster. Not as big as Delphi 2005 but still a disaster. I hope that Borland (hic, CodeGear) will release a patch (or more) really soon, but until then Delphi 2007 can't be used.
I didn't post here every small bug I have found, but only the big ones. I will update this entry as I will find out more.

Now I am supposed to speak also about the good parts of Delphi 2007. Well until I will have the patch to be able to run Delphi 2007 form more than 1 hour, I will post also the nice parts of Delphi 2007, until then I will stick with Delphi 7 and with its already known bugs (and work around).

Please drop me a line if you know how to make the help system to work and how to remove the useless (MS API) results from a search.