Delphi?

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Delphi?

Post by Sharmz on Thu Sep 25, 2008 10:58 pm
([msg=12567]see Delphi?[/msg])

One of my friends who is an experienced programmer said that I should stop doing C and Python and switch to Delphi.
I was wondering how Delphi is and what are the advantages and disadvantages of it?
Thanks
"You must be the change you wish to see in the world."
-Mohandas Karamchand Gandhi
"Be nice to nerds. Chances are you'll end up working for one."
-Bill Gates
Sharmz
New User
New User
 
Posts: 41
Joined: Thu May 29, 2008 1:18 am
Blog: View Blog (0)


Re: Delphi?

Post by BhaaL on Fri Sep 26, 2008 8:11 am
([msg=12587]see Re: Delphi?[/msg])

C is good for low-level programming close to hardware, just not as close as ASM. Rather fast, suitable for high-performance and background/service applications that just do their work. Pretty crap with GUI, at least rather unintuitive and needlessly complex in some cases.

Python is a scripting language, thus could make tools pretty fast. Slower when it comes to larger things, but this may not matter in that case at all. No sane person would write a fully blown application in Python tho, other than tools.

Delphi is higher up on the abstraction level, you *can* do the same stuff as C, but not as easy. More suited for everyday-use applications that have graphical user interfaces and such. Probably best described as somewhere in the middle between C and Python.
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: Delphi?

Post by R_I_P1337 on Sat Sep 27, 2008 8:40 am
([msg=12635]see Re: Delphi?[/msg])

BhaaL wrote:No sane person would write a fully blown application in Python tho, other than tools.


Actually thats not true, elisa the media center, is coded in python.
R_I_P1337
New User
New User
 
Posts: 17
Joined: Thu Jun 19, 2008 2:21 pm
Blog: View Blog (0)


Re: Delphi?

Post by BhaaL on Sat Sep 27, 2008 9:01 am
([msg=12636]see Re: Delphi?[/msg])

Didnt say its impossible, just said its impractical due to performance reasons. Tbh, I cant say how much python interpreters have improved over time, so I probably shouldnt take for granted that its still that slow :P
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: Delphi?

Post by R_I_P1337 on Sat Sep 27, 2008 9:52 am
([msg=12639]see Re: Delphi?[/msg])

Now that i think about it it is quite slow :lol:
R_I_P1337
New User
New User
 
Posts: 17
Joined: Thu Jun 19, 2008 2:21 pm
Blog: View Blog (0)


Re: Delphi?

Post by cen on Mon Feb 23, 2009 12:45 am
([msg=18443]see Re: Delphi?[/msg])

I LOVE Delphi, all my programs (executables) are coded with it - The IDE is SO DAMN EASY, and especially CONFIGURABLE. It truly is awesome. But requires a learning curve. I never touched it until after college - And I DID NOT LIKE IT at first. But now I love it, it has few flaws and it's EASY to develop professional software with it.

Best of all - It compiles ALL NECESSARY libraries into the EXE, it really is awesome. The only other files I need to included with the .exe are the other external files that I create, not other DLL's and stuff like VB does all the time...

You can do virtually anything with it - It is more advanced than most people likely realize. The best resource I've located for it is Torry.net.

I HIGHLY recommend learning Delphi...

Borland has ALWAYS rocked! Their C compilers are better also.. ;)
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)


Re: Delphi?

Post by nathandelane on Thu Feb 26, 2009 10:19 am
([msg=18712]see Re: Delphi?[/msg])

BhaaL wrote:C is good for low-level programming close to hardware, just not as close as ASM. Rather fast, suitable for high-performance and background/service applications that just do their work. Pretty crap with GUI, at least rather unintuitive and needlessly complex in some cases.

Python is a scripting language, thus could make tools pretty fast. Slower when it comes to larger things, but this may not matter in that case at all. No sane person would write a fully blown application in Python tho, other than tools.

Delphi is higher up on the abstraction level, you *can* do the same stuff as C, but not as easy. More suited for everyday-use applications that have graphical user interfaces and such. Probably best described as somewhere in the middle between C and Python.


cen wrote:I LOVE Delphi, all my programs (executables) are coded with it - The IDE is SO DAMN EASY, and especially CONFIGURABLE. It truly is awesome. But requires a learning curve. I never touched it until after college - And I DID NOT LIKE IT at first. But now I love it, it has few flaws and it's EASY to develop professional software with it.

