Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Dragon, do yourself a favor and download the trial version of Delphi, if on only for one reason. . .

 

Ok boy! I hated it since I saw it for the first time. Not only did I download for a try, but I also bought it a year ago. Its IDE didn't make me happy. It is truely a waste!

Don't judge a man by his look. Don't judge a book by its cover. :D
  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Just when I though I had nothing more to say on this thread... just this came to my mind...

 

This is a good thread to earn points on this forum :)

Nothing usefull will ever come out of this except that :)

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.
Posted

What you personally may or may not have a use for isn't really relevant - the point is that your personal feelings aside, VB was and is the most popular programming language around. And no, that isn't just for hobbyists.

 

 

Well, Ford taurus is the most popular car sold. . .

Would I buy one? no, they suck probably pissed some people off with that one :rolleyes:

 

the FACT is ( note the word fact ) there are things you could not do in vb6 that you could do in Delphi. these things were important qualities a language should have. besides the event/delegate model, the ability to declare variables of a specific class type. before you start saying 'what do you mean? we did that all the time!'

 

here is what I mean -

 

TParentClass = class(TObject)
public 
  procedure DoSomething; virtual;
end;

TChildClass = class(TParentObject)
public 
 procedure DoSomething; override;
end;

TMyClassType = class of TParentClass;

TClassProcessor = class(TObject)
private
  fProcessor: TParentClass;
public 
  procedure Run; 
  constructor Create(AClass:  TMyClassType);
end;

 

and the following constructor for TClassProcessor:

 

constructor TClassProcessor.Create(AClass:  TMyClassType);
begin
 inherited;
 fProcessor := AClass.Create;
end; 

 

and the following definition for Run:

 

procedure TClassProcessor.Run;
begin
 fProcessor.DoSomething;
end;

 

now I could write a program that does this:

 


var
  ParentProcessor, ChildProcessor :  TClassProcessor;
begin
 ParentProcessor := TClassProcessor.Create(TParentClass);
 ChildProcessor := TClassProcessor.Create(TChildClass);
 ParentProcessor.Run;
 ChildProcessor.Run;
end;

 

You may ask why this is important, I don't have time to explain, but it is. The flexibility that this gives the programmer is immense. Specifically in creating specialized thread/server classes.

 

The fact is you could not do that in VB. therefore the fact is, VB was an inferior language. And I am sorry if you are offended by that.

 

Now, with reflection as part of the .NET framework you can now do it in VB.NET, but now we are back to relevant experience of the programmer as to knowing when and how to leverage technology.

 

but I allways feel some compassion about theese [sic] kind of people with so many lack of "mind ilumination".

 

I have been careful to include specific examples of the lackings of VB and the conclusions I have drawn about VB development in general and no one has rebutted any of the items I have cited except to say that their feelings were hurt.

 

No programing language make a good developer...

agreed

 

But a good developer is the one that can make a good app with any programing language...

AS a corrollary to this argument, there are things you cannot do with VB, therefore a good programmer would not rely on it.

and by reflection: a programmer that relies on VB is not a good programmer!

Smile g-d damn it!!! I am just trying to ruffle your feathers! You act like I just told you there is no Santa Claus!!!

 

This isn't the right thread to ask your Visual Studio question in, but I've a suspicion outbursts like "learn to program!!!" directed at the countless people on this board who make a living writing VB won't do you any favours when it comes to answers.

Point well taken. . .

 

Still, my advice to new programmers is don't build a dependence on VB. Learn to program with a robust language.

 

When I say learn to program, I mean learn to program in general. Take courses that deal with technique and practices that don't teach the specifics of particular language.

 

Same thing with OS's and RDBMS. learn what an OS is in general/Learn what an RDBMS is in general, therefore you can work on any platform. Its just a matter of picking up a manual to determine how Linux manages processes or Oracle handles locks.

 

Just like figuring out how VB6 handles variables of class types is just a matter of looking in the help file. . .

 

