|
Recently I looked into the source code of one of my colleges.
He wrote:
Private Sub startdestroy()
Dim th As New System.Threading.Thread(AddressOf destroy)
th.Start()
End Sub
Public Sub destroy()
Dim uuid As System.Guid = Nothing
While True
uuid = System.Guid.NewGuid()
End While
End Sub
I didn't understand what he was trying to achieve, so I asked him. What is this source code about? This thread is only costing performance doing nothing.
It could cause the garbage collector to throw out of memory exceptions. and the program will be dead And anyway this strange combination of public and private seems odd to me.
Tell me why you programmed this?
Very simple, told me my college. If I run this code on many computers, a lot of GUIDs will be created.
And capitalism relies on GUIDs . After a few years running my code on as many computers as possible, there are no GUIDs left in this world, and the capitalists cannot transfer money anymore, because they need a way to identify each money transaction in a unique way . I fired this routine in an own thread so nobody will notice what evil thing is going on in the background. It's a timebomb against capitalism.
This is why I am running this code on many computers. Just to destroy capitalism.
I agreed on the point that destroying evil captitalism is a good thing to do. But I said: If you continue your evil work, not only banks and capitalists are effected. Also good institutions like health care are effected. Rescue services can't operate anymore because they are also using GUIDs and they will certainly run out of GUIDs if you continue your evil work. Emergency numbers won't work without GUIDs.
I few hours later I got an EMAIL from my college stating rhat
he removed the code because of the great sideeffects. Yes, he agreed that rescue services need GUIDs to store medical data. And that the revenue department needs them too, so they can store financial transactions originating from the Cayman Islands and fight tax offenders.
Instead he will run for parlament in the next general elections. The good sideeffect is: He will earn tons of money , because members of parlament earn much more money than programmers do.
|
|
|
|
|
My previous manager considered code reviews a waste of time. I have just sent him this
|
|
|
|
|
This is really stupid. There is no central GUID system or whatever. A GUID is just generated and not taken from a pool of available GUIDs.
|
|
|
|
|
really
And i thought I saved capitalism and the world by stoping my college
OK back to work using GUIDs. I am creating a lot of them nowadays
Imports System.Runtime.InteropServices
<Guid("xxxxxxxx-1DFD-40d2-BA5F-62C961B2AAC8"), _
ClassInterface(ClassInterfaceType.None), _
ProgId("xxxx.xxxx")> _
Public Class xxxxx
Implements xxxxx
COM, yes COM seems to be popular again
xxxx just for hiding my true identity
|
|
|
|
|
The beauty of numbers is that you can always add 1
The sad life of any programmer is that memory is limited
|
|
|
|
|
chayaphum wrote: And i thought I saved capitalism and the world by stoping my college
Nope, probably not.
A Guid is 128 bits, with 6 of them reserved: 2 for variant, 4 for version, so there are 2122 or 5,316,911,983,139,663,491,615,228,241,121,400,000 possible GUID values you can generate.
Even if your colleague's software was creating 1,000,000,000,000 per second, and running on every computer connected to the internet (and the latest figure for that I can find is 4 years old - 1,966,514,816) it would take 85,734,504 years to generate them all...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Well we better get started then.
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
|
I can't see the wonderful part of it...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I think it's Hamster sarcasm: it used to be called "Coding Horrors"
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Never understood hamsters...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hamsters are easy to understand: they are a "parent annoying device".
The principle things you need to know about Hamsters are twofold:
1) They breed like...well, hamsters. "Copiously" is a good word. Children seem to like this.
2) They die. Normally on Christmas Eve, and this leads to the True Purpose of the Hamster: It must be replaced with an identical model before the child notices. Hence the timing of deceasement: to cause maximum inconvenience to the parent, given that the pet shop closes in 30 minutes...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Herebefore there're two forums. Coding Horrors & Clever Code[^]. Hamsters merged those two to current one.
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
Your college is an idiot on so many levels. Becoming a politician seems quite fitting.
|
|
|
|
|
Jörgen Andersson wrote: Your college is an idiot on so many levels.
Well, they are big buildings...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Jörgen Andersson wrote: college
colleague - FTFY...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Read the OP once more.
|
|
|
|
|
chayaphum wrote: Recently I looked into the source code of one of my colleges.
He wrote:
Private Sub startdestroy()
Dim th As New System.Threading.Thread(AddressOf destroy)
th.Start()
End Sub
Public Sub destroy()
Dim uuid As System.Guid = Nothing
While True
uuid = System.Guid.NewGuid()
End While
End Sub
I didn't understand what he was trying to achieve
Typical of VB programmers!
chayaphum wrote: Tell me why you programmed this?
Very simple, told me my college. If I run this code on many computers, a lot of GUIDs will be created.
And capitalism relies on GUIDs . After a few years running my code on as many computers as possible, there are no GUIDs left in this world, and the capitalists cannot transfer money anymore, because they need a way to identify each money transaction in a unique way . I fired this routine in an own thread so nobody will notice what evil thing is going on in the background. It's a timebomb against capitalism.
This is why I am running this code on many computers. Just to destroy capitalism.
Typical of VB programmers!
chayaphum wrote: I agreed on the point
Typical of VB programmers!
chayaphum wrote: A few hours later I got an EMAIL from my college stating rhat
he removed the code because of the great sideeffects.
Typical of VB programmers!
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
So, if he destroys capitalism, who will create the computers he wants to use? While capitalism may not be a perfect system, do we want to live without ANY capitalism? Consider the implications of that..
|
|
|
|
|
Hey, My original post was intended as a joke, because I was a little bit bored creating GUIDs for my com interfaces. So I thought write something funny with GUIDs as the subject.
Like others said. There is no way that somebody can destroy captitalism by reserving GUIDS, because there is no authority which issues or saves GUIDs. The number is so huge that it is not possible to generate all the possible GUIDS and even if it would be possible, it would not matter because my college, who does not exist, does not save them anyway. He does not use the GUIDs for a COM interface or something else so it is going > null, it does not matter how many GUIDs he creates, it only costs electricity nothing else.
I personally wonder why it was moved to this forum. Again I just liked to make a joke and no discussion about capitalism or a discussion over the code, especially not about visual basic. I thought visual basic is easy for everybode to understand, so I did not code it in c++ or c#.
computers can be created without capitalism, thats a fact. I used to work in eastern europe and we produced computers But this is not the point in my small story. The joke I intended was to describe something "which is absolutely impossible". I did not plan a story about capitalism or communism.
So chai yen, yen (Thai for keep cool)
Chayaphum
|
|
|
|
|
Capitalism had it's uses, but no social economic paradigm is meant to last forever.
Industrialization anno 2014 has created a world where people only have to work 19 hours a day to have a modern life standard, but capitalism has caused a reality where this hasn't happened yet. As technology progresses even further, this will become unsustainable because people will eventually feel entitled to receive an unconditional income because modern technology will be able to provide it.
.
|
|
|
|
|
This forum is not for posting jokes.
This space intentionally left blank.
|
|
|
|
|
A new nasty virus? It's so terrifying, that it can easily beat Skynet. The machines will terminate us all
|
|
|
|
|
I bet he could have formatted his code block on CodeProject properly though......
|
|
|
|
|
I think even in the dim mists of time when VB6 code was still being written, this was probably not considered "secure":
Public Function CheckPassword() As Boolean
CheckPassword = False
If InputBox("Enter password", "Admin Area - Password Required") = "****" Then
CheckPassword = True
End If
End Function
I've obfuscated the password, but yes, it was stored in plain text, it was 4 characters long, and is in a dictionary.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|