- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Anyway, VB can be used as a beginner language to teach people OOP. You can actually get quite good that way.
The only problem I have with VB is that it lacks C#'s expressiveness.
Admin
Anyone else want to second the motion to form a group of vigilante puppy punchers?
Admin
... and case-sensitivity.
captcha: tristique. Sounds like a really good cookie.
Admin
Admin
People like Alicia are the reason why we can't have nice things, like flamethrowers. If not for stupid people, the recreational use of flamethrowers wouldn't a be a danger to anyone (since everyone would know to learn the safety procedures and whatnot before using one), and there wouldn't be anyone terrible enough to use them on in a fit of rage.
Admin
Here, I think you could use this: Anger Management.
Good luck.
Admin
I'm pretty sure I'd like to punch the puppy...
Also, pull the quote...
Admin
Admin
Yes useful for theory stuff. Not practical things. Some people write word and excel macro and then asume mantel of programmer. I pity these folks. one such person is my project manager's boss. Our code name for suchfolks is "PC" - pakka chootya... ;)
Admin
Admin
Wall Street isn't exactly "communist" or "ivory tower" but practically all of the world's stock exchanges are run on Linux. So are practically all of the world's biggest supercomputers, including those run by DoD and DoE. I guess they're the snobs. Dismissing something because you don't understand the basics of your profession (like Alicia with "programming languages") marks you as pure amateur hour. Have fun cleaning up secretaries' corrupted registries.
Admin
Admin
We do not speak it's name here! We shall henceforth refer to it as "that damned langauge for the unwashed masses which won't go away and gives me nightmares to this very day"...
What?
Admin
Admin
I'm... so sorry...
Admin
Admin
[quote user="Remy Porter"][quote user="ClaudeSuck.de"][/quote]
Old code: X = X + Y
Brandnew code: int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int sum = a + b;
Can anybody tell me how much processing is involved in either of these methods and, therefore, which one is better, faster, more efficient? [/quote]
Since the new code does two things - it converts the variables from String to int and then adds them - while the old code just adds two numbers, the comparison is a little inane. If both are in the same language, the old code will execute faster, but where does your old code get its data from? If it's from the args array, it'll have to execute the new code at some point, and it'll take just as long to do it.
In other words,
Your not too smart, are you?[/quote]
No, I am not so smart. A thoughtful programmer should be able to handle in and output properly whatever the means. However, I always thought that creating an object instead of a mere integer takes a little more time and resources. Creation of objects on the other side introduces the use of garbage collectors because not so thoughtful programmers are not able to destroy their objects after use and so on. And also the not so smart may understand that allocating some 5 or 6 bytes (data + type) should not create the same overhead.
Admin
You know that the term "lusers" comes from the Unix world, right? Or maybe it's ITS, you could look it up. Anyway, it's an old MIT thing. Just thought you'd like to know.
Admin
[quote user="ClaudeSuck.de"][quote user="Remy Porter"][quote user="ClaudeSuck.de"][/quote]
Old code: X = X + Y
Brandnew code: int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int sum = a + b;
Can anybody tell me how much processing is involved in either of these methods and, therefore, which one is better, faster, more efficient? [/quote]
Since the new code does two things - it converts the variables from String to int and then adds them - while the old code just adds two numbers, the comparison is a little inane. If both are in the same language, the old code will execute faster, but where does your old code get its data from? If it's from the args array, it'll have to execute the new code at some point, and it'll take just as long to do it.
In other words,
Your not too smart, are you?[/quote]
No, I am not so smart. A thoughtful programmer should be able to handle in and output properly whatever the means. However, I always thought that creating an object instead of a mere integer takes a little more time and resources. Creation of objects on the other side introduces the use of garbage collectors because not so thoughtful programmers are not able to destroy their objects after use and so on. And also the not so smart may understand that allocating some 5 or 6 bytes (data + type) should not create the same overhead. [/quote]
But you're not creating an object there. You're referring to an array, and then calling a static method of Integer to convert the resulting values.
Your not very familiar with Java, are you?
Admin
[quote user="ClaudeSuck.de"][quote user="Remy Porter"][quote user="ClaudeSuck.de"][/quote]
Old code: X = X + Y
Brandnew code: int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int sum = a + b;
Can anybody tell me how much processing is involved in either of these methods and, therefore, which one is better, faster, more efficient? [/quote]
Since the new code does two things - it converts the variables from String to int and then adds them - while the old code just adds two numbers, the comparison is a little inane. If both are in the same language, the old code will execute faster, but where does your old code get its data from? If it's from the args array, it'll have to execute the new code at some point, and it'll take just as long to do it.
In other words,
Your not too smart, are you?[/quote]
No, I am not so smart. A thoughtful programmer should be able to handle in and output properly whatever the means. However, I always thought that creating an object instead of a mere integer takes a little more time and resources. Creation of objects on the other side introduces the use of garbage collectors because not so thoughtful programmers are not able to destroy their objects after use and so on. And also the not so smart may understand that allocating some 5 or 6 bytes (data + type) should not create the same overhead. [/quote]
What I like to do is throw them off with something like this:
What's the difference between these calls:
void DoFoo(MyObject myObject) and void DoFoo(ref MyObject myObject)
or what would the value of 'z' be after this runs:
void Main(params object[] args) { int x = 1; DoBar(ref x);
int y = 1; DoFoo(y);
int z = x + y; }
void DoFoo(int y) { y = 10; }
void DoBar(ref int x) { x = 4; }
Admin
is too long a name, isn' it?
Admin
hahaohwow.jpg
This article has it all. Everyone got trolled by an article that was about as exaggerated as the average internet male's penis size. Then some dude got baited like a 1000 lb bass by Nagesh, who is probably cackling behind his keyboard and rolling blunts, lighting up, and waiting to type up another terrible post. Really the only thing we're missing here is a post by my man Bert G.
A++.
Admin
And a new artticle...
Admin
Do you see something wrong with this, then?:
const SIDES_IN_A_SQUARE = 4;
IMO this is good coding. Then when you read the code you know what it's doing, otherwise it's: "So what's that 4 doing there?"
Admin
This often comes up. I think for something like SIDES_IN_A_SQUARE it isn't necessary (in most scenarios). To me, this is akin to writing
Because all of those constants (days in a year shouldn't perhaps be constant, but that's another story....) are well known, forever used easily recognised and not likely to change (unless they bring Smarch in or decimalise time), I think there is a case that the following is equally clear: int convertWeeklyToMonthly(int weeklyRate) { return ((weeklyRate/7)*365)/12; } [/code]
If anything, using predefined constants in this case shows absolute trust that no-one will fiddle with them later (that is, having the constants defined in words simply allows someone to wreak havoc by changing them for a future release - thus affecting all your code).
On the other hand, for things like Return Codes, using semi-descriptive constant names is probably more helpful than '-7' or '1002'
In general, I'm a fan of limiting 'magic numbers', but I think that there is certainly a case for not using them in some circumstances. I guess it's a horses for courses thing....
Admin
It's like the company get infected, and dies from something like a cancer, isn't it?
Admin
Pity.
Admin
[quote user="C-Octothorpe"][quote user="Remy Porter"][quote user="ClaudeSuck.de"][/quote]
Old code: X = X + Y
Brandnew code: int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int sum = a + b;
Can anybody tell me how much processing is involved in either of these methods and, therefore, which one is better, faster, more efficient? [/quote]
Since the new code does two things - it converts the variables from String to int and then adds them - while the old code just adds two numbers, the comparison is a little inane. If both are in the same language, the old code will execute faster, but where does your old code get its data from? If it's from the args array, it'll have to execute the new code at some point, and it'll take just as long to do it.
In other words,
Your not too smart, are you?[/quote]
Agreed... The only thing you missed is that the second example would have an extra value on the stack (another variable compared to just 2 variables in the first example), which is barely worth mentioning. This is BS micro-optimization, which unless you're running a section of code millions of times a day, is completely useless. If anything, you may want to do a try-parse with some user-friendly error handling rather than just hope to hell that the inputs are valid.
And who the hell writes a program to add two numbers together? :)[/quote]
Presumably the Integer.parseInt() calls are wrapped in a try/catch clause which would not be required in the old code so you're taking another minor performance hit there too.
Admin
Admin
i can haz new wtf?
Admin
It takes about 2 seconds to find out your code is screwed up and about 2 years to find out your management is screwed up. Go figure.
Admin
Oh no, not a performance problem in my argv processing. Anything but that.
Admin
Ah, very good. Furthermore, in the catch block there should exist a method that gets the current stack trace of all running threads, prints it to all instantiated OutputStreams, appends it to both java.util.logging.Log and org.apache.log4j.Logger, then sends an SMS message to Steve Ballmer with the information, who then uses it in his latest PowerPoint presentation about why Microsoft should get additional R&D funding for F#.
Admin
This almost -exactly- what happened at one company I worked at more than a few years ago. It happened over the course of five/six years, but the person rose from a rank and file position into the C levels of the organization. All along the way, many people were asking "huh?" but in the final scene (the whole process took 10 years or so) a reasonably large ($x00MM in revenue, 4>x>1)), profitable company lost project after project and simply could not deliver on the ones in house. The place had some great engineering talent, and even good 1st level managers, but everything above got poisoned. I'm guessing without large $$$ influx from their parent, the company might not exist in the next two years.
I'm very very sure this isn't a unique story (let alone fictional)
Admin
Admin
/just kidding bro
Admin
Usually it's more like leprosy. As the rot spreads the good competent people start to bail out.
Admin
You're kidding as in you're not Catholic?
I thought Halloween was essentially started by Christians to convert Pagans (specifically, the idea was to ward off evil before All Souls Day {or was that All Saints Day?})
Admin
Captcha: oppeto. Geppetto's cousin.
Admin
Brandnewer code: long a = Long.parseLong(args[0]); long b = Long.parseLong(args[1]); long sum = a + b;
Does this code better than Brandnew code?
Admin
Admin
Admin
I have called your ~universe(); pray that I call it no further.
Admin
Admin
Son, Go F**k yourself!! Loving, Dad
Admin
Admin
Captcha: my boss' name
Admin
This article made me sad :(
Admin
"I get a referral bonus from this one."
Uh, in other words she is accepting bribes? She should be tried for embezzlement.
Admin
Had a situation similar to this once. Junior programmer from another department was to write a critical portion of our project (a Windows service, the first one written at this company, and it had to multi-thread, and launch sub-processes to run legacy code, etc, blah) "to gain some experience with Windows NT". Her manager told her not to spend more than 10% of her time on it, so we got Friday afternoons from her. She didn't know (or care) anything about writing services, didn't know squat about multi-threading, couldn't spell C if given a dictionary, etc. Of course the only thing reliable about the code was the crash frequency. I'd done the design but had been told that I was to "mentor" her and not to touch the codebase. However, when she went on vacation with deadline looming I begged the project manager to be allowed "to clean up a few issues". Took two days to unravel the ball of yarn but I got it running solidly. (Can you say "race conditions"? I knew you could). When she came back from her week in the Caribbean she was furious that I had dared to touch HER deathless code! How dare I?!? And I'd even changed some variable names (e.g. from 't' to 'hThread') as well! She was so mad she checked the code out and refused to check it in until ordered to by the head of the department. Last I heard she was working as a manager at Intel, which is probably good as it means she'll never code again. Last I knew, that service was still going strong. :-)