Best of all - It compiles ALL NECESSARY libraries into the EXE, it really is awesome. The only other files I need to included with the .exe are the other external files that I create, not other DLL's and stuff like VB does all the time...

You can do virtually anything with it - It is more advanced than most people likely realize. The best resource I've located for it is Torry.net.

I HIGHLY recommend learning Delphi...

Borland has ALWAYS rocked! Their C compilers
are better also..


These are some very good points.

Sharmz wrote:One of my friends who is an experienced programmer said that I should stop doing C and Python and switch to Delphi.
I was wondering how Delphi is and what are the advantages and disadvantages of it?
Thanks


I'm going to give you some advice that has done me and many others some good. That is, "don't stop programming in any particular language." The reason why is because programming is not about the language, it is about using tools to simplify tasks while using a computer. Those tasks often result in the automation of something through various levels of abstraction. The art of programming is taking an everyday task or problem and simplifying it through abstraction.

Programming languages are merely a means to an end in reality, and the more you know the better off you are. I have found that certain tasks are easier when performed using certain programming languages. So just because you start looking into Delphi, don't drop C or C++ or Python, because you will likely find a good time to use those in the future. You may even find a time to build an application that uses all three.

Delphi is part of a family of programming languages called Object Pascal. Pascal is a procedural language that is based on the [ancient (computer-wise), yet still used] programming language ALGOL. The original purpose of Pascal was to be used as an aid in teaching high-level programming to students[1] (some people think that this is why BASIC was originally programmed as well, and while some variants of BASIC may have had their roots in that cause, it was actually intended as a method to develop something much more real-world[2]).

Delphi is not dissimilar from C in that you have the ability to write functions and procedures, it is strongly typed (as in it uses types such as int, string, char, long, and double), it can be customized (like C's typedef), and it has support for loops, control structures (if..then..else), collections, and pointers. Back in the day (okay so only ten years ago) when I used Borland Turbo Pascal, I believe we could also use embedded Assembly language, like you can in C++.


cen wrote:...it has few flaws...


I don't believe this. The reason why is that Delphi is a standardized programming language that has been highly developed. It's compiler is very similar to a C++ compiler, as it must first convert, then link in order to create an executable. As a warning, thinking this way, as in "C++ is bulky", "Java has too much overhead", or "C# must be slow because it requires a runtime", is not healthy, nor is it correct. Steve McConnell, author of Code Complete, two-time winner of the Software Development Magazine Jolt Award, and Microsoft Press expert has labeled this kind of thinking as "superstitious". Being a superstitious programmer means that you spend a lot of time reinventing the wheel instead of using existing, well-tested, built in language APIs. When you do this you waste a lot of time, and worry for no reason. Cen, I'm not saying that you are a superstitious programmer, especially since I don't know the actual context of that thought, I'm just attempting to help others understand that generally thinking that a programming language is broken is not the way to become a good programmer.

I hope that we've been able to help you. As an example, I'll leave you with probably the most worthless piece of code, but in the process I hope that you will see how similar Delphi is to C and Python, and continue using both C and Python while you explore Delphi.

Delphi
Code: Select all
program Procedures;

procedure Hello;
begin
   Writeln('Hello, World');
end;

begin
   Hello;
end.

(And yes, the period after the end is required ;) )

C
Code: Select all
#include <stdio.h>

public void hello()
{
   printf("Hello, World\n");
}

main()
{
   hello();
}


Python
Code: Select all
#!/bin/python

def hello():
   print "Hello, World"
   return

hello()
Me, Nathandelane, Highly influential to Hackerdom, Premature Optimization=http://c2.com/cgi/wiki?PrematureOptimization
User avatar
nathandelane
Poster
Poster
 
Posts: 204
Joined: Thu Jun 26, 2008 11:26 am
Location: Utah
Blog: View Blog (0)


Re: Delphi?

Post by cen on Thu Feb 26, 2009 5:07 pm
([msg=18738]see Re: Delphi?[/msg])

I'm going to give you some advice that has done me and many others some good. That is, "don't stop programming in any particular language."


Ah, someone who lives by my philosophy! Actually, I think that this point of view is only natural after you've spent enough time coding... But eventually, you're likely to stick with what you know... I'll explain in a moment...

I believe we could also use embedded Assembly language, like you can in C++.


Absolutely - In fact, in my experience, there isn't anything you can do in C/C++ (or any language) that also cannot be done in Delphi. Of course, some situations are simply easier to code using a specific language, isn't that why there are SO MANY languages... ;)