OH NO! VB6 can't do class types!!!!

 

BTW. . . did I tell ya? VB Sucks!!!

 

so back to my original problem. . do I have to create an Add-in project???? now that would really suck!! :) Is there a visual studio forum that someone could point me to?

 

Joe Mamma . . .

 

PS Don't forget rule 62!!! you do know rule 62, dont you???

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
I am designing some aspx forms that have a common set of properties and components on them (a template for lack of a better term). I want to add my base template to the list of forms that are available when I select 'Add New Item.' In delphi this was done by saving your template to the code repository. I am sure there is a way to do this in VS, I just haven't been able to find it.
Would you not do this using inheritance?

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

  • Administrators
Posted (edited)

Delphi may or may not have been a better language - never used delphi myself but I have heard good things about it.

However many people have made software in VB6 that has been a sucess (both in terms of functionality and comercially i.e. the developers made a living from the software). I am not saying this isn't true of Delphi just that it happened to VB developers.

I myself have met many talented and intellegent VB developers who most certainly did understand how to program, the benefits of a good design and OO principles - these are not skill exclusive to Delphi programmers.

 

I do feel however that you attitude has definately been perceived as arrogant and abrasive without any provacation whatsoever. As Divil pointed out before you seem to be intent on insulting the majority of board members in a short a period of time as possible and as such have hardly earned the respect of the community here. This attitude along with inaccutate comments about languages and then tagging requests for help at the end of a long unrelated thread is probably not going to get you the answers you seek....

 

However in a show of goodwill have you looked here in this forum's code library for an example of how to use aspx pages and templates?

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • *Gurus*
Posted
Still, my advice to new programmers is don't build a dependence on VB. Learn to program with a robust language.

 

I absolutely agree. The same goes for any language, not just VB. God forbid a new programmer builds a dependence on Pascal syntax and Delphi objects rather than learning language-neutral programming concepts.

 

You seem to be arguing against a point I never made. So far I have only taken issue with your generalisations about "vb programmers" and their skills. You throw out comments like "VB'ers need not apply", "A VBer only knows how to enable and disable menu items" and "learn to program!!!". You have yet to clarify what makes a "VB'er", but if you're talking about a programmer who knows VB (as would be the logical assumption) then your statements are wildly inaccurate.

 

I'm sure I don't need to remind anyone here that the most pointless arguments of all are the "my language is better than yours" arguments. They further nobody. Remember that how useful a language is goes beyond what features it does or doesn't have, to how appropriate it is for development in the workplace (the same applies for hobbyists only less so).

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted
However in a show of goodwill have you looked here in this forum's code library for an example of how to use aspx pages and templates?

 

Thanks, haven't looked at it, but from looking at the topic text, I think thats it!!!

 

joe- ma-mooie

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
However in a show of goodwill have you looked here in this forum's code library for an example of how to use aspx pages and templates?

 

 

hrmmmm. . . thats close,

only that leaves the templated objects only visible at browse time.

 

I will post to that forum and see if he has any ideas, thanks.

 

joe

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

Ok, Joe Mamma. Stop blaming vb. If you still think that delphi is better, then **Prove it**, writing the most advance delphi code, and post it here, right here. Please write a complete thing, not a function, not a few lines of code, not a feature, not a junk, or whatever. In addition, post a note when you start wring the code, in order to compare the time consuming of delphi.

 

Let's see if vb developers can write better that or not.

Don't judge a man by his look. Don't judge a book by its cover. :D
  • *Experts*
Posted

Visual Basic can produce powerful, excellent code, or it can produce crap. It's the programmer, not the language, that determines the quality of the final product. Making wide generalizations and biases against Visual Basic programmers will do nothing but aggrivate people. Some of the best programmers I know are Visual Basic programmers.

 

I think this thread is getting dangerous... :)
I agree, and I will be keeping an eye on the thread.
Posted

