|
While we're talking, couldn't a asm programmer use inline asm{} as the entire code and claim it to be C++ code? (or something like that)
Dim SomethingAboveMyHead As LightBulb<br />
Let Go = Grip.Release()
|
|
|
|
|
You mean declaring classes as usual, but then using inline assembly only in the implementation of the methods? Yes, that's certainly possible, but does not make much sense.
90% or even more of the code would not benefit very much from assembly code, so why make it harder to read without a gain? Take the user interface. It usually is idle while waiting for some event to occur. Then it briefly handles the events and sits there and waits for the next event again. Handling events comes in two flavors: Quick enough (so why use assembly?) or much too long. Often so much too long, that no optimization can bring it into the quick enough category. Opening and synchronizing a worker thread for this is certainly better done in C++. If the execution time of this thread then still is an issue, assembly optimization at a few well-selected spots may do the trick. The rsult is a much more maintainable and readable code. Also, there is still the option to use an assembler to write critical functions and to link the object files with your C++ project.
Personally, I don't like mixing up different languages in one source file. My best argument against it is a typical PHP script with HTML, PHP and occasionaly embedded JavaScript merrily mixed into one ugly spaghetti code. I would even prefer to use Visual Basic and gladly suffer all the consequences than ever to do serious work with PHP.
|
|
|
|
|
REPLACE(dvel.Notes, '
', ' ')
T-SQL: Replaces newline with space.
Last modified: 4hrs 41mins after originally posted --
Pits fall into Chuck Norris.
|
|
|
|
|
In what language?
|
|
|
|
|
Sorry, T-SQL. Fixed now.
Pits fall into Chuck Norris.
|
|
|
|
|
Bah, small fries.
I've seen:
Something = ISNULL(somecolumn, NULL)
|
|
|
|
|
What if the newline was also followed by a carriage return. Would you end up with a sequence of space, carriage return? That's pretty bizarre.
|
|
|
|
|
It's replacing a 'literal' new line, so it would replace the CRLF combo with a space. The horror is not explicitly saying, DON'T REMOVE THIS LINE BREAK!
Pits fall into Chuck Norris.
|
|
|
|
|
\n would have been better here
|
|
|
|
|
Then the replace should happen before the data hits the database.
|
|
|
|
|
Technically, it is. The query is to extract data destined for a target database that doesn't like newlines. It's an edge case, as other target databases are happy with the newlines.
Pits fall into Chuck Norris.
|
|
|
|
|
Uah looks terrible.
|
|
|
|
|
I don't see it, obviously the guy who wrote that used XVI32 and doesn't see anything wrong with it...
|
|
|
|
|
Spacix
One wrote: doesn't see anything wrong with it...
That's the horror. What don't you see? The ambiguity between a line wrap and a line break in a SQL statement?
Pits fall into Chuck Norris.
|
|
|
|
|
Well, I mean the guy who wrote it must have been using a Hex editor and the link break was just another two bytes to him, as he could only see "0D 0A" which looks normal, to him...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Recently came across this gem.
<br />
protected void Foo()<br />
{<br />
PreProcess(arg);<br />
}<br />
<br />
<br />
private void PreProcess(string arg)<br />
{<br />
try<br />
{<br />
return;<br />
}<br />
catch(Exception ex)<br />
{<br />
}<br />
}<br />
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
Future extension?
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
|
|
|
|
|
probably the coder wants the program to do nothing..
.....
|
|
|
|
|
Spunky Coder wrote: probably the coder wants the program to do nothing
probably the coder do nothing wants to program.
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
|
|
|
|
|
Spunky Coder wrote: probably the coder wants the program to do nothing..
Just because it does nothing doesn't mean nothing can go wrong!
Steve
|
|
|
|
|
This is to catch the possibility of that the function failed to return.
The code in the catch should then be
protected void Foo()
{
PreProcess(arg);
}
private void PreProcess(string arg)
{
try
{
return;
}
catch(Exception ex)
{
main();
}
}
codito ergo sum
|
|
|
|
|
Yeah there are many exceptions that can be thrown by the return instruction...
|
|
|
|
|
The function will ALWAYS return. The try{ return; } are the first 3 lines in the method & where the PreProcess() is called is already wrapped in a try..catch block.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
like it...
try to return... if you fail, catch the exception and return...
if you can...
(yes|no|maybe)*
|
|
|
|
|
I cannot begin to imagine how the person who wrote this code thinks...
|
|
|
|