|
Thomas Weller wrote: It seems to me that your job is really really hard
Programming is never hard ( if it is programming )
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
AhsanS wrote: Programming is never hard
I fully agree. But psst, don't you tell this to a customer or boss...
AhsanS wrote: if it is programming
Is it ? Sounds more like refactoring/code review.
Regards
Thomas
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.
|
|
|
|
|
Re-factoring is part of programming i guess. isn't it?
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
Sure, you can see it that way...
Regards
Thomas
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.
|
|
|
|
|
|
I'm guessing the effect will be to replace that space with a newline if the Logic.DateConfigurer.DateFormatWithTime is "dd/MM/yyyy HH:mm"
|
|
|
|
|
You are wrong. It runs the same thing it gets as input. I was getting an error and i had to debug the code when i found it. that after doing all that stuff it was doing no change to original values.
Surprised????
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Did he set Environment.NewLine to a space?
|
|
|
|
|
Actually, "that" removes the 'seconds [and milliseconds]' part from entered datetime, so "2008-11-10 08:00:30.123" => "2008-11-10 08:00:00".
Ugly, I agree.
|
|
|
|
|
Depends on what "Logic.DateConfigurer.DateFormatWithTime" is.
|
|
|
|
|
It contains "DD MMM YYYY HH:mm:ss"
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
Then the format is changed too.
|
|
|
|
|
AhsanS wrote: What will you call this???
That.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
why not "What the hell is thatttttttttttt"
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
What will you call this?
A mess. Needs to be cleaned up and broken down a bit.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
And what if all this mess is totally of no use???
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
A compound-complex sentence.
|
|
|
|
|
*points and laughs*
Pointless. Really.
The DateTime class can can convert a string to date.
Separating the both dates must be done manually, but the conversion can be done by the DateTime class.
|
|
|
|
|
I was just going through block of code for refactoring and found this. I wonder why is this even allowed in .net framework? What is benefit of it after all?
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
namespace abc{
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
namespace abc{
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Did you paste your code twice, or is that what was actually inside the file?
|
|
|
|
|
I agree.
The using directive's only purpose is to save the developer keystrokes and obfuscate the code.
The only acceptable use for the using directive is to define an alias of a type.
And it has nothing to do with the .net framework; it's merely a compiler directive.
|
|
|
|
|
AhsanS wrote: namespace abc{
Is this really twice in the source or is it just a copy/paste mistake? If so, this code should not compile.
If not:
using statements can occur in one of two places:
- Above namespace declaration
- Inside namespace declaration, but outside any other element
This combined with the fact that duplicating a using directive is only treated as a warning not as an error, your code will compile - even if it's quite horrible indeed.
AhsanS wrote: What is benefit of it after all?
- It forces the developer to be explicit about what he's doing - always a good thing.
- Types with identical names can occur in more than one namespace. With using you can distinguish them properly.
(Take for example System.Windows.Forms.Timer vs. System.Threading.Timer ...).
Regards
Thomas
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.
modified on Thursday, November 6, 2008 12:30 PM
|
|
|
|
|
Thomas Weller wrote: - It forces the developer to be explicit about what he's doing - always a good thing.
- Types with identical names can occur in more than one namespace. With using you can distinguish them properly.
(Take for example System.Windows.Forms.Timer vs. System.Threading.Timer...).
I think you have that backward.
|
|
|
|
|
I'm afraid I don't get what you mean...
Regards
Thomas
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.
|
|
|
|
|
Using fully-specified names do what you say; not the using directive.
|
|
|
|