What is the easiest/most effective way to learn Delphi?
I am totally new to programming and I开发者_如何学Python have chosen Delphi as the programming language that I would like to learn.
I basically want to build tools that will fill and submit web forms using sockets and I want them to be multi threaded as well.
I would love for them to be feature rich and perform correctly.
I am in no real rush to do this as I do understand that it takes time to become efficient at anything (especially programming). However, I do want to take the shortest path that I can in learning.
If it were possible I would love to go to school to learn the language but it seems like there are no schools in the US that teach it.
I have found quite a good bit of information on the internet that has helped me gain a basic knowledge of how things work inside the IDE and how to build basic apps but I want to be able to build really good apps that these tutorial do not teach me how to do.
So.. My question is how do I go about becoming an expert Delphi programmer without having any "Real Teacher" to guide me? How did you guys learn?
Would learning another programming language with the help of a teacher and them coming back to delphi make sense?
Former Delphi Product manager Nick Hodges created 30 video demos targeted to those new to Delphi and the object-pascal language. UPDATE 2017: That link is dead, videos can now be accessed thanks to archive.org here.
The videos take the viewer through the basics of the IDE, the language, and each demo mostly builds on the previous one in order to ultimately create a not too shabby GUI text editor.
If you are new to Delphi, this is a great place to start with the language and I’d highly recommend investing the time and watching the videos. I’ve seen them all and it helped me quite a bit.
The video demos use Delphi 2006, but these demos are entirely valid on any newer (and probably the older Delphi releases) version as well. Here are the topics covered in the videos:
NOTE: If the videos are no longer accessible on the originally hosted page, you can still obtain them from archive.org: https://web.archive.org/web/20130630143102/http://blogs.embarcadero.com/nickhodges/2006/08/15/26687
Download the ZIP file for each topic, which contains the video for that topic.
- 1 – Intro to the IDE
- 2 – Hello World
- 3 – Basic Application Development
- 4 – Language Introduction
- 5 – More Lanugage Intro
- 6 – Basic String Manipulation
- 7 – Basic Datatypes
- 8 – Sets
- 9 – Arrays
- 10 – Records
- 11 – Basic Data
- 12 – Simple Class
- 13 – Procedure and Functions
- 14 – Units
- 15 – Inheritance
- 16 – Polymorphism
- 17 – Why OOP
- 18 – Properties
- 19 – Member Visibility
- 20 – Constructors and Destructors
- 21 – TurboPad: About Box
- 22 – TurboPad: File Open
- 23 – TurboPad: File Menu
- 24 – TurboPad: Saving
- 25 – TurboPad: Edit Menu
- 26 – TurboPad: Toolbar
- 27 – TurboPad: Word Wrap and Fonts
- 28 – Live Templates
- 29 – Refactorings
- 30 – Debugger
And once you get through the videos, head over to the Delphi Basics website and bookmark it. Seriously, I still use this website about 10 times a day for reference on Delphi.
I'd also recommend reading delphi.about.com's "A Beginner's Guide to Delphi Programming", which is a nice primer to Delphi programming.
Also, IMO, for the most important (and best) resource for learning Win32 API is Mark Russinovich's Windows Operating Systems Internals Curriculum which is offered for free.
It is designed to be used by an instructor to teach students. I went through it and it is awesome. Full of examples, history, and detailed explanations. In my opinion, this is an ideal way to learn the Windows API.
Just program whatever seems fun, solve problems as they arise and eventually you'll be an expert.
There are three tips to remember.
If you encounter a problem too big to swallow in one gulp, split it into smaller problems and solve those one by one.
When in doubt, always choose the simplest solution, then upgrade as needed.
Google knows everything. If you're unsure what to look for, read the theory until you know that.
For instance, you say that you
want to build tools that will fill and submit web forms using sockets and I want them to be multi threaded as well.
Split this into smaller problems. You don't need multi-threading from the start, so set it aside. Your initial task is just to learn how to submit forms at all.
How to do that? Google around, read Wikipedia articles on HTTP and everything related until you know the basics. You don't have to understand peculiar details yet, only to get general concepts of what components are there and how are they related.
Then choose the simplest solution. You don't want to use sockets from the start. If there are ready components for sending HTTP requests, you should use them until you know how to do the same thing manually.
I am a self-taught programmer. I started programming at the age of 12, when I got my hands on Delphi 4 Personal, which was distributed in computer magazines free of charge. (Yes, this is basically why today I am a Delphi expert. In retrospect, hence, it was a very fruitful tactical decision of Borland to make a Personal edition. Surely they got a very large number of developers this way.)
I learned everything by studying examples and by trial and error. This took quite a few years, but it surely worked. Also, since Delphi is a native Win32 compiler, to master Delphi development, you need to master Win32 development. An invaluable resource then is MSDN and general Win32 programming books (such as The Old New Thing by Microsoft legend Raymond Chen). Also, don't forget there is quite a number of interesting good Delphi blogs.
Also, to push further as a programmer, you need to practice, on "hard" things.
A couple years ago I tried to learn Delphi and then gave up in frustration. I was learning on my own and had a difficult time with the incomplete docs and few current books. In hindsight, outdated books weren't as problematic as the more current books because the more current books are written for an audience that knows both Pascal and Delphi and thus leave out a lot of crucial info for the newbie. I was working on porting a VB6 project and ended up using .Net which was more familiar given my experience in VB and Java.
Just recently I had to write a quick little utility that needed some direct Win32 functionality and I thought it would be a good project for Delphi. Small, fast, Win32. I dusted off my license and started poking around again. In the intervening years I've learned a few more languages and was less stumped by the Pascal syntax than my previous attempt. In a few hours I had finished my task and I decided to try to learn a little more.
So far, I've been really impressed with the Delphi 5 Developer Guide. It has opened my eyes to the elegance of the VCL and Delphi. There are more recent versions, but I think this one is perhaps the best because it deals with a version of Delphi before the now defunct Kylix project. Books that are written for version 6 thru 2006 spend way too much time describing either Kylix or Delphi.Net, both of which are dead and useless to spend time learning. The Delphi 5 books are equally as long as later editions, but spend all of those pages on the Win32 features of the VCL and some very valuable tutorials on Pascal (which is handy for those of us that went through our school years without learning Pascal).
How do you learn any of the new stuff that has happened since Delphi 5? I think Bob Swart's short update books are probably best. You can find them here. A lot of folks like Marco Cantu's books as well, but I personally haven't found his books very useful.
Good luck! I look forward to reading more suggestions.
I basically want to build tools that will fill and submit web forms using sockets and I want them to be multi threaded as well.
If I understand what you are attempting properly...you are starting at he hard end..
I have been programming (Windows apps) in Delphi for a long time and My first attempt at a multi threaded http server conversation (using Indy) failed miserably - it did work (sort of) even at first-ish attempt but really it was miserable failure. So multi threading is "tricky" or just hard, maybe.
To fill and submit a web form - first work out how to fill in the online form itself - this will educated you about what is going on, you can do this quite reasonably with the TWebBrowser component (I've just done it). Then work out how to press the submit button on the online form. Remember you will be dealing with a process that is removed from you and that you do not have ultimate control over. Good luck (you will need perseverance too).
If you are looking to become an expert in Delphi, you will also need to become an expert in Windows...unless I misunderstand your intentions. Two great resources are:
- Windows via C/C++ by Jeffrey Richter of Wintellect
You'll have to convert samples to Delphi, but hey, that's great practice too.
- Windows Operating Systems Internals Curriculum by Mark Russinovich and Dave Solomon
As I mentioned in my other answer, check out Mark Russinovich's Windows Operating Systems Internals Curriculum which is offered for free. You will not only learn how Windows works, but it is a good "Operating Systems 101" type course.
If it were possible I would love to go to school to learn the language but it seems like there are no schools in the US that teach it.
Here is a pretty extensive list of schools that teach either ObjectPascal(Delphi) or procedural Pascal. If you are enrolled as a student somewhere you can get an academic license for Delphi XE Professional for ~$99. Keep in mind that you can't develop commercial applications with the academic license.
So.. My question is how do I go about becoming an expert Delphi programmer without having any "Real Teacher" to guide me? How did you guys learn?
Language syntax isn't terribly difficult to master, especially with the hand-holding most IDEs give you. Learning the Delphi library (RTL/VCL) will take much longer. Not that its very difficult (just the opposite). There's just so much it has to offer. I've only been using Delphi for about 5 years but I know developers who have been programming in Delphi since version 1 that are still surprised by features they just weren't aware existed.
But even learning the library isn't what sets great developers apart from the rest. Its design skills that are the hardest to master. Knowing when to use inheritance and when to use composition. Knowing when to choose polymorphism or a conditional statement. Learning design and architectural patterns and learning when they are appropriate and when they are not. Learning how to go from identifying a problem to implementing the solution. Writing code that is easy to test and easy to maintain as new requirements arise.
Some of these skills you can learn from reading books or from a mentor. Others can only be learned through experience.
I support what's been said above. Furthermore, I will say pick a non trivial project and work on it in Delphi! A tool you have wanted to have but you're yet to find something that meets your needs exactly or even even something that you already used and you want to see if you can develop something similar in Delphi. That's how I learned Delphi...(I am still learning. I started working in Delphi about 3 months ago but it's not my first language so some of the knowledge transfered. But thinking about it, I wish I had learned Delphi first!). You have also probably heard this many times but read good and well written code! Every time I learn about a new Delphi function, I try to take some time and read its implementation and I have learned couple things that way!
Delphi is great.
I learned the tools in a classroom in the US, over a three-day course. This was a huge benefit, and a big jump start.
I then came back to the office and starting writing programs that I needed, and would actually use, and continue to use for quite some time. I constantly improved the programs. It's essential to use the tools that you develop and to understand the view point of the user.
To take the next big step, and become a great programmer, it goes beyond learning the tools. You should have some formal education to learn some of the basic principals. I had this before I learned Delphi. That doesn't mean you can't self study them on your own, but you can't learn them through trial and error.
Learn about design patterns.
Consider best practices. Essentially, utilizing best practices allows you to learn from other people's mistakes instead of your own. If everybody else does something a certain way, it's because the method proved to be reliable over time.
Embrace common UI principles. If your UI acts just like everyone else's, then the user will know how to use it without reading the documentation.
Learn software development life cycles, such as the agile system development life cycle.
You should write another text editor, and use it. You should also write programs that do something that nobody has ever done before.
Write something today.
It seems not everyone can be a good programmer (see also Joel's comment) as some people seem to have lot's of trouble understanding basic concepts like pointers and recursion, which are indicators that some problem solving skills are in deficit. Maybe you're that kind of person, maybe not.
Said that, I think that you should first learn problem abstraction, programming logic, then at least learn the purpose of basic data structures (arrays, lists, dictionaries, records, classes, trees, etc) and some basic software design (MVC, maybe object oriented design concepts, etc).
Dijkstra seems to argue that is better to be able to fully understand the problem and build a solution before writing any code as, according to him, that leads to better quality software.
Get good books on programming and data structures. Taking classes is also a good idea, it doesn't matter if they're specifically for Delphi as the concepts of software design don't rely on a specific language and knowledge can be transfered from one language to the other.
Obviously you should try to put in practice what you've learnt. Practice a lot, but try to really understand what you're doing, and when thing go wrong, try to understand why.
Anyway, if what you really want is to build one application then skip all above and go the trial and error approach.
These answers are great and you probably got enough information to learn Delphi, but I would like to add some of my training solutions as well. It is aimed at the absolute beginner and builds on previous knowledge learned from the stuff.
Delphi Programming Playlist on YouTube: https://www.youtube.com/playlist?list=PLfrySFqYRf2dKxG1Xd1sJaEMtoVTeL5dw
Delphi Programming Helper App on Softpedia: http://www.softpedia.com/get/Programming/Other-Programming-Files/Delphi-Execute-Files-Helper.shtml
Delphi Programming App on Windows Store: https://www.microsoft.com/en-us/store/p/delphi-programming-helper/9mtrd2ptbvcp
I hope this helps you.
精彩评论