Comment On Overloaded Help

"A certain coworker of mine is known for writing vast libraries of redundant Java code (example: makeStringArray(...)) in the hopes it will make everyone's lives easier," Jared writes. "That said, I wasn't at all surprised when I encountered this block of code." [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Re: Overloaded Help

2010-10-20 13:56 • by anon (unregistered)
326110 in reply to 326090
Design Pattern:
boog:
I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better!

Your company does not have 0$ in cash to pony up for Netbeans or IntelliJ IDEA Community Edition?

How will they pay your wage?


He said "better".

Of course, vim is free, too, so...

Re: Overloaded Help

2010-10-20 14:02 • by Alex Papadimoulis
326112 in reply to 326048
TheCPUWizard:
One thing that most of the suggestions (all of them?) leave out is the compile time checking that the number of parameters is a multiple of 3....


I think that's a small WTF in and of itself. In a strongly-typed language like Java, it'd be trivial to build a struct or class that does the same thing, and require that as the parameters.

setDataRecs( new DataRec( "a", "b", "c") )

Requiring a certain multiple of parameters is a pretty confusing way to code.

Re: Overloaded Help

2010-10-20 14:05 • by Bryan (unregistered)
TRWTF is that some people just don't get sarcasm.

Re: Overloaded Help

2010-10-20 14:05 • by EvanED
326114 in reply to 325999
Severity One:
The other WTF is the 'throws Exception', which is saying that something might go wrong in this method, but you don't know what, and you've removed the possibility for the user of the method to distinguish between compile-time and run-time exceptions.

"throws Exception" is pretty far from a WTF; there are plenty of active debates on the merits and demerits of checked exceptions. I tend to fall more on the side of checked exceptions, but the issue is far from settled.

Re: Overloaded Help

2010-10-20 14:11 • by Sutherlands
326115 in reply to 326114
EvanED:
Severity One:
The other WTF is the 'throws Exception', which is saying that something might go wrong in this method, but you don't know what, and you've removed the possibility for the user of the method to distinguish between compile-time and run-time exceptions.

"throws Exception" is pretty far from a WTF; there are plenty of active debates on the merits and demerits of checked exceptions. I tend to fall more on the side of checked exceptions, but the issue is far from settled.
Whether you like checked exceptions or not, "throws Exception" is indeed a WTF. It's saying "Hey, this function could throw absolutely any exception. Or I'm just a lazy coder that couldn't put which exceptions it can actually throw. Have fun guessing which!"

Re: Overloaded Help

2010-10-20 14:13 • by EvanED
326116 in reply to 326115
Sutherlands:
EvanED:
Severity One:
The other WTF is the 'throws Exception', which is saying that something might go wrong in this method, but you don't know what, and you've removed the possibility for the user of the method to distinguish between compile-time and run-time exceptions.

"throws Exception" is pretty far from a WTF; there are plenty of active debates on the merits and demerits of checked exceptions. I tend to fall more on the side of checked exceptions, but the issue is far from settled.
Whether you like checked exceptions or not, "throws Exception" is indeed a WTF. It's saying "Hey, this function could throw absolutely any exception. Or I'm just a lazy coder that couldn't put which exceptions it can actually throw. Have fun guessing which!"

You look at it that way, but I look at "throws Exceptions" as basically just saying "I'm making this language that demands checked exceptions into a language that doesn't, but which requires a little extra syntax on the function definitions."

Now you can argue about how much you have to fight against the language before it becomes a WTF, but I personally don't think that particular offense is anywhere near that level.

Re: Overloaded Help

2010-10-20 14:19 • by Design Pattern (unregistered)
326118 in reply to 326102
toth:

Speaking of which, does anyone have recommendations for Python IDEs that are not Eclipse?

IntelliJ IDEA, but unfortunately only in the Ultimate Edition which is not free for commercial projects.

(It is free when using the Classroom License or the Open Source Project License).

Re: Overloaded Help

2010-10-20 14:20 • by frits
326119 in reply to 326115
Sutherlands:
Hey, this function could throw absolutely any exception.


That's pretty much how the .Net languages and regular C++ (with exceptions turned on) operate all of the time, which I'm OK with. You shouldn't really have to worry about catching/rethrowing exceptions at every level in a library or application anyway.

Re: Overloaded Help

2010-10-20 14:28 • by Herby (unregistered)
326120 in reply to 325969
Alex:
The REAL WTF is that the methods don't go up to 40. 40 rec data's is an absolute minimum for me.

This is not as bad as it seems. In biblical times, the number '40' was often used as a synonym for infinite (like 40 days and 40 nights, etc.). Given that this is intended to accommodate ALL usage, it is a much better number.

I suspect that the original coder had no concept of infinity when they coded the first example though.

Today's lesson: "There are three ways to code for sets: none, one, and many".

Re: Overloaded Help

2010-10-20 14:34 • by Design Pattern (unregistered)
326122 in reply to 326116
EvanED:

You look at it that way, but I look at "throws Exceptions" as basically just saying "I'm making this language that demands checked exceptions into a language that doesn't, but which requires a little extra syntax on the function definitions."

If you want to make it into a language that doesn't demand checked exceptions, catch checked exceptions and wrap them into associated unchecked exceptions (which requires to define a new unchecked exception for every checked exception you want to wrap).

Just declaring "throws Exception" is pure lazyness on the part of the implementor and makes life a hell for the user.

In other words: It is a WTF!

Re: Overloaded Help

2010-10-20 14:51 • by ikke (unregistered)
326124 in reply to 326031
boog:


My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!


Copy-and-Paste code may end up here. Be glad you are prevented from "writing" it.

Re: Overloaded Help

2010-10-20 15:03 • by ÃÆâ€℠(unregistered)
326125 in reply to 326120
Herby:

Today's lesson: "There are three ways to code for sets: none, one, many, and FILE_NOT_FOUND".

FTFY

Re: Overloaded Help

2010-10-20 15:10 • by PITA (unregistered)
Just keep scrolling.... just keep scrolling...

Re: Overloaded Help

2010-10-20 15:13 • by LANMind (unregistered)
I absolutely love it when people fight over pointless, pedantic nonsense then leave with opinions even more idiotic than when they joined the conversation. The only way this could get better would be to somehow make it gladitorial.

Re: Overloaded Help

2010-10-20 15:20 • by History Teacher (unregistered)
326128 in reply to 326102
toth:

Speaking of which, does anyone have recommendations for Python IDEs that are not Eclipse?

I seem to recall that at least about a year ago NetBeans was pretty good for Python, and is probably better today.

Re: Overloaded Help

2010-10-20 15:45 • by Sutherlands
326129 in reply to 326119
frits:
Sutherlands:
Hey, this function could throw absolutely any exception.


That's pretty much how the .Net languages and regular C++ (with exceptions turned on) operate all of the time, which I'm OK with. You shouldn't really have to worry about catching/rethrowing exceptions at every level in a library or application anyway.
I'm ok with that in my functions as well. However, being forced to either catch any possible exception or being forced to declare that my function can throw any old exception (forcing the former on someone else) I'm not ok with.

Not having checked exceptions is not a WTF. Having checked exceptions and being lazy to the point that they're strictly worse than unchecked exceptions is a WTF.

Re: Overloaded Help

2010-10-20 15:46 • by Sutherlands
326130 in reply to 326122
Design Pattern:
EvanED:

You look at it that way, but I look at "throws Exceptions" as basically just saying "I'm making this language that demands checked exceptions into a language that doesn't, but which requires a little extra syntax on the function definitions."

If you want to make it into a language that doesn't demand checked exceptions, catch checked exceptions and wrap them into associated unchecked exceptions (which requires to define a new unchecked exception for every checked exception you want to wrap).

Just declaring "throws Exception" is pure lazyness on the part of the implementor and makes life a hell for the user.

In other words: It is a WTF!

Re: Overloaded Help

2010-10-20 15:49 • by Roy T. (unregistered)
Of course in JAVA you have to do it like that, but in C# you can do this at once and have a function that has an overload for 1 to INF strings to be added to an array :).


public string[] RecData(params string[] m)
{
return m;
}


(disclaimer: of course I'm being sarcastic)

Re: Overloaded Help

2010-10-20 15:58 • by cod3_complete
326134 in reply to 326036
Moo:
boog:
Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. *rant*


Well, it's good to know that PHP isn't the only thing that Eclipse totally sucks at...


Another thing that sucks about Eclipse is you can't open two projects (workspaces) at once without jumping thru hoops. I routinely open multiple projects in Visual Studio to add new changes to various projects through out the day. But when I had multiple projects setup thru Eclipse it just gave me an error message if I tried to open an additional "workspace". I guess those IBM guys really aren't that smart.

Re: Overloaded Help

2010-10-20 16:00 • by ;lkj (unregistered)
326135 in reply to 326112
Alex Papadimoulis:

setDataRecs( new DataRec( "a", "b", "c") )


What terrifies me is the thought that it may have been intended to use it like this:

setRecData("x", "string", "fish", "y", "int", "42");

Re: Overloaded Help

2010-10-20 16:03 • by ted (unregistered)
326136 in reply to 326031
boog:

Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users. Before I encountered it, if you had told me that it was possible to not be able to share projects (which simply amounts to setting a source and class path), would would not have believed you. Eclipse is everything that is wrong with Java, and its name even implies its darkness.

Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging? No other applications work like that.

My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!

I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?


I had not heard of this software before, so I looked it up. I didn't think it could possibly be as bad as you described. Then I saw that it was the product of FOSStards, and understood your position.

Re: Overloaded Help

2010-10-20 16:04 • by sino (unregistered)
326138 in reply to 326031
boog:
Anon:
Bob:
Max Peck:
Like was said earlier, a for loop. Does Java have a params type for passing multiple arguments in the formal parameter list? This one is nuts!


I think the intention is to prevent callers from having to do this (prior to Java 5):

setRecData(new String[] { "a", "b", "c" });

Instead, they can do this (for up to 30 trios of string arguments):

setRecData("a", "b", "c");

In Java 5, of course, all this becomes unnecessary. Perhaps some newbie looked at this code and wondered, "WTF?!" It is all perfectly logical, even if it is overkill.


Not sure that's much of a saving. Basically you have an extra "new String[] { " and an extra "}" to type in the first case, an extra burden that become completely insignificant as the number of arguments increases (it's a lot of extra guff for 1 argument, it's next to nothing for 30).
Plus, you lose the ability of the caller to create the array in...I don't know....maybe a for loop instead of manually typing out 30 arguments. Or in other words, doing on the caller side what the function should be doing on the callee side.

Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users. Before I encountered it, if you had told me that it was possible to not be able to share projects (which simply amounts to setting a source and class path), would would not have believed you. Eclipse is everything that is wrong with Java, and its name even implies its darkness.

Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging? No other applications work like that.

My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!

I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?
Could you maybe use this Eclipse to build something better? >XD

Re: Overloaded Help

2010-10-20 16:21 • by ted (unregistered)
326140 in reply to 326042
Beans:
boog:
Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

Surely all that behaviour can be changed in the config? Auto format and save behaviours are both configurable, aren't they?


And this is how the FOSSfuck begins. You spend hours... sometimes days reading forum post after forum post and trying all levels of absurd and random things until you find something that works. If you get one problem fixed, you cause another. Etc.

I've tried the latest popular linux distribution every 3 years or so for the last 15 years. Every time I try there is some new WTF. I spend days trying to get everything working right. I'm not sure why it strings me along for so long before I reinstall Windows... Perhaps it's because I always feel so close to getting it to work. Perhaps it's because of the time investment I've already put in it. Perhaps it's because I see all the potential, and just can't let go.

I've concluded that those that say they "dual boot" must boot into Windows to work on something and boot into linux to fuck around in a never-ending circle jerk of WTFs. That may explain why most screenshots of a linux desktop just show overlapping windows (some translucent) of shit on top of an image of a half naked objectified woman.

Did they ever ship a distribution with readable fonts? I don't care about howtos... Does one of the fucking distributions actually render good fonts in all windows with some sort of subpixel smoothing? And I mean right out of the box with no action on my part. Does it do proper DPI scaling if I choose? If so, then it may be time to try it again and check out the new WTFs.

Captcha: enim - reinstalling windows and blowing away the linux partition - works like an enim for your computer.

Re: Overloaded Help

2010-10-20 16:25 • by phreddy (unregistered)
Payed by the number of lines coded?

Re: Overloaded Help

2010-10-20 16:29 • by plaidfluff
I just love how he explicitly states 'throws Exception' every time.

Re: Overloaded Help

2010-10-20 16:43 • by ANonEMouse (unregistered)
Is the WTF here that the coworker didnt even use own makeStringArray method?


public void setRecData( String c01,String m01,String p01
,String c02,String m02,String p02
,String c03,String m03,String p03
,String c04,String m04,String p04
,String c05,String m05,String p05
,String c06,String m06,String p06
,String c07,String m07,String p07
,String c08,String m08,String p08
,String c09,String m09,String p09
,String c10,String m10,String p10
,String c11,String m11,String p11
,String c12,String m12,String p12
,String c13,String m13,String p13
,String c14,String m14,String p14
,String c15,String m15,String p15
,String c16,String m16,String p16
,String c17,String m17,String p17
,String c18,String m18,String p18
,String c19,String m19,String p19
,String c20,String m20,String p20
,String c21,String m21,String p21
,String c22,String m22,String p22
,String c23,String m23,String p23
,String c24,String m24,String p24
,String c25,String m25,String p25
,String c26,String m26,String p26
,String c27,String m27,String p27
,String c28,String m28,String p28
,String c29,String m29,String p29
,String c30,String m30,String p30
)
throws Exception
{
setRecData( makeStringArray( c01,m01,p01
,c02,m02,p02
,c03,m03,p03
,c04,m04,p04
,c05,m05,p05
,c06,m06,p06
,c07,m07,p07
,c08,m08,p08
,c09,m09,p09
,c10,m10,p10
,c11,m11,p11
,c12,m12,p12
,c13,m13,p13
,c14,m14,p14
,c15,m15,p15
,c16,m16,p16
,c17,m17,p17
,c18,m18,p18
,c19,m19,p19
,c20,m20,p20
,c21,m21,p21
,c22,m22,p22
,c23,m23,p23
,c24,m24,p24
,c25,m25,p25
,c26,m26,p26
,c27,m27,p27
,c28,m28,p28
,c29,m29,p29
,c30,m30,p30
)
);
}


Oh, wait, ...

Re: Overloaded Help

2010-10-20 16:48 • by Simon (unregistered)
326146 in reply to 326040
@Deprecated:
The Real WTF is spell checking your source code!!!


You kidding? If only it *did* spell check the code, and not just the comments and string constants. There are badly spelled variable and method names all though our product, even in public APIs...

Re: Overloaded Help

2010-10-20 16:49 • by boog
326147 in reply to 326140
ted:
And this is how the FOSSfuck begins. You spend hours... sometimes days reading forum post after forum post and trying all levels of absurd and random things until you find something that works. If you get one problem fixed, you cause another. Etc.

I've tried the latest popular linux distribution every 3 years or so for the last 15 years. Every time I try there is some new WTF. I spend days trying to get everything working right. I'm not sure why it strings me along for so long before I reinstall Windows... Perhaps it's because I always feel so close to getting it to work. Perhaps it's because of the time investment I've already put in it. Perhaps it's because I see all the potential, and just can't let go.

I've concluded that those that say they "dual boot" must boot into Windows to work on something and boot into linux to fuck around in a never-ending circle jerk of WTFs. That may explain why most screenshots of a linux desktop just show overlapping windows (some translucent) of shit on top of an image of a half naked objectified woman.

Did they ever ship a distribution with readable fonts? I don't care about howtos... Does one of the fucking distributions actually render good fonts in all windows with some sort of subpixel smoothing? And I mean right out of the box with no action on my part. Does it do proper DPI scaling if I choose? If so, then it may be time to try it again and check out the new WTFs.

Captcha: enim - reinstalling windows and blowing away the linux partition - works like an enim for your computer.

Hmm. It sounds like this whole Linux thing just doesn't work all that well for you. That sucks. I guess you'll just have to use Windows.

You know what doesn't work all that well for me? Windows. So I guess I'll just have to keep using Linux.

Funny how what works well for one person with unique personal preferences and work practices doesn't work quite the same for another person with completely different personal preferences and work practices. It's almost as if these alternatives exist just so that people can have the option to choose something that meets their individual needs.

Interesting. Well, have a good day.

Re: Overloaded Help

2010-10-20 16:56 • by Simon (unregistered)
All those functions, and he's not bothered to write javadocs for them. Terrible - how will anyone know what they're supposed to do? :)

Re: Overloaded Help

2010-10-20 16:57 • by super_ (unregistered)
introduce him to varargs please

Re: Overloaded Help

2010-10-20 17:16 • by pez (unregistered)
326150 in reply to 326120
Herby:
Alex:
The REAL WTF is that the methods don't go up to 40. 40 rec data's is an absolute minimum for me.

This is not as bad as it seems. In biblical times, the number '40' was often used as a synonym for infinite (like 40 days and 40 nights, etc.). Given that this is intended to accommodate ALL usage, it is a much better number.

I suspect that the original coder had no concept of infinity when they coded the first example though.

Today's lesson: "There are three ways to code for sets: none, one, and many".


But once you're at 40 how can you resist 41 and 42?

Re: Overloaded Help

2010-10-20 17:20 • by danixdefcon5
326151 in reply to 326112
Alex Papadimoulis:
TheCPUWizard:
One thing that most of the suggestions (all of them?) leave out is the compile time checking that the number of parameters is a multiple of 3....


I think that's a small WTF in and of itself. In a strongly-typed language like Java, it'd be trivial to build a struct or class that does the same thing, and require that as the parameters.

setDataRecs( new DataRec( "a", "b", "c") )

Requiring a certain multiple of parameters is a pretty confusing way to code.

Yup. The fun thing about this WTF is that many commenters suggest varargs, when the OO model solves this requirement for you:

public void setDataRecs( List<DataRec> recsToSet ) {
/* do something here */
}

where DataRec is an object containing the three strings. No need to spawn more overlords ;)