Time to get in my $.02. I'm just now moving from VB6 to VB.Net. I won't get on about Delphi because I know less than nothing on the subject. But, VB I can comment on. If you want to diss the most popular programming language for the Windows OS, go right ahead. Also, I wouldn't say that VB lacks as much as it does.

 

While it is true that VB.Net does lack in comparison to C# in certain areas, it doesn't mean that the entire language and all the people that code and use it should be sentenced to death... VB.Net, and its predecessors (VB and Basic) are the way they are because of what Basic was intended for. It was to be a language for beginners to programming to work with.

 

Now, that has evolved. If you write anything more complex than Hello World! in VB.Net, you will soon realize that it's more than just a newbie programmers language. It has evolved, as have the technology, to let computer programmers accomplish what they need to do with tools provided.

Posted
Ok, Joe Mamma. Stop blaming vb. If you still think that delphi is better, then **Prove it**, writing the most advance delphi code, and post it here, right here. Please write a complete thing, not a function, not a few lines of code, not a feature, not a junk, or whatever. In addition, post a note when you start wring the code, in order to compare the time consuming of delphi.

 

Let's see if vb developers can write better that or not.

 

 

I already did, a few times

 

the key one is class types

 

You CANNOT do that in VB6, you can in VB.NET using Type reflection

 

Class Variables are not a feature but a standard quality of a 4GL.

Their use is critical in creating class factories (not COM Class factories, though they could be used in COM creation)

 

But you asked so here we go. . . Got Delphi? Compile this mo-fo :)

 

this is a trivial example of something that cant be done in VB6. read the comment in the button click event

 

Joe Mamma. . .

 

PS. I guess I was a little harsh saying 'Learn To Program!!!'

what I mean is, 'Concentrate on Learning to Program not Learning a Language.'

 

Lexicon, not Syntax

 

 

PPS Remember Rule 62!!! It is the most important rule!!!

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

damn. . .

where is the tongue in cheek smilie???

:eek:

ja-ja-booie

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted (edited)

The zip didnt seem to attach

 

but here is a delphi example and a C# example

universalgenerator.zip

Edited by Joe Mamma

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • Leaders
Posted

An interesting example, which would indeed be cumbersome if at all possible in VB6. Far more important than the lack of a Type type/class is the lack of inheritance. Trivial is indeed the key term here, since although the structure or style of the program code may be impossible to replicate in VB, the actual functionality of it is not.

 

Furthermore, it would be interesting to view a disassembly of your Delphi program after compilation. I would expect the instancing of a genereric 'Type' class just involved the use of a lookup table to select which class to instantiate (since all calls to this member can be resolved at compile time). If this were the case, replicating the functionality would be pretty easy with an enumeration or anything which could uniquely identify each class. I'm guessing the C# example would be more complex than that with much of the inner workings hidden away within the framework.

 

How do you think VB/COM's CreateObject works? All classes implement a known interface (in this case IUnknown). Since VB does support interfaces, it would be possible to write a class factory object/function.

  • Leaders
Posted

Would this be it?

 

'*********************************
'In a module
Public Enum ProcessorType
   Processor_VB = 0
   Processor_Delphi = 1
End Enum

'*********************************
'Interface IProcessor
Public Sub Process()
End Sub

'*********************************
'Class ProcessorVB
Implements IProcessor

Private Sub IProcessor_Process()
   MsgBox "VB sucks!!"
End Sub

'*********************************
'Class ProcessorDelphi
Implements IProcessor

Private Sub IProcessor_Process()
   MsgBox "Delphi rocks!!"
End Sub

'*********************************
'Class UniversalGenerator
Friend Function Create(ProcType As ProcessorType) As IProcessor
   If (ProcType = Processor_VB) Then
       Set Create = New ProcessorVB
   ElseIf (ProcType = Processor_Delphi) Then
       Set Create = New ProcessorDelphi
   End If
   'Could also invoke the .Process method directly if needed
End Function

Posted
Would this be it?

 

'Class UniversalGenerator

Friend Function Create(ProcType As ProcessorType) As IProcessor

