Delphi Boot Camp Day 2 - Getting to Know the Delphi Language
This page will contain resources and the replay for day 2 (September 6th, 2016) of the Delphi Boot Camp.
- The basics of Pascal and Delphi
- The Modern Features of the Delphi language
- What makes Delphi the best programming language to use
- The elegance of Delphi
- Using the Parallel Programming Library
- Anonymous Methods
(Agenda and details subject to change)
The source code for all of the demos in the webinar day is available on GitHub, see https://github.com/marcocantu/2016DelphiLanguageBootCamp.
The slides of the presentation in PDF format are here: DelphiBootCamp2016Marco.pdf
Q: Did I understand correctly that "Unit1.Hello" is non-standard programming practice in Delphi? How much is the performance hit? Doesn't it make the code more maintainable when you add a new Unit2 to the code that also has a "Unit2.Hello" procedure?
A: Prefixing a symbol with the unit-name is redundant, and rarely done (unless there is a name clash). No compiler or runtime penalty. Names clashes are rare and suggestion is to avoid them in the first place
Q: When compiling and linking code into a self-contained single .exe file, are libraries linked including everything it contains including non-used functions or are only those functions included in the .exe that are really needed?
A: The linker is smart enough to include only units and classes actually needed. However, given the dynamic nature of the libraries code (particularly FireMonkey) you will get some extra classes in there you end up not using. There are some subtle ways to control this.
Q: Wish there is a shortcut to typing begin/end (e.g. Type /b or -b to generate Begin and /e or -e to generate End)
A: In Pro Edition and above we have "Live Templates" where you type part of a keyword or block statement and hit Control-Space. Not currently in Starter Edition. http://docwiki.embarcadero.com/RADStudio/Berlin/en/Using_Live_Templates
Q: ARM only compiler for mobile? When x86 compiler?
A: ARM compilers for iOS and Android
Q: Regarding x86 compiling: If I want to use Delphi to deploy a native Android Library (.so file), how can I produce the x86 version? You know that an Android project needs also x86 version (and arm_v8, x64, MIPS, etc...)
A: Project Hudini makes it possible to run ARM compiled code for Android on Intel Android. http://blog.marcocantu.com/blog/2015-october-running-android-intel.html
A: It's less verbose than C++ (header and implementation, in two files.) It's faster to compile. And some people find methods in line with the declaration in C# rather confusing and unclear - a matter of taste, but clarity is important in a language. The combination of language, RTL, frameworks/components and native machine-optimized code compilers (Win32, Win64, macOS, iOS, and Android with Linux Server on the roadmap) distinguishes Delphi from other programming languages.
Q: Beginner question: what is exactly the difference between pascal and Delphi? Will we go through this today?
A: Delphi is Pascal + Object Pascal + a lot of modern programming language enhancement including interfaces, components, generics, anonymous methods, operator overloading, +++++
Q: can I download this project anywhere?
Q: TDD example would also be appreciated, with attached test set.
A: Unit testing is available using DUnit/DUnitX. you should also check out TestInsight - an IDE plug-in for unit testing - https://bitbucket.org/sglienke/testinsight/wiki/Home
Q: How can I test my application for memory leaks?
A: SmartBear Software AutomatedQA does memory and bad parameter checks. there are other tools including - the memory manager used in Delphi apps and the iDE can also check for memory leaks on shutdown of the app - http://docwiki.embarcadero.com/Libraries/Seattle/en/System.ReportMemoryLeaksOnShutdown. EurekaLog - a Delphi 3rd party tool - also checks for leaks and other things.
Q: when the application is in production, are there any tools that will detect misbehavior similarly to twitters' Crashlytics?
A: We have AppAnalytics. component you add to your app - lets you get analytics on use, on unhandled exceptions, etc. - TAppAnalytics is the component - https://www.embarcadero.com/products/appanalytics
Q: How would you compare Delphi's environment with some other popular frameworks for cross-platform development (xamarin)? what are Delphi's pros and cons?
A: Native optimized code for Win32, Win64, macOS, iOS and Android. One set of source code, loads of components (both included and 3rd party), loads of tools, extensive IDE, and more.
Q: Are there any plans to provide a free Delphi Linux compiler stack to push Delphi language for open source projects ?
A: Roadmap August 2016 and Marco's recent blog post about Linux "birthday" with a short sneak peak shows that we are very interested in building support for Linux Server and Console application development. Stay tuned for additional news in the future.
Q: Is it also possible (or possible in the future) to assign a default value to a variable at declaration time?
A: you do this with a constant and a global variable. local stack variables do not have this feature.
Please login first in order for you to submit comments