Click here to Skip to main content
15,921,454 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: VB6: Best programming language ever Pin
vonb30-Mar-14 21:07
vonb30-Mar-14 21:07 
GeneralRe: VB6: Best programming language ever Pin
SortaCore31-Mar-14 0:09
SortaCore31-Mar-14 0:09 
GeneralRe: VB6: Best programming language ever Pin
Rosenne30-Mar-14 20:09
Rosenne30-Mar-14 20:09 
GeneralRe: VB6: Best programming language ever Pin
Member 472408430-Mar-14 21:19
Member 472408430-Mar-14 21:19 
GeneralRe: VB6: Best programming language ever Pin
BobJanova31-Mar-14 0:05
BobJanova31-Mar-14 0:05 
GeneralRe: VB6: Best programming language ever Pin
Member 472408431-Mar-14 0:10
Member 472408431-Mar-14 0:10 
GeneralRe: VB6: Best programming language ever Pin
ISpliter31-Mar-14 13:47
ISpliter31-Mar-14 13:47 
GeneralRe: VB6: Best programming language ever Pin
Member 472408431-Mar-14 15:18
Member 472408431-Mar-14 15:18 
I see VB6 as an intermediary language, it's not as flexible as C or C++ , but in some instances it is superior to more modern languages such as C# because it does not enforce "best practices". Case in point is the following rant.

If you implement AES in VB6, using best coding practices, such as all local variables and the like, it is something along the lines of 45-50% slower than if it was implemented in C.

If however you implemented AES using code that does not fit "best coding practices", hand coding most things rather than using managed code, or doing things such as declaring all the variables as either global or static, you will notice that the VB6 code runs considerably faster, to the tune of 5-10% slower than if it were implemented in C.

There are 2 reasons for this. 1) VB6 is not ideal for cryptographic protocols, and 2) allocation of memory and then de-allocating it after you have finished running through a sub takes time, ok sure it's only a few microseconds, but when you are running through those subs several thousand times when encrypting a large file, you will definitely notice a significant difference in speed, even when compiled. The more computationally intensive those subs are, the worse the lag becomes. Point 2 is basic comp-sci. Having variables declared globally or as a static means the memory is allocated once, and is not released until the application has finished doing what it is doing.

Two of the core requirements in any cryptographic system is speed, and having the smallest memory footprint as possible so it can be used in multiple places, such as embedded systems or even smart cards which have an absolute minimum amount of resources available to it. You can have the most secure system in the world, but if it has a large footprint, you are limiting it's use. And if it's to slow no one will use it at all. So you have to make some compromises in your code to get that speed and minimal footprint.

The prime compromise is using code that is considered bad by most application developers. Bypassing most of the managed code, and hand tuning things yourself, and using intensely small subs, the more complex the sub the slower it will run. Even something as simple as turning off intrinsic compiler based error checking will effect the speed and footprint of your code.

Of course, using techniques that are not "best practice" can lead to catastrophic failure of the program in question, or the whole system if you are using a language that is capable of such a thing such as C. That is exactly why I made the statement of "it prods developers to pay a lot more attention" knowing where exactly a variable is being used, how it is being used, and when/if it can be reused. Without that close attention to detail, you're screwed. It goes back to the days when you had maybe one compile a week, when there was no real garbage collection, and resources were at a premium, so you must ensure that your code is pretty damn near spotless, particularly if you are writing code that is going to be used on a myriad of systems, where the resources available to that system is largely unknown.

Sadly most modern languages take away from the skill of the coder, because they rely to heavily on managed code that the coder can't see. Ok sure they know use this library and this happens, but they don't know how it happens, or wether it can be tweaked to get more speed or a smaller footprint.

This is why I, and most who have dabbled in cryptography on any serious level, prefer older languages that are not so polished, it makes for not only better coders, but better developers. Don't confuse the two, they are not one and the same.

I'll use an API that is in both VB6 and VB.NET to illustrate my case. The API is called copymemory, which exists in both VB6 and .NET, and is used in completely different ways in both languages.

In VB6 it is used in the following way:

copymemory(64, var1, var2)

What this does is takes 64 bytes from var2 and puts them in var1.

It is considered unsafe coding, but is significantly faster than an assignment which you will notice if you are writing code that is being called several thousand times before the application has completed, and using copymemory in .NET can't even do the required action properly.

So to close I will reiterate my initial statement. I see VB6 as an intermediary language, it's not as flexible as C or C++ , but in some instances it is superior to more modern languages because it does not enforce "best practices".

Now you go have a look at those code examples, how much of it fits "best application code practice" I'll wager that a large portion doesn't. Comparing application coding and cryptographic coding is like comparing oranges with mandarins, the only similarity is that they are both citrus fruits.
GeneralRe: VB6: Best programming language ever Pin
Rutvik Dave30-Mar-14 21:34
professionalRutvik Dave30-Mar-14 21:34 
GeneralRe: VB6: Best programming language ever Pin
ISpliter31-Mar-14 13:36
ISpliter31-Mar-14 13:36 
GeneralRe: VB6: Best programming language ever Pin
Marc Clifton31-Mar-14 2:22
mvaMarc Clifton31-Mar-14 2:22 
GeneralRe: VB6: Best programming language ever Pin
ISpliter31-Mar-14 14:19
ISpliter31-Mar-14 14:19 
GeneralRe: VB6: Best programming language ever Pin
Marc Clifton1-Apr-14 3:06
mvaMarc Clifton1-Apr-14 3:06 
GeneralRe: VB6: Best programming language ever Pin
ISpliter1-Apr-14 6:29
ISpliter1-Apr-14 6:29 
GeneralRe: VB6: Best programming language ever Pin
ClockMeister31-Mar-14 3:41
professionalClockMeister31-Mar-14 3:41 
GeneralRe: VB6: Best programming language ever Pin
dan!sh 31-Mar-14 4:39
professional dan!sh 31-Mar-14 4:39 
GeneralRe: VB6: Best programming language ever Pin
ClockMeister31-Mar-14 6:04
professionalClockMeister31-Mar-14 6:04 
GeneralRe: VB6: Best programming language ever Pin
SeaVipe31-Mar-14 6:25
SeaVipe31-Mar-14 6:25 
GeneralRe: VB6: Best programming language ever Pin
ISpliter31-Mar-14 13:26
ISpliter31-Mar-14 13:26 
GeneralRe: VB6: Best programming language ever Pin
ISpliter31-Mar-14 13:32
ISpliter31-Mar-14 13:32 
GeneralRe: VB6: Best programming language ever Pin
ClockMeister31-Mar-14 13:42
professionalClockMeister31-Mar-14 13:42 
GeneralRe: VB6: Best programming language ever, PHP too Pin
User 483504731-Mar-14 3:49
User 483504731-Mar-14 3:49 
GeneralRe: VB6: Best programming language ever, PHP too Pin
ISpliter31-Mar-14 13:12
ISpliter31-Mar-14 13:12 
GeneralRe: VB6: Best programming language ever Pin
ikirachen31-Mar-14 6:20
ikirachen31-Mar-14 6:20 
AnswerRe: VB6: Best programming language ever Pin
MSBassSinger31-Mar-14 7:23
professionalMSBassSinger31-Mar-14 7:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.