Re: Overloaded Help

2010-10-20 17:22 • by danixdefcon5
326152 in reply to 326136
ted:

I had not heard of this software before, so I looked it up. I didn't think it could possibly be as bad as you described. Then I saw that it was the product of FOSStards, and understood your position.

Ooooh!!! An anti-FOSS troll!

Eclipse is kind of open, but it is actually the spiritual successor to IBM's Visual Age. So it is really a fairly-decent IDE that turned into something really ugly... and then got opensourced.

Me? I prefer NetBeans.

Re: Overloaded Help

2010-10-20 17:26 • by danixdefcon5
326153 in reply to 326114
EvanED:
Severity One:
The other WTF is the 'throws Exception', which is saying that something might go wrong in this method, but you don't know what, and you've removed the possibility for the user of the method to distinguish between compile-time and run-time exceptions.

"throws Exception" is pretty far from a WTF; there are plenty of active debates on the merits and demerits of checked exceptions. I tend to fall more on the side of checked exceptions, but the issue is far from settled.

The war on checked vs. unchecked Exceptions has not been settled, but one thing I do know is that "throws Exception" code breaks the code that actually cares about Exceptions, as now I have to surround the offending function call with a try/catch block. If you really, really want to do this, that's what unchecked exceptions are for.

Trying to make Java act like C# is like programmers using goto to make C look like those old GOTO-ridden languages of yore.

