Valhalla Legends Forums Archive | Visual Basic Programming | Booleans

AuthorMessageTime
BreW
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?
May 6, 2007, 3:24 PM
Barabajagal
...convert it to a boolean? as long as you define it as boolean, it won't have to convert anything.
[code]Option Explicit

Dim bolBlah as Boolean
  bolBlah = True
  If bolBlah Then MsgBox "This is efficient"
[/code]
[code]Dim bolBlah
  bolBlah = True
  if bolBlah Then MsgBox "This is just bad"
[/code]
[code]Option Explicit

Dim bolBlah as Boolean
  bolBlah = True
  If bolBlah = True Then MsgBox "This is a waste of 7 characters in your code"
[/code]
May 6, 2007, 3:47 PM
l2k-Shadow
[quote author=brew link=topic=16677.msg168752#msg168752 date=1178465042]
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?
[/quote]

I have to warn you though if you are using code such as:
[code]
If Not Function(x, y) Then
[/code]

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.
[code]
If Function(x, y) = False Then
[/code]
works though.
May 6, 2007, 4:39 PM
BreW
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:
[code]
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]
[/code]
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
[/quote]
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)
May 6, 2007, 5:00 PM
Barabajagal
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: [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[/code]
On average, they're both similar, however, Type1 will be a little bit faster overall.
May 6, 2007, 5:14 PM
BreW
[quote author=RεalityRipplε link=topic=16677.msg168756#msg168756 date=1178471684]
If Blah Then isn't an expression...
[/quote]
If Blah Then isn't an expression, "Blah" itself is.
In C++ even doing "5;" is considered a complete expression.
May 6, 2007, 5:22 PM
l2k-Shadow
In VB, True and False are constants. True = -1, False = 0, so:
This code will not work
[code]
Dim a As Integer
    a = 1
    If a = True Then
          MsgBox "A = True"
    End If
[/code]
HOWEVER:
[code]
Dim a As Integer
    a = 1
    If a Then
          MsgBox "A = True"
    End If
[/code]
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.
May 6, 2007, 5:35 PM
Barabajagal
Expressions have to be evaluated. Blah isn't evaluated. Blah is a variable.

[quote author=l2k-Shadow link=topic=16677.msg168758#msg168758 date=1178472946]
In VB, True and False are constants. True = -1, False = 0, so:
This code will not work
[code]
Dim a As Integer
    a = 1
    If a = True Then
          MsgBox "A = True"
    End If
[/code]
HOWEVER:
[code]
Dim a As Integer
    a = 1
    If a Then
          MsgBox "A = True"
    End If
[/code]
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.
[/quote]
Which is why it's usually a good idea not to compare booleans to other variable types in vb.
May 6, 2007, 5:36 PM
l2k-Shadow
[quote author=RεalityRipplε link=topic=16677.msg168759#msg168759 date=1178472981]
Expressions have to be evaluated. Blah isn't evaluated. Blah is a variable.
[/quote]

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.
[img]http://www.instimul.com/fjaros/a then.PNG[/img]


[img]http://www.instimul.com/fjaros/a true then.PNG[/img]
May 6, 2007, 5:47 PM
Barabajagal
I wrote two quick programs and used WinDif (comes with visual studio 6). They were different...
May 6, 2007, 5:56 PM
l2k-Shadow
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):
[code]
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
[/code]
[img]http://www.instimul.com/fjaros/a1.PNG[/img]
We see that If a Then compares it to another variable, evaluating the expression.
[code]
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
[/code]
[img]http://www.instimul.com/fjaros/a2.PNG[/img]
Here we see that If a = True Then compares a to 0xFFFF which as a signed integer is -1, evaluating the expression.
May 6, 2007, 6:05 PM
St0rm.iD
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.
May 6, 2007, 6:14 PM
BreW
[quote author=Banana fanna fo fanna link=topic=16677.msg168765#msg168765 date=1178475251]
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.
[/quote]
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.
May 6, 2007, 6:36 PM
Barabajagal
I just proved it was better....
May 6, 2007, 6:44 PM
BreW
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)
May 6, 2007, 6:59 PM
l2k-Shadow
[quote author=brew link=topic=16677.msg168766#msg168766 date=1178476565]
[quote author=Banana fanna fo fanna link=topic=16677.msg168765#msg168765 date=1178475251]
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.
[/quote]
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.
[/quote]

Look at my assembly screens, there is no CBooling(), it just compares it to something in both cases.
May 6, 2007, 7:35 PM
tumeria
Gibbero
May 6, 2007, 7:51 PM
St0rm.iD
The point is, the compiler should be generating identical code anyway. Checking if True==True is redundant.
May 6, 2007, 8:02 PM
Barabajagal
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.
May 6, 2007, 11:02 PM
l2k-Shadow
[quote author=RεalityRipplε link=topic=16677.msg168774#msg168774 date=1178492558]
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.
[/quote]

Comments are extremely helpful when trying to figure out someone else's code, especially if it's not coded in a shitty BASIC language.
May 6, 2007, 11:04 PM
Barabajagal
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.
May 7, 2007, 2:02 AM
l2k-Shadow
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.
May 7, 2007, 2:06 AM
Barabajagal
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?"
May 7, 2007, 2:15 AM
MyStiCaL
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..
May 7, 2007, 3:55 AM
l2k-Shadow
[quote author=MyStiCaL link=topic=16677.msg168784#msg168784 date=1178510127]
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..

[/quote]

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.
May 7, 2007, 3:58 AM
Skywing
[quote author=RεalityRipplε link=topic=16677.msg168780#msg168780 date=1178504129]
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?"
[/quote]

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.
May 7, 2007, 4:41 AM
Barabajagal
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...
May 7, 2007, 5:31 AM
warz
[quote author=RεalityRipplε link=topic=16677.msg168787#msg168787 date=1178515867]
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...
[/quote]

Another not true at all statement.
May 7, 2007, 6:37 AM
St0rm.iD
[quote author=R?alityRippl? link=topic=16677.msg168787#msg168787 date=1178515867]
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...
[/quote]

You are being absolutely ridiculous.
May 7, 2007, 12:17 PM
Skywing
[quote author=RεalityRipplε link=topic=16677.msg168787#msg168787 date=1178515867]
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...
[/quote]
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.
May 7, 2007, 3:18 PM
Barabajagal
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.
May 7, 2007, 5:53 PM
St0rm.iD
[quote author=R?alityRippl? link=topic=16677.msg168793#msg168793 date=1178560435]
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.
[/quote]

You have no idea what is going on, do you?
May 7, 2007, 6:10 PM
Barabajagal
[quote author=Banana fanna fo fanna link=topic=16677.msg168795#msg168795 date=1178561424]
[quote author=R?alityRippl? link=topic=16677.msg168793#msg168793 date=1178560435]
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.
[/quote]
You have no idea what is going on, do you?
[/quote]
"Wot?"
May 7, 2007, 6:52 PM
tumeria
And that's the very reason why you'll never do anything more complex than a chatter bot
May 7, 2007, 9:44 PM
BreW
[quote author=tumeria link=topic=16677.msg168799#msg168799 date=1178574269]
And that's the very reason why you'll never do anything more complex than a chatter bot
[/quote]
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.
May 7, 2007, 10:52 PM
St0rm.iD
creating a chatterbot without bnls is tough; with bnls it's rather trivial. someday you will learn this the hard way.
May 7, 2007, 10:54 PM
Barabajagal
What if you make your own logon server? ;)
May 7, 2007, 11:08 PM
l2k-Shadow
[quote author=brew link=topic=16677.msg168800#msg168800 date=1178578333]
[quote author=tumeria link=topic=16677.msg168799#msg168799 date=1178574269]
And that's the very reason why you'll never do anything more complex than a chatter bot
[/quote]
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.
[/quote]

bnetdocs, winsock control (assuming VB use), BNLS/BNCSUtil. all you need to know is how to use them.
May 7, 2007, 11:14 PM
Quarantine
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.
May 7, 2007, 11:51 PM
MyStiCaL
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.
May 7, 2007, 11:52 PM
Barabajagal
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.
May 8, 2007, 12:11 AM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168807#msg168807 date=1178583089]
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.
[/quote]

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.
May 8, 2007, 12:31 AM
tumeria
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
May 8, 2007, 12:39 AM
Barabajagal
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.
May 8, 2007, 12:46 AM
MysT_DooM
i comment, it helps me remember
May 8, 2007, 12:47 AM
MyStiCaL
I comment everything, Sadly I even somtimes comment my txt files haha.
May 8, 2007, 12:49 AM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168811#msg168811 date=1178585189]
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.
[/quote]

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.
May 8, 2007, 1:02 AM
Barabajagal
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.
May 8, 2007, 1:06 AM
Explicit[nK]
[quote author=RεalityRipplε link=topic=16677.msg168815#msg168815 date=1178586408]
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.
[/quote]

It's mainly the fact that commenting code is practically an essential in the field, especially on collaborative projects.
May 8, 2007, 1:35 AM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168815#msg168815 date=1178586408]
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.
[/quote]

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.
May 8, 2007, 1:54 AM
Barabajagal
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. 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.
May 8, 2007, 4:26 AM
warz
I think the original point has been missed, here.

[quote author=RεalityRipplε link=topic=16677.msg168774#msg168774 date=1178492558]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.[/quote]

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
May 8, 2007, 4:48 AM
Barabajagal
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.
May 8, 2007, 4:56 AM
FrOzeN
[quote author=RεalityRipplε link=topic=16677.msg168821#msg168821 date=1178600169]I'm not stupid, no matter what you guys may think.[/quote]Agreed. Mentally challenged with certain issues is a much more appropriate title to describe you.
May 8, 2007, 7:41 AM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168819#msg168819 date=1178598374]
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. 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.
[/quote]

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.
May 8, 2007, 10:29 AM
Barabajagal
[quote author=Warrior link=topic=16677.msg168829#msg168829 date=1178620181]
[quote author=RεalityRipplε link=topic=16677.msg168819#msg168819 date=1178598374]
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. 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.
[/quote]

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.
[/quote]

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.
May 8, 2007, 2:35 PM
St0rm.iD
RR, how old are you...12?
May 8, 2007, 4:29 PM
Barabajagal
View my profile...?
May 8, 2007, 4:40 PM
St0rm.iD
I don't believe that you and I are the same age, which is why I ask.
May 8, 2007, 5:53 PM
Barabajagal
According to your profile, you're 4.
May 8, 2007, 6:05 PM
BreW
[quote author=RεalityRipplε link=topic=16677.msg168835#msg168835 date=1178647530]
According to your profile, you're 4.
[/quote]
gg
May 8, 2007, 8:16 PM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168830#msg168830 date=1178634935]
I just said you guys know those languages better than I do, how is that I know everything better than everyone else?
[/quote]

What about:
[quote author=RεalityRipplε link=topic=16677.msg168830#msg168830 date=1178634935]
You guys have more skill than me in those areas, and you can't even read it as well as I can? COME ON.
[/quote]

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.
May 8, 2007, 10:13 PM
Barabajagal
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.
May 8, 2007, 10:25 PM
Quarantine
[quote author=RεalityRipplε link=topic=16677.msg168840#msg168840 date=1178663130]
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.
[/quote]

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:

[size=20pt]WRONG.[/size]
May 8, 2007, 10:43 PM
Newby
i like buffalo wings covered in brew's blood.
May 9, 2007, 3:10 AM
tumeria
grotty...
May 9, 2007, 3:23 AM
Barabajagal
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...
May 9, 2007, 5:04 AM
MyStiCaL
someone get him out side and away from his computer.
May 9, 2007, 5:08 AM
Barabajagal
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).
May 9, 2007, 5:26 AM
l2k-Shadow
[quote author=RεalityRipplε link=topic=16677.msg168853#msg168853 date=1178688419]
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).
[/quote]

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?
May 9, 2007, 5:34 AM
Barabajagal
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 ;)
May 9, 2007, 5:43 AM
St0rm.iD
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.
May 9, 2007, 5:59 AM
warz
you called me
May 9, 2007, 6:02 AM
Barabajagal
wtf... you're the one that just called me?

Edit: if anyone else tries to fucking call me, i'm unplugging my phone line.
May 9, 2007, 6:04 AM
warz
uh, no?
May 9, 2007, 6:06 AM
Barabajagal
[quote author=Banana fanna fo fanna link=topic=16677.msg168856#msg168856 date=1178690377]
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.
[/quote]
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.
May 9, 2007, 6:08 AM
St0rm.iD
[quote author=R?alityRippl? link=topic=16677.msg168860#msg168860 date=1178690932]
[quote author=Banana fanna fo fanna link=topic=16677.msg168856#msg168856 date=1178690377]
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.
[/quote]
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.
[/quote]

HAH. Quick question...what's a lambda?
May 9, 2007, 6:14 AM
Barabajagal
Greek letter?

Edit: Λ <- that Greek letter.
May 9, 2007, 6:15 AM
St0rm.iD
Hmm, you are pretty dumb. You going to school?
May 9, 2007, 6:17 AM
Barabajagal
Λ is lambda... how is that dumb? And no, standardized education is a failure.
May 9, 2007, 6:18 AM
St0rm.iD
"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.
May 9, 2007, 6:20 AM
Barabajagal
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).
May 9, 2007, 6:25 AM
St0rm.iD
"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.
May 9, 2007, 6:40 AM
Barabajagal
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). 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.
May 9, 2007, 6:51 AM
Myndfyr
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 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:
[code]
# 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)
[/code]
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.
May 9, 2007, 7:49 AM
Barabajagal
In all honesty, I don't know why i've been ranting for so long. Just trash all my posts.
May 9, 2007, 7:56 AM
warz
[quote author=Banana fanna fo fanna link=topic=16677.msg168867#msg168867 date=1178692835]
"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.
[/quote]

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.
May 9, 2007, 7:57 AM
Quarantine
a lambada is that thing from Halflife. k

also wtf I just read all of realityripple's posts, you need some prozac man.
May 9, 2007, 9:29 AM
St0rm.iD
[quote author=MyndFyre[vL] link=topic=16677.msg168869#msg168869 date=1178696971]
@Banana: come on.  There are applications in which it's appropriate.  But often not, too.  I thought that this section 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:
[code]
# 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)
[/code]
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.
[/quote]

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.
May 9, 2007, 4:39 PM
Barabajagal
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.
May 9, 2007, 5:23 PM
Myndfyr
[quote author=RεalityRipplε link=topic=16677.msg168878#msg168878 date=1178731408]
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.
[/quote]
If you're going to talk about how stupid someone was, it might be good to know that 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.
May 9, 2007, 5:32 PM
Barabajagal
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....
May 9, 2007, 5:39 PM
HeRo
[quote author=RεalityRipplε link=topic=16677.msg168866#msg168866 date=1178691945]
I aced every test in high school and ended up with a GPA of 0.4 because I never did homework.
[/quote]
Whew, I thought my .5 was bad.
May 11, 2007, 5:36 PM
MyStiCaL
atleast you have one huh? mines 0.0
May 11, 2007, 7:53 PM
BreW
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
May 13, 2007, 3:08 AM
MyStiCaL
Your saying you'd know that, and what its purpose was instantly, if it wasn't commented?

https://davnit.net/bnet/vL/index.php?topic=16684.0

May 13, 2007, 3:17 AM

Search