If (ProcType = Processor_VB) Then

Set Create = New ProcessorVB

ElseIf (ProcType = Processor_Delphi) Then

Set Create = New ProcessorDelphi

End If

'Could also invoke the .Process method directly if needed

End Function[/code]

 

 

No, that wouldnt be it.

 

You see the problem is, lets say we wanted to add a new processor that says "C# also rules", it means we would have to change the 'Create' function to handle the new enumeration.

 

Friend Function Create(ProcType As ProcessorType) As IProcessor
   If (ProcType = Processor_VB) Then
       Set Create = New ProcessorVB
   ElseIf (ProcType = Processor_Delphi) Then
       Set Create = New ProcessorDelphi
   ElseIf (ProcType = Processor_CSharp) Then
       Set Create = New ProcessorCSharp
   End If
End Function

[/code]

 

The beauty of the UniversalGenerator is it never has to be changed, it operates on the Class Type CustomProcessor and calls the constructor of what ever ProcessorType you send. ProcessorType isnt an enumeration but a Type Definition. If you look at the C#/Pas constructor of the UniversalGenerator it does no comparison of ProcessorType, it just calls ProcessorType.Create;

 

The idea is, derive from CustomProcessor and UniversalGenerator knows how to use it.

 

This is a very trivial example, but its strengths, with a little bit of creativity can be exploited to in some real neat ways. Delphi uses this to implement Typed Collections. Attached is a CSharp port of delphi's TCollection/TCollectionItem classes

 

The problem with COM Objects is that COM does not support inheritance. This was the domain driver for the .NET assemblies.

Yes you can inherit interfaces, but you can't inherit COM objects that implement them.

 

As far as seeing how Delphi implements it, that is the best thing about delphi, you get the source code. You might say 'aw but who wants to see Delphi Code?' but its not about syntax, its about lexicon. For some neat ideas, D/L the delphi package and take alook at their implementation of ADO Component wrappers for the ADO Type Library. . . hmmm. . . let me attach the port I did of ADO 2.8 and OLEDb (Delphi 7 only wrapped ADO 2.5 as that was what was available at release time)

 

Someone wondered about what the mother language of the visual studio package was -

The mother of Delphi was . . . Delphi

 

Joe Mamma

objtec.zip

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted (edited)

Delphi ADO wrappers

 

Delphi ADO 2.8 port

 

 

[edit]Removed files[/edit]

Edited by Robby

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • Leaders
Posted

Yes indeed the enumeration and the Create function need to be changed if we add a new class. Big deal. It isn't exactly a huge problem, 3 lines of code at the most. This is a small proportion compared to the amount of code which would go into writing the new class. Is it enough for someone who is confident and proficient in VB to learn a new language? Probably not. Does this make him/her a bad programmer? No. In addition, anyone who has properly planned the development of their application will know in advance all or most of the classes which will be needed within the enumeration so any modifications will be small.

 

You can take it further. Lets say you want to use template classes or template functions. As far as I know, these are not supported in Delphi. Is it worth learning C++ for this? Probably not. This is a good comparison since the code savings of templates are comparable to those you are demonstrating above with this code factory idea, perhaps even greater. You choose the right tools for the job. 99% of VB programmers do fine without template classes and without type classes. Does this make them bad programmers? No it doesn't.

Posted

yes in this over simplified application, it only entails 3 lines of code, lets take this to a reasonable extension. . . a service class with 6 (n) basic operations on the wrapped class:

 

Start, stop, pause, resume, install and uninstall. . .

 

you now have 18 (3n) changes that have to be managed.

 

bear in mind, you're example only dealt with the creation of the wrapped class, not the process itself, if the managed class were anymore complex, that complexity will be be propagated on the order of n.

 

And that is for just one class. now lets consider the effect of working in an environment with many developers. Three different developers are charged with implementing a service to be run in our 'universal server,' management of the project now becomes more involved than actual implementation. You can see why, in any situation outside the most trivial, using VB would become unwieldly.

 