Re: Overloaded Help

2010-10-20 17:38 • by MarkJ
326154 in reply to 326000
Disgruntled Former Employee:
Coders with this disease cannot be dealt with using sarcasm. The only way is to confront them directly. If they fail to get the point, you clean up after them by deleting their useless code and hoping they get the point or escalate the issue to management.
+1

Re: Overloaded Help

2010-10-20 17:44 • by Somebody (unregistered)
Losers.

Captcha: populus

Populated by losers such as yourselves.

Worst WTF evar.

Re: Overloaded Help

2010-10-20 18:54 • by George of the Jungle (unregistered)
Wait, let me get this right. He can write VB code by copy-and-paste, but hasn't graduated to a knowledge of loops? And he gets paid to do this by your company? Geez, I get a chance to teach this to 10 high school freshmen in a 5 day week. What should I tell them is the salary range for their advanced knowledge?

Re: Overloaded Help

2010-10-20 18:56 • by Spike (unregistered)
Normally i wouldn't even attempt to justify an abomination such as this, but the code does have one advantage:

it enforces that that the number of parameters is a multiple of 3 at compile time; a vararg implementation could do this check at runtime, but not compile time.

That said its still a stupid shitty way of doing things. If the multiple of 3 requirement *MUST* be checked at complie time a better strategy would be to only have the first 3 param, version and call it multiple times. If the records *MUST* be inserted at once, one could make a helper class with a 3 param AddRec method which builds the array, and a CommitRec method that actually calls setRecData(String[]).

