Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: brew on May 06, 2007, 10:24 AM

Title: Booleans
Post by: brew on May 06, 2007, 10:24 AM
What's more efficient, using "If blah Then" or "If blah = True Then"?
I heard that using "If blah = true then" is better, because the processor wouldn't have to convert it to a boolean before evaluating it. Is this true? or is If Blah Then better?
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 10:47 AM
...convert it to a boolean? as long as you define it as boolean, it won't have to convert anything.
Option Explicit

Dim bolBlah as Boolean
  bolBlah = True
  If bolBlah Then MsgBox "This is efficient"

Dim bolBlah
  bolBlah = True
  if bolBlah Then MsgBox "This is just bad"

Option Explicit

Dim bolBlah as Boolean
  bolBlah = True
  If bolBlah = True Then MsgBox "This is a waste of 7 characters in your code"
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 11:39 AM
Quote from: brew on May 06, 2007, 10:24 AM
What's more efficient, using "If blah Then" or "If blah = True Then"?
I heard that using "If blah = true then" is better, because the processor wouldn't have to convert it to a boolean before evaluating it. Is this true? or is If Blah Then better?

I have to warn you though if you are using code such as:

If Not Function(x, y) Then


sometimes if the said function is located inside a non-VB dll, and it returns a bool, If Not will take a returned true value and yet think of it as false.

If Function(x, y) = False Then

works though.
Title: Re: Booleans
Post by: brew on May 06, 2007, 12:00 PM
Well reality assuming it is defined as a boolean...
You know VB does alot of things we don't know about (for example those nice bstrs)
and i heard that no matter what type it is, the expression is converted to a boolean before being evaluated. so if it's being compared to a boolean, it wouldn't need to do this. Here's my interpretation:

Dim Blah As Boolean
Blah = True

If Blah Then
[converts number to a true or a false based on value] [compares]


If Blah = True Then
[compares boolean value to constant value]

You see? I see everywhere that using "If Variable Then" is better, but how? Am I wrong about how vb6 evaluates expressions? maybe?

Edit*
Quote
I have to warn you though if you are using code such as:
Code:
If Not Function(x, y) Then
Good example. In vb a boolean is either FALSE (0) or TRUE (-1). If the dll returns a value of (1) instead of (-1), Not 1 = -2, so it would mess up, because in general anything thats not 0 is true. (even more reason to compare it to a constant boolean value)
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 12:14 PM
If Blah Then isn't an expression...

Try this: Make a form with two buttons and two lables. Buttons named cmdType1 and cmdType2. Labels named lblType1 and lblType2. Insert this code: Option Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub cmdType1_Click()
Dim Start As Long
Dim A As Boolean
Dim I As Long
    Start = GetTickCount
    For I = 0 To 999999
        A = True
        If A Then A = False
    Next I
    lblType1.Caption = GetTickCount - Start
End Sub

Private Sub cmdType2_Click()
Dim Start As Long
Dim A As Boolean
Dim I As Long
    Start = GetTickCount
    For I = 0 To 999999
        A = True
        If A = True Then A = False
    Next I
    lblType2.Caption = GetTickCount - Start
End Sub

On average, they're both similar, however, Type1 will be a little bit faster overall.
Title: Re: Booleans
Post by: brew on May 06, 2007, 12:22 PM
Quote from: RεalityRipplε on May 06, 2007, 12:14 PM
If Blah Then isn't an expression...
If Blah Then isn't an expression, "Blah" itself is.
In C++ even doing "5;" is considered a complete expression.
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 12:35 PM
In VB, True and False are constants. True = -1, False = 0, so:
This code will not work

Dim a As Integer
     a = 1
     If a = True Then
          MsgBox "A = True"
     End If

HOWEVER:

Dim a As Integer
     a = 1
     If a Then
          MsgBox "A = True"
     End If

will work.

If a Then means the same as If Not a = False then.. whereas If a = True means if a = -1. They are two different expressions.
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 12:36 PM
Expressions have to be evaluated. Blah isn't evaluated. Blah is a variable.

Quote from: l2k-Shadow on May 06, 2007, 12:35 PM
In VB, True and False are constants. True = -1, False = 0, so:
This code will not work

Dim a As Integer
     a = 1
     If a = True Then
          MsgBox "A = True"
     End If

HOWEVER:

Dim a As Integer
     a = 1
     If a Then
          MsgBox "A = True"
     End If

will work.

If a Then means the same as If Not a = False then.. whereas If a = True means if a = -1. They are two different expressions.
Which is why it's usually a good idea not to compare booleans to other variable types in vb.
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 12:47 PM
Quote from: RεalityRipplε on May 06, 2007, 12:36 PM
Expressions have to be evaluated. Blah isn't evaluated. Blah is a variable.

