- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- Tangled Up In Blue
- 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
Java developers never cease to amaze me... :P
This is a very insightful comment.
Java, a language developed by a convicted pedophile (see http://en.wikipedia.org/wiki/Patrick_Naughton ) encourages the worst possible practices.
And kids who were weaned on this toy language tend to have NO IDEA how a computer works.
We NEVER hire anything but people with real Engineering degrees (Electrical, Mechanical, Civil) or mathematics degrees to do any of our work, including softwared development.
Admin
Admin
Admin
Actually mail readers that will accept HTML and displayed the rendered message as such could very well "compile and execute" code attached to them thinking that it needed to be done. Just think javascript for a minute. What if someone sent one in to an HTML enabled reader. Or better yet, just an HTML example of a WTF would totally mess this up.
Send your example as an attachment and you are not at the mercy of the reader.
Admin
Please tell us what field you are in, because a lot of us know that the degrees in CS are mostly useless and a few years actually doing the work is better off than a degree. Now of course if your field of work is in bridge building or even something smaller like building maintenance, I can see where engineering degrees would be of utmost importance.
Of course if the colleges and universities actually taught useful skill sets in CS courses my statement wouldn't even need to be made.
Admin
To RON, re. C#, exceptions, etc, and I should have quoted but too late now...
And what about me, who doesn't know what he is talking about or what the OP you refer to was talking about?
Admin
Most college CS courses teach things that are useful to Computer Scientists. It would be great if there was an alternate line of study for Software Engineers.
Admin
I stand corrected. Yes, I think that is a more accurate assessment.
Admin
Admin
Yes, and ...? Just how many recorded instances are there of viruses being fired when opened in a code editor? Superstition does nothing to enhance security.
Admin
Not saying they don't teach the course, I am saying that what they teach is not useful to a real software engineer in the real world.
Admin
This may not be exactly what you mean but it comes real close: http://secunia.com/advisories/22603/ Essentially the Object Broker in Visual studio is compromised so a virus can get in via the IDE.
Admin
ehh.. wha?
You may want to read up on CIL, specifically the castclass isinst operations. ECMA 335 will help ya there.
The 'as' operator uses isinst which incidentally pushes null onto the stack if the class cannot be casted. Casting uses.. castclass, which will throw an exception.
Admin
ehh.. wha?
You may want to read up on CIL, specifically the castclass isinst operations. ECMA 335 will help ya there.
The 'as' operator uses isinst which incidentally pushes null onto the stack if the class cannot be casted. Casting uses.. castclass, which will throw an exception.
Admin
Admin
Well, duh. Obviously you print it out, take a photograph on a wooden table and send it as an inline-image.
Rich
The real WTF is that someone has undoubtedly posted this lame attempt at humor already in the time it has taken me to write this message
Admin
A little experiment. C# code using the as operator. [STAThread] private static void Main(string[] args) { FileInfo bla = new FileInfo(@"c:"); object bla2 = bla; FileInfo bla3 = bla2 as FileInfo; }
Here is the code above compiled into IL .method private hidebysig static void Main(string[] args) cil managed { .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() .entrypoint .maxstack 2 .locals init ( [0] class [mscorlib]System.IO.FileInfo bla, [1] object bla2, [2] class [mscorlib]System.IO.FileInfo bla3, ) L_0000: nop L_0001: ldstr "c:\" L_0006: newobj instance void [mscorlib]System.IO.FileInfo::.ctor(string) L_000b: stloc.0 L_000c: ldloc.0 L_000d: stloc.1 L_000e: ldloc.1 L_000f: isinst [mscorlib]System.IO.FileInfo Here is the 'as' operator. It is a native opcode of il. notice no catch around it. L_0014: stloc.2 L_0015: br.s L_0017 L_0017: ret }
Also the 'as' operator can not be used for checking value types. If this was using the same method as an explicit cast and just hiding the exception, then the as operator should work with value types. Also just for completness the explict cast '(...}' uses the IL 'castclass'.
Hope this helps
CAPTCHA : dreadlocks?
Admin
Admin
No. This first step is to STFU if you don't know and use the interweb to find out. This kind of post only wastes time as people read it, think about it, research to verify it, and finally explain how/that it's wrong.
Admin
Admin
You can get rid of the warning if you simply drop the () and give the parameters list without them. for example:
x = Myfunct(y, "j") Myfunc y, "j"
are both valid and don't raise a warning.
In addition a subroutine call requires you to leave off the (). if you want to add them you need to use the Call keyword. For example:
Mysub y, "j" Call Mysub(y, "j") are both valid.
Admin
Fail.
(What about interpreted stuff, like VB script?)
Admin
Admin
Well as long as you name it with a TXT extension rather then the VBS extension you are fine. Alex would be stupid to open a VBS file without checking it first anyway.
Admin
That's nice to hear.
Admin
It's worse than failure.
Admin
My bad. When I was composing my reply, I debated with myself whether to specify [plain text] within the in a code editor phrase, and decided not to because it seemed too bloody obvious.
As amends, I offer the following link: http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/ built and last updated in 1998, this is, IMHO still the most useful tool for editing code in a Windows environment. It has some very useful features, such as a macro-creation facility and the option of space based tabbing [I choose three-space], auto-indent, automatic endline detection and options for saving with endlines of choice, as well as command-execution features, but it does not impose anything under the hood.
Admin
Thanx to all who commented on my little note. Yes, I know that what I wrote was not a complete solution -- it was more of just an example of how sometimes things aren't always as obvious as the novice might like them to be.
This is not to be taken as casting aspersions toward the Java language or novice programmers. It's just a big subject which requires a fair amount of study. With luck, you eventually come to a point where it all more or less snaps into place. Before that, it can be a bit of a struggle, producing its share of WTFs on the way, unfortunately.
Thanks to those who posted helpful web links, as well. I'm happy to say that I've assimilated enough of the Java milieu that I can usually now frame a Google query which will give me an answer. But, please, remember, sometimes it's difficult to ask "How do I . . ." when you're not even sure what ". . ." is.
Admin
approximately 47600 hits, including this:
Kitchen & Housewares at MSN Shopping More handy sink adapter. Hook it up when you need it, put it away when you dont. ... kitchen, and saves you the hassle of leaving home for your cuppa java! ...
Admin
Admin
Admin
Admin
Well as they postulate, defecation does occur. Alternatively, if you perchance emote in disagreement I would have to exasperate that you are ascending an unsanitary tributary without any means of locomotion.
Admin
Word. --~~~
Admin
Java absolutely requires return values. The compiler complains when a method can reach its end without a return(). The method below will cause a compile-time error.
int caller() { if (true) return(5); else System.err.println("No return value."); }
Of course, Java will calculate expressions without assigning them to any variable, e.g. "i.doubleValue();". Java can't be sure that the method has no side effects; doubleValue() might change the object.
Admin
No, that's not what they meant. For example:
I can kind of see the reason for doing that. After all, why have a return value if you're not going to use it?
But then real life intervenes, and you find real world cases where you might not care about the return value, and thus this instantly becomes an annoying anti-feature.
Admin
Ada. And that's a feature, and a nice one.
Admin
I nominate using HTML mails as the REALLY REAL WTF OF THE WHOLE WORLD. that's n00bish, please let the elite sends real email using telnet, and use your favorite pen and paper if you don't know how to do it.
Admin
Admin
From the Java 1.0 API:
For newcomers it's maybe a bit strange this method can't be found on class System, but that's because each thread has his own stack.Admin
why consider that when it's easier to just insult someone?
Admin
Yes indeed. A real life example that comes to mind is unit testing. If you want to test for an error case, you usually don't care about the return value of your method, you just want to check that an exception has been thrown as expected.
e.g.
public void testAnExceptionHasBeenThrown() { try { classUnderTest.myMethod(badParams); // here I don't care about what myMethod returns fail("Exception has not been thrown!!!); } catch (Exception expected) { // various check on the exception } }
Captcha: cognac. Why not?
Admin
So convicted pedophiles are incapable of otherwise great creations?
Additionally, I look forward to never working for your company.
Admin
Admin
Admin
Admin
Admin
Admin
You are obviously new here. We have had source code that can cause temporary blindness, nausea, even paralysis.
Anyways, if the language is a scripting language, the source is executable.
Admin
Compensating for the shift in voice from passive to active:
If you make a submission and your supplied code is included in an attachment then a) I'd have to deal with an added burden that offers no benefit; as a result b) I triage your submission down to priority F.
Clearer?