Though with that said, those 3 requirements do seem arbitrary but its hard to tell without knowing the context.

While still a huge WTF, its possible this is the only way the origonal coder could figure to satisfy those requirements be they real or imaginied.

Re: Overloaded Help

2010-10-20 19:18 • by Your Name * (unregistered)
326158 in reply to 326022
You Jackwagon:
frits:
Clearly he should've used recursion.

BTW, Where's the definition of setRecData(String[])?

Clearly you don't understand recursion.


function Recursion(){
if(confirm('Do you understand recursion?')){//if yes
msgBox('Good for you.');
}
else //if no
{
Recursion();
}
}

=D

Captcha - Minim = Latin for 30, the number of times you do something before you understand you've wasted your time.

Re: Overloaded Help

2010-10-20 19:23 • by jk (unregistered)
This guy puts the grunt in grunt work...

Re: Overloaded Help

2010-10-20 19:40 • by Michael Chandler (unregistered)
public void setRecData(String... args) throws Exception
{
setRecData(args);
}

Done.


Re: Overloaded Help

2010-10-20 20:40 • by Dittybop (unregistered)
326161 in reply to 326101
jasmine2501:
Mark:
Steve:
The real WTF is that he put the commas on the left... who does that???

Agreed, that's really dumb. A comma marks the end of a clause so it should be after the clause it delimits, not before the next one on the next line. Very weird style, glad I don't work with this guy.


