There should be a "programmers license"...
-
I have the strong opinion that software development should be a regulated and licensed profession, like advocacy, medicine, nursing, etc..., and your professional license could be revoked if you do things like this:
public ArrayList<DEVICEID> getDefaultDeviceObjects(int addr1, int addr2) { ArrayList<DEVICEID> deviceObjectsID = null; //Create DEVICEID list for hw change processing DEVICEID[] basicObjectsItems= { new DEVICEID(DeviceType.BASIC, addr1, addr2), new DEVICEID(DeviceType.BASIC_CTRL, addr1, addr2), //Note: basicext no longer relevant new DEVICEID(DeviceType.BASIC_EXT, addr1, addr2), }; int itemIndex = 0; if (basicObjectsItems!= null && basicObjectsItems.length > 0){ for (int i = 0; i < basicObjectsItems.length; i++){ if (basicObjectsItems[i] != null){ if (deviceObjectsID == null) deviceObjectsID= new ArrayList<DEVICEID>(); // add to deviceObjectsID (DEVICEIDs are sorted and duplicates are ignored) itemIndex = Collections.binarySearch(deviceObjectsID, basicObjectsItems[i]); if (itemIndex < 0) { // DEVICEID not yet found in list -> insert at position -itemIndex-1 deviceObjectsID.add(-itemIndex -1, basicObjectsItems[i]); } else if (itemIndex >= deviceObjectsID.size()){ // DEVICEID not yet found in list -> add at the end of the list deviceObjectsID.add(itemIndex, basicObjectsItems[i]); } } } } return deviceObjectsID; }
Real, production code, only datatypes and variable names replaced.
-
+1 for thinking!
+1000 for trolling!
-
silliness?
So... is that whole thing just creating a new DEVICEID[] with device objects and then running a loop to convert it to ArrayList<DEVICEID> for the return type....?
-
professional license could be revoked if you do thinks like this
Agreed; Egyptian brackets are deplorable.
-
-
@Nagesh, deplorable means 'should be tarred and feathered and never ever used again', it doesn't mean he doesn't know what to do with it.
-
-
Let me guess... the post is racist?
-
-
-
If I read it everyday, I'd probably be ok with it. But since coding standards here at work say no, I'm not used to it.
How about this (unrelated to this thread but very relevant to my current frustration) idiom - dynamic sql is evil even if it is (rarely) a necessity.
-
-
If I read it everyday, I'd probably be ok with it. But since coding standards here at work say no, I'm not used to it.
I have whitespace OCD, and an opening bracket on its own line gives me a stabbing pain behind my right eye. Also, elses on the same line after a closing bracket.
How about this (unrelated to this thread but very relevant to my current frustration) idiom - dynamic sql is evil even if it is (rarely) a necessity.
I agree with that. I cringe whenever I have to do something like that. Probably less physically painful than the bracket thing, though.
-
I have whitespace OCD, and an opening bracket on its own line gives me a stabbing pain behind my right eye. Also, elses on the same line after a closing bracket.
I dunno. I like it since I find it visually more clear where stuff starts and ends when you have nested blocks. I prefer brackets on their own line when I can choose, but use whatever is the convention if there is one. Qt's style is brackets on it own line for example.
@DrakeSmith said:
How about this (unrelated to this thread but very relevant to my current frustration) idiom - dynamic sql is evil even if it is (rarely) a necessity.
I agree with that. I cringe whenever I have to do something like that. Probably less physically painful than the bracket thing, though.
Working on expunging it from some of my stuff atm. Well, I hope it won't be too slow the way I'm trying to do it. I had no idea freaking MySQL chokes so much on joining views before. And I don't have the time to make a dummy copy and benchmark it in Postgres atm.
-
I tend to type Egyptian brackets, but never really care where they end up. I can read it easily either way. The Visual Studio IDE usually puts the opening bracket on its own line, though.
-
your professional license could be revoked if you do thinks like this:
"Thinks" like OOP?
-
I used to use Egyptian brackets, but new IDEs seem to all default to the other way in auto-correcting code format, and I haven't bothered to change it. Mainly just care about the indentation being uniform, as long as some asshat isn't alternating 3-space, 5-space, and tab indentations, everything is cool.
-
I tend to type Egyptian brackets, but never really care where they end up. I can read it easily either way. The Visual Studio IDE usually puts the opening bracket on its own line, though.
Actually you are thinking of Telerik JustCode that is doing this. If you use ReSharper, it work the way you configure it to.
-
Actually you are thinking of Telerik JustCode that is doing this. If you use ReSharper, it work the way you configure it to.
I have neither of those installed.
-
Thoughtcrime!
-
I have neither of those installed.
Then you are missing out on much productivity features. You should get one of them installed. Your productivity will zoom like speed of light coming from sun and hitting our planet earth at Sunrise.
-
Then you are missing out on much productivity features. You should get one of them installed. Your productivity will zoom like speed of light coming from sun and hitting our planet earth at Sunrise.
I do about 5 lines of .NET a week. Python is the future!
-
I do about 5 lines of .NET a week. Python is the future!
Guido approve this post!
-
I do about 5 lines of .NET a week. Python is the future!
So, how do you do your brackets in Python then?
-
With skill?
-
-
has no concept of bracket.
-
So, how do you do your brackets in Python then?
I thought it was done through indentation...
Or this:
if foo: #{ print "it's true" #} else: #{ print "it's false!" #}
-
Note to self: use more sarcasm tags.
-
Note to self: use more sarcasm tags.
Why? Thought my second one was rather appropriate...
-
Why? Thought my second one was rather appropriate...
No problems with that, but it just seemed to me multiple people thought I asked a serious question.
-
Oh, I realised it wasn't serious but in the spirit of taking one for the team, I asked what seemed like the obvious question...
-
No problems with that, but it just seemed to me multiple people thought I asked a serious question.
Does it make you feel better that at least I got it?
-
So, how do you do your brackets in Python then?
Brackets are for lists. Duh.
multiples_of_one = [1, 2, 3, 4, 5 ];
-
Where does that semicolon come from?
-
-
It only takes about 5 minutes to pick up.
-
I have the strong opinion that software development should be a regulated and licensed profession
Except that serial incompetence is demonstrably just as rife in already regulated and licensed professions.
-
Yes, yes but it would weed out the very worst, right? RIGHT?
-
Yes, yes but it would weed out the very worst, right? RIGHT?
@mikeTheLiar I think he just called you a weed.
-
No, @mikeTheLiar is the worst of the worst, a whole new level of worstness that a licence wouldn't deal with, or make weediness assertions thereof.
-
It only takes about 5 minutes to pick up.
And about 5 days for the cream to do something about clearing it up...
-
Man, I usually get a bit lost on the front page wtfs and only get the general idea, but on this one i can actually count them. I've got 7, plus the bonus one, the crazy solution to a problem that is common enough to have a utility method for it in the langage.
-
mylist = [1, 2, "string", [1,2,3]]
mydict = {"key":"value", "otherkey":None}def function(x): if x == 2: return True else: return mylist[0]+1
[spoiler]
[/spoiler]
[spoiler]
You already know Python
[/spoiler]
-
I do about 5 lines of .NET a week. Python is the future!
You only do 5 lines of Python a week?
Filed Under: IronPython trolling, we need a new tag cloud to attack
-
Yeah but that's an equivalent of 250 lines of C#.
Ok I'll end the troll as I personally root for Ruby.
-
Ok I'll end the troll as I personally root for Ruby.
Observe, a troll in it's natural habitat. See how he feigns defeat by saying the troll has ended, and then starts an even bigger one.
Truly, these creatures are a wonder of the Internet.
-
Yeah but that's an equivalent of 250 lines of C#.
That is like 1200 line in Java Code, but only if you refuse to use a SOLID framework like SPRING or STRUTS.
-
He, what did you expect ;-)
-
@agbeladem said:
Yeah but that's an equivalent of 250 lines of C#.
That is like 1200 line in Java Code, but only if you refuse to use a SOLID framework like SPRING or STRUTS.But that probably means adding 250 jars to your project.