Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - How can i improve

Ok, so ive been programming in Delphi for 3-4 years now and consider myself an intermediate level application designer with a sound understanding of concepts. But how do i get better? Ive just been looking at the source of a couple of components i use quite often (virtualtreeview,asynccalls) and the code in there just stumps me. Yes i can understand parts of it, but other things just go right over my head.

So where are the best resources to improve my programming abililty? Books, blogs or other sources of information?

like image 314
Simon Avatar asked Feb 16 '11 00:02

Simon


People also ask

What is Delphi development?

Delphi is a high level language supporting object-oriented design. It is a rapid application development used to develop applications ranging from database solutions to mobile applications and is used on Windows as well as Linux.

Is Delphi slow?

The Delphi environment has become extremely slow. Running in debug mode with Task Manager visible shows that it's consuming about 35% of CPU while running an already compiled program and taking a minute or more to load the main screen where it used to take about 5 - 10 seconds at the most.

What is Delphi framework?

The Delphi method is a forecasting process framework based on the results of multiple rounds of questionnaires sent to a panel of experts.


2 Answers

Programming skills are like muscles; the best way to improve them is by exercising them. If you want to learn to be a better coder, work on a harder project than you've worked on before. Come up with an idea for something you'd like to write, but don't really know how to do, and start writing. Once you run up against concepts that you don't understand, research them, and you'll end up adding new concepts and skills to your repertoire.

like image 174
Mason Wheeler Avatar answered Sep 21 '22 12:09

Mason Wheeler


Understanding code that uses concepts you're not familiar with is hard. My advice:

  • Pick one or two projects that you don't understand, and re-implement them. From your question, try writing your own tree (or list) component, and try writing a simple threading framework where you can dispatch jobs and get their work back at a certain point. These are simplified versions of the two projects you mentioned.

    As a programmer, you learn by doing. No amount of theory will make up for the experience of having tackled and solved a problem. [*]

    When you tackle both these problems, you'll encounter some of the same problems the authors of Virtual Treeview and AsyncCalls did. (If you have trouble, ask here on SO!) Not only will you learn the same things they've learned but you'll probably come back and re-read their code and understand some of the things they're doing.

    Don't be tempted by the fact you have working implementations of the concepts around (the original projects) and copy code - feel free to look at it for inspiration, but don't copy it. Write it yourself.

    Remember that both Mike Lischke and Andreas Hausladen are very smart people. Don't be disheartened if it's hard work. Many programmers go their entire careers just being competent (as it sounds you are) without pushing themselves to try or learn something harder (so if you don't mind me saying so, good for you for asking the question!)

A couple of other ideas:

  • Learn another language. Delphi's great, but you 'think' in a language, and so if you learn another language well you will be exposed to other concepts or ways of thinking, or different ways of doing the same thing. This really opens your mind.

    For example, C++ is great for use of RAII, template metaprogramming (this is more powerful than what Delphi's templates allow), some quite amazing things in the various extra libraries such as boost, and shooting yourself in the foot :) A functional language will completely change how you think (and I have to admit to being a bit hypocritical here: I've been exposed to them but don't 'know' any myself. I want to.) Objective C might be good for a different take on what object-orientation means (it and C++ are both object-oriented C-based languages, but very different.) You get the idea.

  • For looking at those specific projects: one answer on this page advised going through it line-by-line. I find to understand code I haven't used before this can be overwhelming. I once read on an Embarcadero staff member's blog some advice to use a profiler, because it will give you a good high-level view of (a) all the classes/methods/parts of a program and (b) which are the most commonly used, and probably most essential, parts, and how it all hooks together. I can't take credit for that suggestion but I think it's good advice. I recommend using AQTime.

    It's for this reason I find answers like 'find Foo, study the source' unhelpful: you're a coder, of course you'll look at the source! How to look at the source, that's a more interesting question.

  • Finally, if you get to the point where you've been "looking at the source of a couple of [projects] and the code in there just stumps [you]" or if you do some of the above and don't understand something, ask here on SO!

[*] Footnote: I'm not advocating not knowing the underlying theory, just that there's a knowledge / confidence you get by doing something yourself that's essential.

like image 27
David Avatar answered Sep 24 '22 12:09

David