You see it all the time in SQL - it allows you to delete a line or comment a line in a big column list, without causing a syntax error...

select col1,
col2,
col3 --you can't comment out this line
from table

select col1
,col2
,col3 --now you can comment it without an error
from table

+1

Yeah, I do this all the time for various languages that have similar syntax...which is more or less all of them.

to OP: If you want your commas to look like English, I hear there is still demand for COBOL programmers.

db

Re: Overloaded Help

2010-10-20 20:59 • by John Hardin (unregistered)
326163 in reply to 326120
Herby:
Today's lesson: "There are three ways to code for sets: none, one, and many".

ITYM "none, one and too many".

Re: Overloaded Help

2010-10-20 21:39 • by hoodaticus
In VB, you'd write one version with a parameter array and be done with it...

Oh nevermind, C# can do that trick too.

Re: Overloaded Help

2010-10-20 22:36 • by Dave (unregistered)
I love the fact that you asked him about 20 sets, and he then went and catered for 30. That's going the extra mile ><.

Re: Overloaded Help

2010-10-21 01:11 • by EmperorOfCanada (unregistered)
What about negative one sets?

Re: Overloaded Help

2010-10-21 01:18 • by Markp
326173 in reply to 326031
boog:
Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines.

Most Java developers hate arrays too and encourage you to stay away from them for all but a certain, limited set of scenarios. But the "problems" you documented are easy to configure around.