Being a superstitious programmer means that you spend a lot of time reinventing the wheel instead of using existing, well-tested, built in language APIs.


I'm gonna have to say 'guilty as charged' - But this is a conscious decision. I like to *know* the details - I want to know how to build everything from scratch. It keeps me competent - And this has proven more than beneficial in my experience. But, as you have stated also, sometimes you end up 're-inventing' the wheel for no particular reason. Which is fine as a learning experience. But 'on the job' - You're WAY better off just 'putting the puzzle together and filling in the holes/resolving the bugs'. Why waste time/energy? I guarantee your boss would also agree... ;)

At the same time, this IS why so many applications these day are buggier than hell - Too much 'puzzle work' designed with too many 'hands' - Without the proper time put in to troubleshoot it properly and resolve the issues - They spend countless hours troubleshooting their own code when the issue actually lays in the libraries. Sometimes it's easier to start from scratch then debug what someone else did. I've seen this lots and it's very frustrating (for me).

Which is why, with my OWN software - I will always go the extra mile if I don't trust the library I'm using. If I feel a need to rebuild it, I will - Hell, the code IS sitting right there... So I never need to look far for an example of how it should likely be coded.

Cen, I'm not saying that you are a superstitious programmer, especially since I don't know the actual context of that thought, I'm just attempting to help others understand that generally thinking that a programming language is broken is not the way to become a good programmer.


I've refused to use many languages due to this. I won't use Java because of the way it works, and I STILL won't touch .NET for similar reasons. But I DO try to understand the language BEFORE I decide to outright ignore a language. I study the advantages and disadvantages. I ignore these two languages because in my opinion, the disadvantages out-weigh the advantages. If I remember correctly, Vista comes with .NET by default though, which will likely (at least eventually) take .NET off of my 'blacklist'. ;)

Don't get me wrong - when I said 'few flaws', I DID say this for a reason - Although I will admit, that even currently, I STILL do not know if the problem actually lays in the language. It's much more likely that the issue resolves around a package I installed into the IDE instead (and could easily be in the libraries included with Delphi) - Hell, the problems may EVEN be with Microsoft libraries that are used which are obviously included with Windows. But I HAVE seen on more than one occasion where my program ended up buggy - And it was NOT my code, I've had to modify installed packages a few times to resolve issues.

There are bugs in many programs - My experience is that when I take the time to code as much of my programs myself as possible, I end up with fewer 'unknown' issues - Usually ending up with none that I am aware of.

What MAKES Delphi such a catch in my opinion IS the packages that you can get (that and it compiles all the necessary libraries into the executable - Which is why I don't like Visual Basic/Java/.NET, etc...) I ABSOLUTELY LOVE the way that they integrate into the IDE - It makes programming a breeze. I often re-code these packages to suit my own needs. When you begin designing your own packages is when I think most people begin to realize the TRUE power of Delphi. I've never seen another language like it - Albeit, I'm using an older version of Delphi - I never updated because I was told the later versions no longer integrate the packages as well - I wanted to cry. And haven't even bothered to look at the latest releases because of this.

I know, I know... This certainly shows my 'superstitious side' :P

But hey - If it ain't broke - Why fix it? The issues I have run into have been 'mostly worked out' by now. I'm happy with the version I'm using. It allows me to design professional software and, in my opinion, I have no use for other languages due to Delphi's flexibility. Combined with a little database knowledge and PHP, I'm fully capable of designing any software I want - I basically only need three languages. Delphi, PHP, and SQL. Hell, all three languages are even cross-platform. I've been in heaven since I discovered Delphi... ;)

Keep in mind however, that nor is this a 'closed-minded fools opinion' - I've used dozens of languages. I've made this decision for a reason - I stick to these languages because they work, and until they prove otherwise (which eventually, I'm sure will happen) I'll keep using what works and what I'm best capable using.

And when I need to migrate again - Luckily, (at least in my biased opinion) because I am a competent programmer with experience with many languages, moving on isn't really that hard - A few months of study and I'll be (at least) VERY good at any language I decide to use. I've had to do this a few times before, and I seriously doubt it won't happen again... When I learned Delphi is an EXCELLENT example of this... :P

I've spent years learning/using C/VB, etc... Yet today, I'm more competent in Delphi than anything else. And I've only been using it for about 5 years. Hell, it only took a few months before it was my most productive language.
User avatar
cen
Experienced User
Experienced User
 
Posts: 77
Joined: Mon Jun 30, 2008 1:06 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests