At least you're not refactoring whatever the fuck it is I'm refactoring. My god mix match of using statements and straight declarations and calling dispose manually.
What the fuck kind of monster made this?
What's wrong with calling dispose manually? :P Not everything can be wrapped in a using() clause.
In this case, yes.
It is litreally:
MyClass obj = new MyClass(stuff);
obj.PerformAction();
while(obj.Results().Read())
{
//do more stuff
}
obj.Dispose();
everywhere
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited April 2012
@Bowen: Well yeah, that's pretty terrible. I was thinking of cases where the lifetime of the object exceeds scope barriers...but that's just silly what you pasted. It's also completely exception unsafe, as one exception in there will pass over the dispose.
Well yeah, that's pretty terrible. I was thinking of cases where the lifetime of the object exceeds scope barriers...but that's just silly what you pasted. It's also completely exception unsafe, as one exception in there will pass over the dispose.
Yeah I'd be okay with that.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
From a user standpoint Sharepoint is downright awful. But I think part of my view is because it keeps being used for things here that I don't think it was designed for. Exacerbated by the fact that we currently have other tools that are designed for those things.
Plus, I think the "developers" are "whatever random supervisor gets around to it", and no one tries to make sure everything stays organized and current.
Also it's almost always slower than hell. Or is that just our Sharepoint server?
Ours is slow, but not unbearably so, most of the time. Unless there's a lot of entries on a single page, or it has to sort through a lot of entries.. Which there sometimes can be, since one of the things we use it for a ticketing system. (It simply refuses to try and filter our dispatch ticket page)
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Sharepoint is just bad, you really don't need to justify it. The entire idea is flawed at a pretty basic level...kind of like BizTalk. It's classic Microsoft really, over designed, heavy as shit, not really very good at the core problem it's trying to solve...but enough white papers and tech salesman to get your non-technical suits to buy in 100% and force it down your throat.
Also it's almost always slower than hell. Or is that just our Sharepoint server?
The recommended best practices for good performance SharePoint 2010 requires you building your own data center.
I chuckled at this, and then realized you might be serious. O_O
The deploy I was involved in, you needed at least 5 distinct servers for "baseline performance and availability" and you could add 4 more if you were going with the enhanced searching system.
I think the effective minimum is 2 distinct servers but I wouldn't want to be working with those if something went wrong. :rotate:
A lot of system dependencies and differences between servers means you need distinct installs, so virtualization comes in handy, but the resources are still pretty high demand per server. DLL/GAC issues will fuck you if you try to put too many of the SP server roles on one install, just like how installing MS Office on an Exchange Server used to break the Exchange Server. :rotate:
You add servers as needed if you want more performance, redundancy, or features (such as enterprise search).
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
This is Tim Douchens reporting for ABC 15 News. We're down at the mayors office today to hear his announcement that Sharepoint is "fucking terrible". We asked his press secretary if the mayor was going to reveal anything else, and she said "No, just that Sharepoint is fucking terrible, as the release says".
At least you're not refactoring whatever the fuck it is I'm refactoring. My god mix match of using statements and straight declarations and calling dispose manually.
What the fuck kind of monster made this?
What's wrong with calling dispose manually? :P Not everything can be wrapped in a using() clause.
In this case, yes.
It is litreally:
MyClass obj = new MyClass(stuff);
obj.PerformAction();
while(obj.Results().Read())
{
//do more stuff
}
obj.Dispose();
everywhere
Why wouldn't they use the using() statement in such a situation?
Because they hate me. Or, they didn't know using existed. It was some old .NET 1.0 codeish that was ported to 2, then to 3, and now I have the blessing to refactor it!
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited April 2012
Even that's not an excuse, using was an original keyword, both as a scoped disposal construct and a namespace importer. It's been there since C#/.NET 1.0 beta, at the very least (that's when I first touched C#).
At least you're not refactoring whatever the fuck it is I'm refactoring. My god mix match of using statements and straight declarations and calling dispose manually.
What the fuck kind of monster made this?
What's wrong with calling dispose manually? :P Not everything can be wrapped in a using() clause.
In this case, yes.
It is litreally:
MyClass obj = new MyClass(stuff);
obj.PerformAction();
while(obj.Results().Read())
{
//do more stuff
}
obj.Dispose();
everywhere
Why wouldn't they use the using() statement in such a situation?
That is how I would write C# code as a C++ programmer without any research on what C# can do. That or I would do the nasty C++ version of using() by wrap the entire think in { } and allocate obj on the stack.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
I would use a smart pointer in C++ personally. Probably boost::scoped_ptr.
I would use a smart pointer in C++ personally. Probably boost::scoped_ptr.
In my mind overkill as you can easily see the scope. I would do
MyClass* obj = new MyClass(stuff);
obj.PerformAction();
while(obj.Results().Read())
{
//do more stuff
}
delete obj;
or
{ //scope obj for while loop only
MyClass obj(stuff);
obj.PerformAction();
while(obj.Results().Read())
{
//do more stuff
}
}
The top one isn't even remotely exception safe. The bottom one I can kind of get behind, but the top one screams "use scoped_ptr", because of exception and long jump safety.
I still don't like that...This appears to do lots of stuff. I would probably attempt to refactor it out more, potentially into its own class. You essentially have 2 actions you are doing. First you are doing something then you processing the results of that action.
// calling code
using(MyClassProcessor process = new MyClassProcessor(new MyClass(stuff))
process.Run();
class MyClassProcess : IDisposable
{
private MyClass myClass;
public MyClassProcess(MyClass obj)
{
myClass = obj;
}
public void Dispose()
{
myClass.Dispose();
}
public void Run() {
DoAction();
ProcessResults();
}
private void DoAction();
private void ProcessResults(); // If this is really complex it might be worth while breaking out into its own class
}
Probably could refactor out more stuff, if the pattern is repeated as often as you say, you may be able to abstract a lot of things out and get some good reuse out of it.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Use lambdas and generics to make it completely reusable. For instance, let them pass the "what happens when I run?" to the Run method as a System.Action.
Use lambdas and generics to make it completely reusable. For instance, let them pass the "what happens when I run?" to the Run method as a System.Action.
Head First C# came in the mail today. So juvenile, but so perfect.
3DS Friendcode 5413-1311-3767
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
During my internship I had a guy complain when I was using lambdas because I was trying to "get fancy".
I had several design disagreements with him, which is hard for me because I know my design skills are weak at best, so its hard to know when I'm talking to someone who knows better and when I'm talking to someone who is even worse.
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Lambdas are only "getting fancy" to people who don't understand them or what they offer. Sounds to me like someone who grew up in a different era of programming and isn't comfortable with "new fangled" constructs.
If his argument is that you can misuse them, the simple counter argument is that you can misuse anything.
Lambdas are only "getting fancy" to people who don't understand them or what they offer. Sounds to me like someone who grew up in a different era of programming and isn't comfortable with "new fangled" constructs.
Yeah... those new fangled... lambdas.
(I realize you no doubt know that's not the case, but I still felt it had to be mocked. :P)
@Urahonky I know you're still Javaing this thing, but if you've been fighting with GUI stuff for a while, and are also trying out Python, the wxPython demo is pretty cool for a lark if nothing else. I don't know if you looked at it all, but it's just a program that has a sample of (I think) every widget, with some combinations of widgets, advanced uses of some, some grouped by recently added. And on each widget sample you can click a button to view the source code, and edit it right in the program and see your changes (or bugs) right there.
Just a quick question about standards, what would acceptable usage of author tags in a college project? Every class or every method?
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
@TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
0
Options
TavIrish Minister for DefenceRegistered Userregular
Just a quick question about standards, what would acceptable usage of author tags in a college project? Every class or every method?
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
Nothing was specified by the lecturer, I just want my contribution to be very clear since some of the team members aren't really pulling their weight. However, I didn't want it to be obnoxious to whoever ends up correcting it.
Just a quick question about standards, what would acceptable usage of author tags in a college project? Every class or every method?
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
Nothing was specified by the lecturer, I just want my contribution to be very clear since some of the team members aren't really pulling their weight. However, I didn't want it to be obnoxious to whoever ends up correcting it.
I almost expect those kinds of tags to be ignored by your graders. If there really is a problem with team members not pulling their weight, I think the more prudent course of action is to contact the instructor directly and ask them how they expect you to deal with it. In my particular case, I usually tell students to try to work it out themselves and if there is a continued problem, to send me a private note along with their submission outlining where things broke down.
@TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
0
Options
TavIrish Minister for DefenceRegistered Userregular
Just a quick question about standards, what would acceptable usage of author tags in a college project? Every class or every method?
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
Nothing was specified by the lecturer, I just want my contribution to be very clear since some of the team members aren't really pulling their weight. However, I didn't want it to be obnoxious to whoever ends up correcting it.
I almost expect those kinds of tags to be ignored by your graders. If there really is a problem with team members not pulling their weight, I think the more prudent course of action is to contact the instructor directly and ask them how they expect you to deal with it. In my particular case, I usually tell students to try to work it out themselves and if there is a continued problem, to send me a private note along with their submission outlining where things broke down.
We already went to the lecturer, he said we were supposed to get on the backs on the guys who were doing no work (Which we tried and it didn't work) and that if we submit as good a project as we can and thoroughly document who did what work in our final report and in our code, we'll be graded accordingly.
Just a quick question about standards, what would acceptable usage of author tags in a college project? Every class or every method?
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
Nothing was specified by the lecturer, I just want my contribution to be very clear since some of the team members aren't really pulling their weight. However, I didn't want it to be obnoxious to whoever ends up correcting it.
I almost expect those kinds of tags to be ignored by your graders. If there really is a problem with team members not pulling their weight, I think the more prudent course of action is to contact the instructor directly and ask them how they expect you to deal with it. In my particular case, I usually tell students to try to work it out themselves and if there is a continued problem, to send me a private note along with their submission outlining where things broke down.
We already went to the lecturer, he said we were supposed to get on the backs on the guys who were doing no work (Which we tried and it didn't work) and that if we submit as good a project as we can and thoroughly document who did what work in our final report and in our code, we'll be graded accordingly.
Sounds consistent then with what I would expect. By "thoroughly document", you probably want a separate text document outlining contributions because just @author tags alone won't necessarily convey what you want in a concise, easy-to-read manner.
@TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
@Urahonky I know you're still Javaing this thing, but if you've been fighting with GUI stuff for a while, and are also trying out Python, the wxPython demo is pretty cool for a lark if nothing else. I don't know if you looked at it all, but it's just a program that has a sample of (I think) every widget, with some combinations of widgets, advanced uses of some, some grouped by recently added. And on each widget sample you can click a button to view the source code, and edit it right in the program and see your changes (or bugs) right there.
Yeah I'm currently using wxWidgets for C++ and quite enjoy it. Though some of their examples are way too complex for me being a beginner. However I will be looking at wxPython for GUI stuff to play around with.
Posts
As a user? That isn't nearly enough expletive rage to indicate you've touched development yet.
Yeah JUST as a user. How is it like 50 clicks just to copy a file over to another folder? HOW DOES THAT MAKE SENSE?
In this case, yes.
It is litreally:
everywhere
Yeah I'd be okay with that.
Plus, I think the "developers" are "whatever random supervisor gets around to it", and no one tries to make sure everything stays organized and current.
The recommended best practices for good performance SharePoint 2010 requires you building your own data center.
Ours is slow, but not unbearably so, most of the time. Unless there's a lot of entries on a single page, or it has to sort through a lot of entries.. Which there sometimes can be, since one of the things we use it for a ticketing system. (It simply refuses to try and filter our dispatch ticket page)
I chuckled at this, and then realized you might be serious. O_O
The deploy I was involved in, you needed at least 5 distinct servers for "baseline performance and availability" and you could add 4 more if you were going with the enhanced searching system.
I think the effective minimum is 2 distinct servers but I wouldn't want to be working with those if something went wrong. :rotate:
A lot of system dependencies and differences between servers means you need distinct installs, so virtualization comes in handy, but the resources are still pretty high demand per server. DLL/GAC issues will fuck you if you try to put too many of the SP server roles on one install, just like how installing MS Office on an Exchange Server used to break the Exchange Server. :rotate:
Yeah, looks like I remember correctly!
You add servers as needed if you want more performance, redundancy, or features (such as enterprise search).
We'll be back at six to report more.
Why wouldn't they use the using() statement in such a situation?
That is how I would write C# code as a C++ programmer without any research on what C# can do. That or I would do the nasty C++ version of
using() by wrap the entire think in { } and allocate obj on the stack.
In my mind overkill as you can easily see the scope. I would do
or
The top one isn't even remotely exception safe. The bottom one I can kind of get behind, but the top one screams "use scoped_ptr", because of exception and long jump safety.
I still don't like that...This appears to do lots of stuff. I would probably attempt to refactor it out more, potentially into its own class. You essentially have 2 actions you are doing. First you are doing something then you processing the results of that action.
Probably could refactor out more stuff, if the pattern is repeated as often as you say, you may be able to abstract a lot of things out and get some good reuse out of it.
I had several design disagreements with him, which is hard for me because I know my design skills are weak at best, so its hard to know when I'm talking to someone who knows better and when I'm talking to someone who is even worse.
If his argument is that you can misuse them, the simple counter argument is that you can misuse anything.
Yeah... those new fangled... lambdas.
(I realize you no doubt know that's not the case, but I still felt it had to be mocked. :P)
But then, we have our own datacenter....
The standards for a college project are what your instructor wants. In lieu of that, stick with the general practice which is by-class author tags. Although, you could debate about the usefulness/widespreadness of using that level of Javadoc in code to begin with.
Nothing was specified by the lecturer, I just want my contribution to be very clear since some of the team members aren't really pulling their weight. However, I didn't want it to be obnoxious to whoever ends up correcting it.
I almost expect those kinds of tags to be ignored by your graders. If there really is a problem with team members not pulling their weight, I think the more prudent course of action is to contact the instructor directly and ask them how they expect you to deal with it. In my particular case, I usually tell students to try to work it out themselves and if there is a continued problem, to send me a private note along with their submission outlining where things broke down.
We already went to the lecturer, he said we were supposed to get on the backs on the guys who were doing no work (Which we tried and it didn't work) and that if we submit as good a project as we can and thoroughly document who did what work in our final report and in our code, we'll be graded accordingly.
Sounds consistent then with what I would expect. By "thoroughly document", you probably want a separate text document outlining contributions because just @author tags alone won't necessarily convey what you want in a concise, easy-to-read manner.
Yeah I'm currently using wxWidgets for C++ and quite enjoy it. Though some of their examples are way too complex for me being a beginner. However I will be looking at wxPython for GUI stuff to play around with.