I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project

Turn off Build Automatically; two mouse clicks.

and pop up windows to tell you that the code you already know is incomplete will not compile.

I've never in my lifetime seen Eclipse pop up a window for compiler errors. I think I have seen popups for when you try to run with code that doesn't compile, but that's a different issue.

One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users.

I've never had any trouble sharing projects. You obviously have to remove any absolute referencing but past that you can check in the .project and .classpath files just like any other files.


Eclipse is everything that is wrong with Java, and its name even implies its darkness.

I don't mind people having strong negative opinions of an IDE. But it does bug me when they don't know what the hell they're talking about because they didn't spend 5 minutes trying to "fix" the things they perceived as "problems."

Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging?

You don't. Since I have a two-monitor environment my first action in a new workspace is to set up a two-monitor perspective that is optimized for everything I need to do on a day-to-day basis. On one monitor, real estate is precious so they provide a few different perspectives to optimize the screen for particular modes. Nothing's forcing you to keep them.

No other applications work like that.
Actually, many other applications work like that.

My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!


If something's broken, log a bug. It's software, it's not perfect. That said I've never experienced this so my best guess is you have a plugin that's providing a conflicting hotkey for CTRL-C under certain modes. Check under Window->Preferences->General->Keys, sort by Bindings and see if there's any duplicates for CTRL-C.