And the point of the exercise was to create a universal class.

 

Reflection is a critical aspect of OOP not implemented in VB6. Yes it is implemented in vb.net, but this goes back to my orginial point, that seems to have touched a nerve, lack of experience in a paradigm.

 

As far as Template Classes, Template Classes are a neat feature of C++. The are dual to the universal class I demonstrated. In a template, you specify a type argument and act accordingly to a set of common method declarations. While delphi doesn't have template keyword, the 'class of' specification allows you to implement classes that are, for all intents and purposes, equivalent, not workarounds.

 

Now, do I need to show you what is extremely limiting in VB in that it lacked delegates?

 

In delphi, I could do the following:

 

type
  TProcedure = procedure;
  TProcedureArray = Array[1..2] of TProcedure;

procedure DoSomething;
begin
  ShowMessage('VB Sucks!');
end;

procedure DoThis;
begin
  ShowMessage('Delphi Rocks');
end;

procedure DoThat;
begin
  ShowMessage('C# Sucks!');
end;

procedure InitializeProcesses(RunDoThat: Boolean; 
Processes: TProcessArray);
begin
  Processes[1] := DoSomething;
  if RunDoThat then
    Processes[2] := DoThis
 else
    Processes[2] := DoThat
end;  

var
  MyProgram: TProcessArray;
  i: Integer;
begin
  InitializeProcesses(true, MyProgram);
  for i:= Low(MyProgram) to High(MyProgram) do
      MyProgram[i];

  InitializeProcesses(false, MyProgram);
  for i:= Low(MyProgram) to High(MyProgram) do
      MyProgram[i];
end.

 

You couldn't do that in VB. does this mean you should learn delphi? No. it just means that VB sucks. and it means that VB devotees wont know how to domething that is critical.

 

So let me ask you something. . . be objective here.

Doesn't delphi code look easy to read?

 

My examples have and will continue to ellicit responses along the lines of 'why do I have to know how to do that?'

 

Come on now. . . use your imagination!!!

Don't make me pull out my TCustomThread classes. :eek:

 

But this leads me back to my initial point, I have no need for VB programers as they, IN GENERAL, don't get it. :-\

 

Smile! Dont be so thin skinned!!! most of my language is just to ruffle your feathers!

You know, get you to think critically?

 

I mean if everyone just agreed with everyone else where would we be?

 

Joe Joe

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
No. In addition, anyone who has properly planned the development of their application will know in advance all or most of the classes which will be needed within the enumeration so any modifications will be small.

 

You hold on to this one as long as you can!

 

joe mamma. . . waxing sentimental to when I, too, was young and naive

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • *Experts*
Posted (edited)

Forgive us if we get a little irritated if you say that VB (a language that many of us spent multiple years mastering) sucks, as you so blatantly put it, but I see no reason to make such a harsh and inaccurate statement. You may not have a need for a VB program, but a VB programmer might also know other languages (as I do). Would you turn away a C++ programmer who is a Visual Basic guru as well? I know a few. A good programmer is language independant.

 

If I recall correctly, Pascal was originally designed as a teaching tool rather than a practical programming language. That would explain its (and concequently Delphi's) cleanliness and emphasis on correct programming concepts. VB was not designed as a learning tool, but rather a rapid application development tool. While I agree that a beginner should not rely on VB (or any other single language for that matter) to learn the concepts of OOP and other things, it is not a bad language. I think a true beginner should learn the concepts of OOP and programming seperately from any language. The rest is just syntax.

 

VB does have its limits and it can get messy and sometimes kludges may be necessary, but it can do almost anything you want it to do (short of low level applications such as device drivers, but you wouldn't want VB for that anyway) as long as you know how to do it.

 

I think this thread has almost run its course. If there is nothing more to be added except arbitrary snippets of code to prove how much better Delphi is than VB, I'm going to lock it.

Edited by Volte
Guest
This topic is now closed to further replies.
×
×
  • Create New...