If you're thinking in terms of booleans only, If a Then and If a = True Then are the SAME. Which is why the assembly of the code is the same for both cases.
(http://www.instimul.com/fjaros/a%20then.PNG)


(http://www.instimul.com/fjaros/a%20true%20then.PNG)
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 12:56 PM
I wrote two quick programs and used WinDif (comes with visual studio 6). They were different...
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 01:05 PM
edit again, i split my posts

Going more in depth, using this code (so the compiler is forced to evaluate the variable, instead of just going with constants like in the previous example):

Sub Main()
Dim a As Boolean
a = s
    If a Then
        MsgBox "A Then"
    End If
End Sub

Function s() As Boolean
    s = True
End Function

(http://www.instimul.com/fjaros/a1.PNG)
We see that If a Then compares it to another variable, evaluating the expression.

Sub Main()
Dim a As Boolean
a = s
    If a = True Then
        MsgBox "A True Then"
    End If
End Sub

Function s() As Boolean
    s = True
End Function

(http://www.instimul.com/fjaros/a2.PNG)
Here we see that If a = True Then compares a to 0xFFFF which as a signed integer is -1, evaluating the expression.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 06, 2007, 01:14 PM
Checking to see if a boolean is equal to True makes you look like a big n00b. This is important. People looking at code you write may be evaluating you for a job or something. Just stick with If SomeBoolean Then.

Besides, I feel like the efficiency gained from this is very negligible.
Title: Re: Booleans
Post by: brew on May 06, 2007, 01:36 PM
Quote from: Banana fanna fo fanna on May 06, 2007, 01:14 PM
Checking to see if a boolean is equal to True makes you look like a big n00b. This is important. People looking at code you write may be evaluating you for a job or something. Just stick with If SomeBoolean Then.

Besides, I feel like the efficiency gained from this is very negligible.
It may seem noobish, but really we should be laughing at the people who think it is. In theory, comparing the value to a constant would be much more efficient then having it be evaluated first, like.... "If X then" Sure it sounds simpler, it may look easier, but is it really better? In order to check if "X" is true or false, it would have to be CBool()'d then re-evaluated before finally passing the If.
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 01:44 PM
I just proved it was better....
Title: Re: Booleans
Post by: brew on May 06, 2007, 01:59 PM
Those kinds of tests aren't always accurate. For example, my good friend Ante tried to see what kind of operation would be fastest using exactly that kind of test, and apparently division is. (my ass it is)
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 02:35 PM
Quote from: brew on May 06, 2007, 01:36 PM
Quote from: Banana fanna fo fanna on May 06, 2007, 01:14 PM
Checking to see if a boolean is equal to True makes you look like a big n00b. This is important. People looking at code you write may be evaluating you for a job or something. Just stick with If SomeBoolean Then.

Besides, I feel like the efficiency gained from this is very negligible.
It may seem noobish, but really we should be laughing at the people who think it is. In theory, comparing the value to a constant would be much more efficient then having it be evaluated first, like.... "If X then" Sure it sounds simpler, it may look easier, but is it really better? In order to check if "X" is true or false, it would have to be CBool()'d then re-evaluated before finally passing the If.

Look at my assembly screens, there is no CBooling(), it just compares it to something in both cases.
Title: Re: Booleans
Post by: tumeria on May 06, 2007, 02:51 PM
Gibbero
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 06, 2007, 03:02 PM
The point is, the compiler should be generating identical code anyway. Checking if True==True is redundant.
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 06:02 PM
If X = True Then is 7 extra characters you don't need, as I said before. " =True". Useless characters in your source code, just like comments.
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 06:04 PM
Quote from: RεalityRipplε on May 06, 2007, 06:02 PM
If X = True Then is 7 extra characters you don't need, as I said before. " =True". Useless characters in your source code, just like comments.

Comments are extremely helpful when trying to figure out someone else's code, especially if it's not coded in a shitty BASIC language.
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 09:02 PM
If you know how to use a language well enough, you should be able to find out what it does. I can read Java and C just fine, despite never taking C, and only taking a year of Java. It's not that hard.
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 09:06 PM
On the contrary try reading large source codes (30+ files), with numerous user-defined types and structs and other user-defined code calling functions accross files and such things. It does get confusing.
Title: Re: Booleans
Post by: Barabajagal on May 06, 2007, 09:15 PM
If you can't figure it out, you shouldn't mess with it. The only things that should be documented in coding are how to call subs and functions in DLLs. As the quote goes "Document my code? Why do you think they call it code?"
Title: Re: Booleans
Post by: Mystical on May 06, 2007, 10:55 PM
 I think the real question here should be; which way is the most efficient way?
I believe in my opinion, somtimes that; the shortest way isn't always the most efficient way including in/a big project(s).



there was more to my story but i decided to go do somthing else, haha! argue over it n i'll come back inawhile..
Title: Re: Booleans
Post by: l2k-Shadow on May 06, 2007, 10:58 PM
Quote from: MyStiCaL on May 06, 2007, 10:55 PM
I think the real question here should be; which way is the most efficient way?
I believe in my opinion, somtimes that; the shortest way isn't always the most efficient way including in/a big project(s).



there was more to my story but i decided to go do somthing else, haha! argue over it n i'll come back inawhile..


According to the assembly of 2 programs, each using the other way, it's shown that both ways do the same thing, so your question is already answered.
Title: Re: Booleans
Post by: Skywing on May 06, 2007, 11:41 PM
Quote from: RεalityRipplε on May 06, 2007, 09:15 PM
If you can't figure it out, you shouldn't mess with it. The only things that should be documented in coding are how to call subs and functions in DLLs. As the quote goes "Document my code? Why do you think they call it code?"

Not true at all.  Especially in large projects where you have multiple maintainers (e.g. most paid programming positions), where not everyone is familiar with all the code (or at least, not the original author, or perhaps someone has modified it since they wrote it), comments are quite important.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 12:31 AM
Any project where every developer doesn't know how it work is a poorly made project indeed. Sort of like the Windows Operating Systems... hum...
Title: Re: Booleans
Post by: warz on May 07, 2007, 01:37 AM
Quote from: RεalityRipplε on May 07, 2007, 12:31 AM
Any project where every developer doesn't know how it work is a poorly made project indeed. Sort of like the Windows Operating Systems... hum...

Another not true at all statement.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 07, 2007, 07:17 AM
Quote from: R?alityRippl? on May 07, 2007, 12:31 AM
Any project where every developer doesn't know how it work is a poorly made project indeed. Sort of like the Windows Operating Systems... hum...

You are being absolutely ridiculous.
Title: Re: Booleans
Post by: Skywing on May 07, 2007, 10:18 AM
Quote from: RεalityRipplε on May 07, 2007, 12:31 AM
Any project where every developer doesn't know how it work is a poorly made project indeed. Sort of like the Windows Operating Systems... hum...
Actually, the people behind Windows have a fairly good idea of what they're doing.  I've met more than a few of them personally, for various discussions.

Commented code takes less time to understand, and is less-prone to errors in the person trying to understand it.  Both of those are important when it comes to real-world work.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 12:53 PM
Sorry, I never have and never will see any value in comments within a program. If it's really that important, put it in a text file and give it to the people who can't figure it out on their own. I'd personally much rather discover how everything about something works than have someone tell me.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 07, 2007, 01:10 PM
Quote from: R?alityRippl? on May 07, 2007, 12:53 PM
Sorry, I never have and never will see any value in comments within a program. If it's really that important, put it in a text file and give it to the people who can't figure it out on their own. I'd personally much rather discover how everything about something works than have someone tell me.

You have no idea what is going on, do you?
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 01:52 PM
Quote from: Banana fanna fo fanna on May 07, 2007, 01:10 PM
Quote from: R?alityRippl? on May 07, 2007, 12:53 PM
Sorry, I never have and never will see any value in comments within a program. If it's really that important, put it in a text file and give it to the people who can't figure it out on their own. I'd personally much rather discover how everything about something works than have someone tell me.
You have no idea what is going on, do you?
"Wot?"
Title: Re: Booleans
Post by: tumeria on May 07, 2007, 04:44 PM
And that's the very reason why you'll never do anything more complex than a chatter bot
Title: Re: Booleans
Post by: brew on May 07, 2007, 05:52 PM
Quote from: tumeria on May 07, 2007, 04:44 PM
And that's the very reason why you'll never do anything more complex than a chatter bot
Because he doesn't use comments? I don't either.
I'm sorry, I thought making a chatter bot acually required a bit more work then you thought. Especially considering you have to learn the entire BNCS protocol, find a way to pass the logon (especially since bnet's version verification has changed), and sending/parsing/implementing just about 150+ packets while doing all this using Windows Socket APIs.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 07, 2007, 05:54 PM
creating a chatterbot without bnls is tough; with bnls it's rather trivial. someday you will learn this the hard way.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 06:08 PM
What if you make your own logon server? ;)
Title: Re: Booleans
Post by: l2k-Shadow on May 07, 2007, 06:14 PM
Quote from: brew on May 07, 2007, 05:52 PM
Quote from: tumeria on May 07, 2007, 04:44 PM
And that's the very reason why you'll never do anything more complex than a chatter bot
Because he doesn't use comments? I don't either.
I'm sorry, I thought making a chatter bot acually required a bit more work then you thought. Especially considering you have to learn the entire BNCS protocol, find a way to pass the logon (especially since bnet's version verification has changed), and sending/parsing/implementing just about 150+ packets while doing all this using Windows Socket APIs.

bnetdocs, winsock control (assuming VB use), BNLS/BNCSUtil. all you need to know is how to use them.
Title: Re: Booleans
Post by: Warrior on May 07, 2007, 06:51 PM
Are you seriously saying you don't see the point in comments?

So you know every algorithm for every possible programming situation? You need to comment things like that.

What if you havn't touched that peice of code in years? (As is common in complex programming projects) What then? I guess you'll be in for a long night of guess work if you have no comments.

I now hold you in the same position I hold brew in when it comes to programming (Not good).
I think you seriously rethink your position.

Anyone who agrees with Reality is wrong and a horrible programmer. End of story.
Title: Re: Booleans
Post by: Mystical on May 07, 2007, 06:52 PM
Try write local hashing with out using a library that someone else wrote ie; bncsutil.dll ect.. then you can say writting a bot is some work.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 07:11 PM
I don't really give a shit what you think of my abilities. I know what I'm capable of, and I know my own memory well enough to know I can remember programs I wrote when I was 8 on a C128 in BASIC 7.2.
Title: Re: Booleans
Post by: Warrior on May 07, 2007, 07:31 PM
Quote from: RεalityRipplε on May 07, 2007, 07:11 PM
I don't really give a shit what you think of my abilities. I know what I'm capable of, and I know my own memory well enough to know I can remember programs I wrote when I was 8 on a C128 in BASIC 7.2.

That's cool, no one cares what you did with a shitty language at 8 years old. You say it every other post, it's impressive for an 8 year old ok. There you happy?

That still doesn't change the fact that you lack an understanding of something as fundemental to programming as commenting code.
Title: Re: Booleans
Post by: tumeria on May 07, 2007, 07:39 PM
Obviously fancies himself to be a good programmer, and even got some expensive pieces of paper with type on it reaffirming it.


Really too bad you won't get anywhere by having memorised the Interface Coding Standards for Visual Basic 6
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 07:46 PM
It's not fundamental, it's a waste of storage space. And those interface standards are for any program you make in any language for any system. If you don't follow them, you'll confuse your users.
Title: Re: Booleans
Post by: MysT_DooM on May 07, 2007, 07:47 PM
i comment, it helps me remember
Title: Re: Booleans
Post by: Mystical on May 07, 2007, 07:49 PM
I comment everything, Sadly I even somtimes comment my txt files haha.
Title: Re: Booleans
Post by: Warrior on May 07, 2007, 08:02 PM
Quote from: RεalityRipplε on May 07, 2007, 07:46 PM
It's not fundamental, it's a waste of storage space. And those interface standards are for any program you make in any language for any system. If you don't follow them, you'll confuse your users.

You're really beyond help. You're seriously saying that you like having code a few months old thrown at you and being able to think before picking it up? With comments you know exactly whats going on, exactly what a revision is, why something was done, when it was done, by who it was done, etc..

Let's say that I reverse and port the lockdown code to C#. Now let's say I give it to you with absolutely no comments. Will you know everything that's going on?  Probably not. With comments you'll know what I was thinking when I wrote a selected peice of code. That is the advantage of comments.

You claim all this certification, professional bullshit. but the fact of the matter is that no job will think twice about hiring a programmer who can't even comment his own code.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 08:06 PM
I can, but I won't. Quite simply, I've converted thousands of lines of C# code to VB6 code without the use of comments while working on learning DirectShow when I was rewriting the core of my media player. The problem is you guys read regular words easier than you read code. If you really knew the languages, the code itself would be much more helpful to you than any comments would. Who gives a flying fuck who wrote it when? All that matters is what it's doing now, how to use it, and if and how it needs to be fixed.
Title: Re: Booleans
Post by: Explicit on May 07, 2007, 08:35 PM
Quote from: RεalityRipplε on May 07, 2007, 08:06 PM
I can, but I won't. Quite simply, I've converted thousands of lines of C# code to VB6 code without the use of comments while working on learning DirectShow when I was rewriting the core of my media player. The problem is you guys read regular words easier than you read code. If you really knew the languages, the code itself would be much more helpful to you than any comments would. Who gives a flying fuck who wrote it when? All that matters is what it's doing now, how to use it, and if and how it needs to be fixed.

It's mainly the fact that commenting code is practically an essential in the field, especially on collaborative projects.
Title: Re: Booleans
Post by: Warrior on May 07, 2007, 08:54 PM
Quote from: RεalityRipplε on May 07, 2007, 08:06 PM
I can, but I won't. Quite simply, I've converted thousands of lines of C# code to VB6 code without the use of comments while working on learning DirectShow when I was rewriting the core of my media player. The problem is you guys read regular words easier than you read code. If you really knew the languages, the code itself would be much more helpful to you than any comments would. Who gives a flying fuck who wrote it when? All that matters is what it's doing now, how to use it, and if and how it needs to be fixed.

It's not about a literal word by word translation of what the code does to english. It's more telling you why you did something, or explaining a complex algorithm. It saves time. That's the purpose of comments.

I'm fairly sure that you're only this cocky because you're used to the VB near-english like syntax. It's starting to roast your mind.

I also don't need "if you really knew the language you'd be able to blahblahblah" coming from someone who thinks a "VB Certification" is a key achievement in programming. What a joke.

Commenting is about thinking of people other than yourself when you write things, what if you share the code with someone? Do you expect them to immediately be able to pick up where you left off without atleast minor comments? We're humans man.

If you're too blind to see this than you seriously need to step back from the PC, take a deep breath, and come back with some common sense.
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 11:26 PM
absolutely nobody has common sense, that's why programming languages are overly complex and stupid. Hence joke languages that poke at the idiocy of most other languages, such as INTERCAL (http://en.wikipedia.org/wiki/INTERCAL). I'm not cocky, I just put logic over humanity's idiocy. BASIC started out as an educational language that was easy to learn, easy to understand, and easy to use. It was also just as functional as any other language out at the time. Suddenly, someone with some common sense thought "hey, why not step it up to everyday use?".  I said before, I can read C, C++, C# and Java just as well as I can read any of the BASIC series languages. I can only write in Java though. You guys have more skill than me in those areas, and you can't even read it as well as I can? COME ON.
Title: Re: Booleans
Post by: warz on May 07, 2007, 11:48 PM
I think the original point has been missed, here.

Quote from: RεalityRipplε on May 06, 2007, 06:02 PMIf X = True Then is 7 extra characters you don't need, as I said before. " =True". Useless characters in your source code, just like comments.

Sadly, if you view a program in a disassembler, you will not be presented with visual basic code, and you will not see certain phrases such as "if this = that then do this." When you call something like that a 'useless' thing to do, it's like telling somebody that their opinion, or method of doing something isn't correct. When compiled, things will be optimized, and the difference between "if this then," and "if this = true then" will most likely be little to none. Comments are ignored completely, as it is anyways. You could have 50 lines of comments, and the application size wouldn't be any larger. It all comes down to whatever the person writing the code, or comments, feels like is the most understandable to himself. These features are available so that if somebody does need to write a quick thought down, or explain an algorithm, or make some notes so that they know where they left off the night before, then they can do it. It's sort of dumb to argue against comments, when all they do is help. It's also dumb to convince realityripple to use comments, because chances are nobody wants to try to figure out his visual basic media player code anyways. :P

Personally, I don't comment my code unless I'm leaving off somewhere real late at night, and am in the middle of something that I'd like to be able to pick back up on quickly, without having to rethink the entire thing again. With that said, I also haven't worked on many projects with multiple programmers. I do support commenting code that is being worked on by a group of people, or code that's intended to be shared.

edit: well, i guess comments could be included in asm output files if you choose. :p
Title: Re: Booleans
Post by: Barabajagal on May 07, 2007, 11:56 PM
Apparently you didn't read my post correctly. I said useless characters in your source code, not your compiled EXE. I'm not stupid, no matter what you guys may think.
Title: Re: Booleans
Post by: FrOzeN on May 08, 2007, 02:41 AM
Quote from: RεalityRipplε on May 07, 2007, 11:56 PMI'm not stupid, no matter what you guys may think.
Agreed. Mentally challenged with certain issues is a much more appropriate title to describe you.
Title: Re: Booleans
Post by: Warrior on May 08, 2007, 05:29 AM
Quote from: RεalityRipplε on May 07, 2007, 11:26 PM
absolutely nobody has common sense, that's why programming languages are overly complex and stupid. Hence joke languages that poke at the idiocy of most other languages, such as INTERCAL (http://en.wikipedia.org/wiki/INTERCAL). I'm not cocky, I just put logic over humanity's idiocy. BASIC started out as an educational language that was easy to learn, easy to understand, and easy to use. It was also just as functional as any other language out at the time. Suddenly, someone with some common sense thought "hey, why not step it up to everyday use?".  I said before, I can read C, C++, C# and Java just as well as I can read any of the BASIC series languages. I can only write in Java though. You guys have more skill than me in those areas, and you can't even read it as well as I can? COME ON.

It's that sense of "I know everything better than everyone else" that will get you nowhere. Absolutely nowhere.
Commenting is the difference between getting paid the big bucks, and writting a Battle.net bot.
Title: Re: Booleans
Post by: Barabajagal on May 08, 2007, 09:35 AM
Quote from: Warrior on May 08, 2007, 05:29 AM
Quote from: RεalityRipplε on May 07, 2007, 11:26 PM
absolutely nobody has common sense, that's why programming languages are overly complex and stupid. Hence joke languages that poke at the idiocy of most other languages, such as INTERCAL (http://en.wikipedia.org/wiki/INTERCAL). I'm not cocky, I just put logic over humanity's idiocy. BASIC started out as an educational language that was easy to learn, easy to understand, and easy to use. It was also just as functional as any other language out at the time. Suddenly, someone with some common sense thought "hey, why not step it up to everyday use?".  I said before, I can read C, C++, C# and Java just as well as I can read any of the BASIC series languages. I can only write in Java though. You guys have more skill than me in those areas, and you can't even read it as well as I can? COME ON.

It's that sense of "I know everything better than everyone else" that will get you nowhere. Absolutely nowhere.
Commenting is the difference between getting paid the big bucks, and writting a Battle.net bot.

I just said you guys know those languages better than I do, how is that I know everything better than everyone else? I don't give a damn about money. I hate the ideas of money, capitalism, and copyrights. I write software because it needs to be written, either for myself or others, or in most cases both. I write what I want, when I want, and I wouldn't trade that for anything.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 08, 2007, 11:29 AM
RR, how old are you...12?
Title: Re: Booleans
Post by: Barabajagal on May 08, 2007, 11:40 AM
View my profile...?
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 08, 2007, 12:53 PM
I don't believe that you and I are the same age, which is why I ask.
Title: Re: Booleans
Post by: Barabajagal on May 08, 2007, 01:05 PM
According to your profile, you're 4.
Title: Re: Booleans
Post by: brew on May 08, 2007, 03:16 PM
Quote from: RεalityRipplε on May 08, 2007, 01:05 PM
According to your profile, you're 4.
gg
Title: Re: Booleans
Post by: Warrior on May 08, 2007, 05:13 PM
Quote from: RεalityRipplε on May 08, 2007, 09:35 AM
I just said you guys know those languages better than I do, how is that I know everything better than everyone else?

What about:
Quote from: RεalityRipplε on May 08, 2007, 09:35 AM
You guys have more skill than me in those areas, and you can't even read it as well as I can? COME ON.

Suddenly, you're better than most programmers because you don't need comments to understand complex pieces of code and algorithms.

Excuse me if I don't jump to believe you.
Bullshit.
Title: Re: Booleans
Post by: Barabajagal on May 08, 2007, 05:25 PM
Ok, now I'm gonna say I'm better than you because apparently you don't know the English language very well. The question mark takes on the meaning "Are you serious?" as in "you have more skill, so logically you should be able to read it better. You seriously can't?" It's inconceivable that I'd be able to read a language better than someone who can write it.
Title: Re: Booleans
Post by: Warrior on May 08, 2007, 05:43 PM
Quote from: RεalityRipplε on May 08, 2007, 05:25 PM
Ok, now I'm gonna say I'm better than you because apparently you don't know the English language very well. The question mark takes on the meaning "Are you serious?" as in "you have more skill, so logically you should be able to read it better. You seriously can't?" It's inconceivable that I'd be able to read a language better than someone who can write it.

You're obviously asserting that you are, because I don't claim to be able to read code without comments.

Either way, you're still wrong. In fact you're so wrong I went out of my way to do this:

WRONG.
Title: Re: Booleans
Post by: Newby on May 08, 2007, 10:10 PM
i like buffalo wings covered in brew's blood.
Title: Re: Booleans
Post by: tumeria on May 08, 2007, 10:23 PM
grotty...
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 12:04 AM
You can't read code without comments...? That's sad. Maybe it's because I have no social, emotional, or love life, or maybe it's because I care more about computers than anything save music, but I can read code just fine without comments, and I expect no less from others. It's just like another Spoken language, except it's more efficient, can't be misinterpreted, and gets things done. And C's a lot like Latin... you learn to read it, and you can get the idea of pretty much every romance language, or in C's case, C++, C#, Java, etc...
Title: Re: Booleans
Post by: Mystical on May 09, 2007, 12:08 AM
someone get him out side and away from his computer.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 12:26 AM
http://maps.google.com/ <-- Search for RealityRipple. I've got plenty of outside. It's just nowhere near people :) . (note that the maps are about a mile off eastwards).
Title: Re: Booleans
Post by: l2k-Shadow on May 09, 2007, 12:34 AM
Quote from: RεalityRipplε on May 09, 2007, 12:26 AM
http://maps.google.com/ <-- Search for RealityRipple. I've got plenty of outside. It's just nowhere near people :) . (note that the maps are about a mile off eastwards).

you live in a forest/cave?interesting,  is a tree your monitor, a rock your modem, and a hampster in a wheel your power supply?
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 12:43 AM
I live on the side of a mountain in an oak forest. My monitor is an Acer (17 inch flatscreen LCD), my modem is a WildBlue Satellite modem (don't get satellite, it sucks!), and my power supply is this really nice 520 watt one with 3 fans, a speed control, blue lights, and green cables... All powered by solar panels ;)
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 12:59 AM
RealityRipple, until you actually master LISP, you aren't the hot shit that you think you are. We'll accept Haskell and Prolog as well.
Title: Re: Booleans
Post by: warz on May 09, 2007, 01:02 AM
you called me
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:04 AM
wtf... you're the one that just called me?

Edit: if anyone else tries to fucking call me, i'm unplugging my phone line.
Title: Re: Booleans
Post by: warz on May 09, 2007, 01:06 AM
uh, no?
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:08 AM
Quote from: Banana fanna fo fanna on May 09, 2007, 12:59 AM
RealityRipple, until you actually master LISP, you aren't the hot shit that you think you are. We'll accept Haskell and Prolog as well.
Lisp was written by an idiot who thought he was on the edge of Artificial Intelligence back in the late 50's early 60's.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 01:14 AM
Quote from: R?alityRippl? on May 09, 2007, 01:08 AM
Quote from: Banana fanna fo fanna on May 09, 2007, 12:59 AM
RealityRipple, until you actually master LISP, you aren't the hot shit that you think you are. We'll accept Haskell and Prolog as well.
Lisp was written by an idiot who thought he was on the edge of Artificial Intelligence back in the late 50's early 60's.

HAH. Quick question...what's a lambda?
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:15 AM
Greek letter?

Edit: Λ <- that Greek letter.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 01:17 AM
Hmm, you are pretty dumb. You going to school?
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:18 AM
Λ is lambda... how is that dumb? And no, standardized education is a failure.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 01:20 AM
"OH GOD LOOK AT HOW NONCONFORMIST I AM"

Douches like you wear black nailpolish and act like you're the smartest shit on the planet. How about I throw on my popped polo and CALL YOU OUT on having an inflated ego with no skill to back it up.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:25 AM
I don't have an ego, I just have no respect for the human race as a whole, or in parts (including myself). What the hell does conforming have to do with anything? I aced every test in high school and ended up with a GPA of 0.4 because I never did homework. I tested out in 10th grade because I was sick of their incompetence. The US's school system is one of the worst in the world (I think it's the worst of first world countries, but I forget), and I sort of wish I had been born in Japan (except for the whole population density thing).
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 01:40 AM
"I don't have an ego" => "Sick of their incompetence"? I hated public school just as much as the next guy, but I didn't have to be a raging douche about it. Just because someone's way of thinking doesn't fit your own doesn't mean that he or she is incompetent. I'd take it a step further and say that being "sick of their incompetence" is merely a cop-out for not being able to cope with a certain situation and trying to justify one's situation rather than trying to fix it.

And your attitude to what seems to be your chosen niche (computer science) is absolutely ridiculous. There's a guy I know who calls himself the "music guy." He listens to everything, goes to every local and national act that comes through town, and started a band, goes "on tour," and has a producer. And guess what? HE SUCKS. He's all about being the image of a "music guy" rather than being a real musician.

Just as you are being in this situation. You're the "code poet:" you don't need no stinkin' comments to explain to you what's going on in any given piece of code. You're a natural; you know everything...except that you demonstrate a complete lack of true knowledge of computer science (complete lack of any clue whatsoever regarding LISP and lambda calculus, arguably the foundation of CS), lack of true knowledge about software engineering (comments!?!?!?), and the industry (they're stupid if they don't hire me!!!!!!). In essence, you are rocking the 0.4 GPA and bragging on online forums for no other reason than image, which is kind of ironic. At least my friend could use his music image to talk to girls.

Feel free to call me out on any of this. I'll gladly back it up.

Oh, and Arcade Fire sucks.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 01:51 AM
You said "A" lambda, as in a single noun called lambda. I tried to help the school. I corrected teachers whenever they made mistakes, I helped them upgrade their computers, their network, and their security (unfortunately, they then brought in some idiot who went on a web-blocking rampage, blocking sites like BBC's news site on the grounds of "entertainment"). Code poet's a long story involving the word Universe (uni-verse, one verse, one line, line of code, "On Error Resume Next", code poetry... the story behind it's a bit funnier, but I'm not gonna go into detail). I never said the industry was stupid for not hiring me, I said the industry was stupid because it was based on the very things it's now fighting against (freeware, no copyrights, etc. Get yourself a copy of a great book called What the Doormouse Said (http://www.amazon.com/What-Dormouse-Said-Counterculture-Personal/dp/0143036769/ref=pd_bbs_1/002-5065346-2421612?ie=UTF8&s=books&qid=1178693341&sr=8-1)). I'm not bragging, and I don't care about my image or girls (would someone please explain the whole deal behind the apparent importance sex bullshit?). As for your music tastes, I could not care less.
Title: Re: Booleans
Post by: MyndFyre on May 09, 2007, 02:49 AM
Just out of my own personal curiousity, if you have such a disdain for other people such that you seek relative solitude, why do you seek to differentiate yourself among other "virtual" people on an online message board?

Oh, and we like commented code at work so that we don't need to spend time (which costs money) deciphering what code does.

@Banana: come on.  There are applications in which it's appropriate.  But often not, too.  I thought that this section (http://en.wikipedia.org/wiki/Functional_programming#Coding_styles) on Wikipedia was particularly interesting: "...functional programs tend to emphasize the composition and arrangement of functions, often without specifying explicit steps."  The sad fact is, we don't typically think of how to solve a problem by the way the problem is composed.  We think in steps.  My second class was "Data Structures and Algorithms."

The example is interesting too:

# imperative style
target = []               # create empty list
for item in source_list:  # iterate over each thing in source
    trans1 = G(item)      # transform the item with the G() function
    trans2 = F(trans1)    # second transform with the F() function
    target.append(trans2) # add transformed item to target

# functional style
def compose2(F, G):       # FP-oriented languages often have standard compose()
    def C(item):          # here we create utility-function for composition
        return F(G(item))
    return C
target = map(compose2(F,G), source_list)

I noticed the "we create a utility function" comment.  Then I looked - C isn't going to be usable elsewhere because it's dependent on the closure of F and G.  Realistically it's no more useful than an imperative program, since it relies on F and G being defined outside the function anyway. 

I've not yet seen a good argument or example of a large-scale application being developed exclusively in a strictly functional paradigm.  And until it asserts itself as something viable for these applications, I don't expect that I'll be using them as the yardstick by which to measure someone's "hot shit" quotient.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 02:56 AM
In all honesty, I don't know why i've been ranting for so long. Just trash all my posts.
Title: Re: Booleans
Post by: warz on May 09, 2007, 02:57 AM
Quote from: Banana fanna fo fanna on May 09, 2007, 01:40 AM
"I don't have an ego" => "Sick of their incompetence"? I hated public school just as much as the next guy, but I didn't have to be a raging douche about it. Just because someone's way of thinking doesn't fit your own doesn't mean that he or she is incompetent. I'd take it a step further and say that being "sick of their incompetence" is merely a cop-out for not being able to cope with a certain situation and trying to justify one's situation rather than trying to fix it.

And your attitude to what seems to be your chosen niche (computer science) is absolutely ridiculous. There's a guy I know who calls himself the "music guy." He listens to everything, goes to every local and national act that comes through town, and started a band, goes "on tour," and has a producer. And guess what? HE SUCKS. He's all about being the image of a "music guy" rather than being a real musician.

Just as you are being in this situation. You're the "code poet:" you don't need no stinkin' comments to explain to you what's going on in any given piece of code. You're a natural; you know everything...except that you demonstrate a complete lack of true knowledge of computer science (complete lack of any clue whatsoever regarding LISP and lambda calculus, arguably the foundation of CS), lack of true knowledge about software engineering (comments!?!?!?), and the industry (they're stupid if they don't hire me!!!!!!). In essence, you are rocking the 0.4 GPA and bragging on online forums for no other reason than image, which is kind of ironic. At least my friend could use his music image to talk to girls.

Feel free to call me out on any of this. I'll gladly back it up.

Oh, and Arcade Fire sucks.

if i were going to reply, this is exactly what i'd say. if there were a karma system on this forum, if give you +100.
Title: Re: Booleans
Post by: Warrior on May 09, 2007, 04:29 AM
a lambada is that thing from Halflife. k

also wtf I just read all of realityripple's posts, you need some prozac man.
Title: Re: Booleans
Post by: Banana fanna fo fanna on May 09, 2007, 11:39 AM
Quote from: MyndFyre[vL] on May 09, 2007, 02:49 AM
@Banana: come on.  There are applications in which it's appropriate.  But often not, too.  I thought that this section (http://en.wikipedia.org/wiki/Functional_programming#Coding_styles) on Wikipedia was particularly interesting: "...functional programs tend to emphasize the composition and arrangement of functions, often without specifying explicit steps."  The sad fact is, we don't typically think of how to solve a problem by the way the problem is composed.  We think in steps.  My second class was "Data Structures and Algorithms."

The example is interesting too:

# imperative style
target = []               # create empty list
for item in source_list:  # iterate over each thing in source
    trans1 = G(item)      # transform the item with the G() function
    trans2 = F(trans1)    # second transform with the F() function
    target.append(trans2) # add transformed item to target

# functional style
def compose2(F, G):       # FP-oriented languages often have standard compose()
    def C(item):          # here we create utility-function for composition
        return F(G(item))
    return C
target = map(compose2(F,G), source_list)

I noticed the "we create a utility function" comment.  Then I looked - C isn't going to be usable elsewhere because it's dependent on the closure of F and G.  Realistically it's no more useful than an imperative program, since it relies on F and G being defined outside the function anyway. 

I've not yet seen a good argument or example of a large-scale application being developed exclusively in a strictly functional paradigm.  And until it asserts itself as something viable for these applications, I don't expect that I'll be using them as the yardstick by which to measure someone's "hot shit" quotient.

Absolutely agreed. I'm not a functional programming nazi. Lambda calculus is one model of computer science that seems to fit a large set of problems. I was merely setting a little trap for him to expose the small knowledge to ego ratio that he has. Admit it: whether you like LISP or not, McCarthy wasn't an "idiot."

And please don't trash his posts, they're hilarious. In fact, all online flame wars are hilarious.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 12:23 PM
He spent his entire life trying to write artificial intelligence on a computer with a processor that ran under 1 megahertz, and he actually believed he was on the edge of it. He was an idiot.
Title: Re: Booleans
Post by: MyndFyre on May 09, 2007, 12:32 PM
Quote from: RεalityRipplε on May 09, 2007, 12:23 PM
He spent his entire life trying to write artificial intelligence on a computer with a processor that ran under 1 megahert, and he actually believed he was on the edge of it. He was an idiot.
If you're going to talk about how stupid someone was, it might be good to know that Hertz (http://en.wikipedia.org/wiki/Hertz) as a measurement of frequency is not inherently singular or plural, and that "Hert" is not the appropriate way to refer to a singularize the measurement name.
Title: Re: Booleans
Post by: Barabajagal on May 09, 2007, 12:39 PM
Sorry, I woke up 20 minutes ago, and I know it's supposed to have a z... i need a new keyboard... and mouse... and maybe someday I'll upgrade my mobo and processor....
Title: Re: Booleans
Post by: Hero on May 11, 2007, 12:36 PM
Quote from: RεalityRipplε on May 09, 2007, 01:25 AM
I aced every test in high school and ended up with a GPA of 0.4 because I never did homework.
Whew, I thought my .5 was bad.
Title: Re: Booleans
Post by: Mystical on May 11, 2007, 02:53 PM
atleast you have one huh? mines 0.0
Title: Re: Booleans
Post by: brew on May 12, 2007, 10:08 PM
i can read most vb6 and C/C++ code without comments.... you don't need to be a "code poet" to do that...
comments are pretty much useless except if you're working in a joint development of a program
Title: Re: Booleans
Post by: Mystical on May 12, 2007, 10:17 PM
Your saying you'd know that, and what its purpose was instantly, if it wasn't commented?

http://forum.valhallalegends.com/index.php?topic=16684.0