I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

Me. But in this case, I would suggest trying to work with it for a bit before dismissing your tool entirely. Almost everything you just mentioned is stuff that can be configured in about 3 minutes.

Re: Overloaded Help

2010-10-21 01:23 • by Markp
326174 in reply to 326134
cod3_complete:
Another thing that sucks about Eclipse is you can't open two projects (workspaces) at once without jumping thru hoops.


You can open two projects at once without a problem. You can't open two workspaces at once. They are different concepts in Eclipse. And it bugs me too that the same binary can't be used to open to workspaces at once. Eclipse uses working sets for this issue though (define a working set over all the "projects" of your first "project", and interact with that). Unfortunately working set usefulness is pretty limited.

Re: Overloaded Help

2010-10-21 01:50 • by The 2-Belo (unregistered)
326176 in reply to 326120
Herby:
Alex:
The REAL WTF is that the methods don't go up to 40. 40 rec data's is an absolute minimum for me.

This is not as bad as it seems. In biblical times, the number '40' was often used as a synonym for infinite (like 40 days and 40 nights, etc.). Given that this is intended to accommodate ALL usage, it is a much better number.

I suspect that the original coder had no concept of infinity when they coded the first example though.

Today's lesson: "There are three ways to code for sets: none, one, and many".


So I'm infinite years old. No wonder I'm tired.

CAPTCHA: illum. Speaking Latin so much it makes you sick.

Re: Overloaded Help

2010-10-21 02:14 • by Concerned of Tunbridge Wells (unregistered)
why is he still allowed to code?
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Add Comment