- 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
Yoda uses "object, subject verb."
So it would be "Writing for DailyWTF now, Yoda is."
Admin
Admin
A Yodaspeak generator, has created someone, seems it.
http://www.yodaspeak.co.uk/
Admin
Hah! Call yourself a programmer?
Admin
And what kind of dysfunctional project has you using 1.4, which is three years past EOL.
Admin
C doesn't have enums. It has a hacky system for mapping constants onto integer values that it calls enums, but they're really just integers with a light dusting of semantic sugar.
Admin
So what you are asking for is Just the right amount of ignorance?
Admin
No, I think he means open up the manual on the language and goto chapter 4 entitled "Enums and You".
Admin
Please show some sensitivity. I once had an enum, and let me assure you: it was not laughing mater.
Admin
Admin
Agred! 100%
I was member in teem for many months, and I had to explane benefits of using enums to devlopers more experience than me. It was compleet waste of time as they laffed at me and went back to there ways of coding.
Admin
Admin
Admin
This is geting old
Admin
Haker schoolboy.
Admin
Admin
Admin
TRWTF is: Why would you ever want/need to get the ordinal from the Enum?
The whole point of the enum is to substitute constant words for a magic numbers. Once you create the enum, you should use it throughout the entire program. It is an integer already, or more precisely it resolves to an integer automatically. There's no reason to perform a function like that.
If the lead developer has a C background then he should be aware of something essentially the same as an enum; which is of course a preprocessor macro. Once you #define X 1, you can simply use X in place of 1 for both assignment and evaluations. You never even need to know or care about what X is.
CAPTCHA: transverbero
Admin
Admin
Clearly, you have read the fucking manual.
Admin
I think you overstepped when you said that every dev should know (in real-time as they're writing code) what each line will look like as byte-code, which is a massive waste of time, and as frits put it, very often won't matter anyway.
I think what you should have said is that developers should know what happens beyond their IDE, which I can agree with, but to say that high-level languages are ineffecient is, well, wrong. High level languages are tools, and like any tool, can be misused.
Admin
This is a serious question... This comes up again and again, in all sorts of languages. Besides calling these guys dummies, is there something about enums that is so hard to understand?
Is there something specific coming from C? I learned Pascal first (has enums) then Java and then C and it made sense from day 1.
Admin
Yes, long ago it was true you needed to understand a little something about the computer, but then we came up with these people called "users" who we encourage to know as little as possible, and even take pride in their ignorance, and we go all-out to make the software soooooooooo "easy to use" that even a drooling loonie can spastically click around and get something to happen. (Although if you know what you're doing, you'll find the emperor's new interface is actually harder to use.)
And, now that our precious users are anointing themselves programmers too, we can't ask them to know anything there either.
Admin
I am in agrement with you, partally. Sometime it is necesary to look under hood, sometime not required at all.
Admin
In C++ enums are like named integers. However in Java they are full-fledged instances of class.
Speaking of Java vs C++. I like this (http://jeetworks.org/node/103) kitchen metaphor of C++, Java and other languages.
Admin
There is no StringBuilder in 1.4 and I believe JavaBuffer wasn't used as string-concatenator. I think it was hardcoded those days
J2ME, you know, mobiles before iPhone
Admin
I've always found that learning a new language is fun in itself, once you get past the initial headache of having to get your head round shitloads of documentation (British shitloads, bigger than American shitloads, remember). Hating a language on principle is for cuntish little wankery losers. Wah wah wah, I doan WANNA learn java, er her ... ain't gonna get you looked at favourably when the opportunities are handed out.
Admin
I, on the other hand, love to at least have an idea, so i have a reasoning for why it almost always doesn't matter, and the ability to (based on this reasoning) point out situation when it does.
Admin
Bloody is. Might not be a StringBuilder but there's defly a StringBuffer.
Admin
Admin
Wouldn't be surprised. A job I resigned my way out of was unshiftably 1.4 because it was built around a version of JBoss that wouldn't work in 1.5+. Had to be the shittiest application ever. Wonder if it's still running.
<NelsonMuntz>HAA-ha!</NelsonMuntz>
Admin
So when you set out to bake a pie "from scratch" I assume you don't use a frozen crust, but rather start by planting wheat?
Captcha: consequat, a tarter variety of kumquat. Better for pie.
Admin
Please tell me you don't actually believe that, as stated, this is true, or even has any real meaning.
To some extent, yes, it's good to understand the underlying issues that can make innocuous looking code unduly expensive to execute. But when all is said and done, the whole point of higher level languages is that they allow the programmer to focus more on the problem at hand and less on the fiddly mechanics. If the cost of that is longer execution times and higher memory usage, it's often a cost well worth paying thanks primarily to the enormous increases hardware bang for the buck over the last 4 decades.
Admin
Jazz: An X, a 2, an X 2 3 4 ...
Admin
That book is so wrong they have to invent a completely new category of incorrectness to hold it.
Admin
Admin
...as if you were not reading tdwtf properly. FTFY.
Admin
Nobody ever said there was.
You mean StringBuffer, I assume, and I have no idea what you think you mean by "it was hardcoded."
Java has expanded + operations on Strings to StringBuffer.append() since at least 1.2, and probably back to 1.0. Starting in 1.4 or 1.5, it changed from StringBuffer to StringBuilder.
And note that
has never been "inefficient". That expands to SB.append() calls, which are as efficient as one could write it out longhand. The problem comes in constructs like
Which cannot be expanded to a fixed number of append() calls on a single SB object, but instead requires creating at least an SB and a String for every iteration.
Admin
Well you are wrong there budy.
Admin
Well shit, I've been using enums the wrong way all this time.
Captcha: ingenium - Diego's lead architect is a great example of when ingenium goes bad.
Admin
Admin
Usually, these are 9 to 10 programmers, or 4 to 5 programmers, or even 9 to 9:30 and 4 to 4:30 programmers.
:-)
Admin
Since ordinal() has been mentioned as the right way, for many things it is not. The ordinal depends on the declaration order and can be changed by refactoring or adding new values to an enum. So if the value should stay the same you have to use the following
Admin
That's why God invented Constants. Enums do absolutely nothing for c language that can't be done by constant declarations.
/sarcasm
My favorite feature is using enums for serialization. Named values make a lot more sense in an XML file than lots of 3's and 7's everywhere.
Admin
They're also a great way to run out of PermGen space, if you use them too liberally. Though "too liberally" is generally on the scale of "data input" rather than "config file" quantities for most cases.
Admin
Dammit, wrong button. That was in response to the "inter()ed[sic] Strings" comment.
Admin
Admin
Admin
In Pune, 10-year-old JDK is old enough to marry.
Admin
Jerry's doxy knave