Click here to Skip to main content

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralWhy not: // just shoot me!memberesaulsberry14hrs 58mins ago 
try
{
    account.Save();
}
catch { ; } //Not good!
Mad | :mad:
GeneralRe: Why not: // just shoot me!memberPualee13hrs 32mins ago 
At least there are comments.
GeneralRe: Why not: // just shoot me!protectorOriginalGriff12hrs 44mins ago 
I can think of a few comments myself...
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

GeneralRe: Why not: // just shoot me!memberPankaj Nikam4hrs 20mins ago 
Guess programmer was hungry thats why he "ate" the exception Big Grin | :-D
Always Keep Smiling.
Yours Pankaj Nikam

GeneralRe: Why not: // just shoot me!memberOshtri Deka1 hr 31mins ago 
Relax.
This is just sweeping under the rug.
 

It could be worse.
Mislim, dakle jeo sam.

GeneralCan't people read the form description anymore?memberRob Grainger16 May '13 - 3:20 
I notice that a fair few of the recent posts here seem out of place.
 
Can't people read?
 
ps. I guess that by posting this, I now have to include myself in that category, but I'm hoping to be indulged.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Can't people read the form description anymore?professionalPIEBALDconsult16 May '13 - 4:21 
Two wrongs don't make a right. Roll eyes | :rolleyes:
JokeRe: Can't people read the form description anymore?memberCarlos Fonseca16 May '13 - 4:31 
But three lefts do.
 
Poke tongue | ;-P
 
(well, someone had to do it!)
Quidquid latine dictum sit, altum viditur.

GeneralRe: Can't people read the form description anymore?professionalPIEBALDconsult16 May '13 - 4:37 
I resisted doing it myself.
GeneralRe: Can't people read the form description anymore?memberBobJanova16 May '13 - 4:43 
It was better when it was the Hall of Shame, if you ask me.
GeneralRe: Can't people read the form description anymore?memberDave Calkins16 May '13 - 7:41 
Most of the time I just click the links from the main page to get to various threads, having no idea which forum they're in or what on earth the forum description is if any Smile | :)
JokeRe: Can't people read the form description anymore?professionalRhys Gravell17 May '13 - 4:02 
Apparently some people can't even spell forum anymore let alone read a description about its purpose... Poke tongue | ;-P
Rhys
 
"If you ever start taking things too seriously, just remember that we are talking monkeys on an organic spaceship flying through the Universe"

GeneralRe: Can't people read the form description anymore?memberRob Grainger1 hr 13mins ago 
Well I had to have some kind of horror in their to justify posting to this forum Wink | ;-)
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralCode Safety and The .Net CLR & Java Runtime [modified]memberdusty_dex9 May '13 - 12:36 
Apologies if this subject has already been discussed before.
 
After stumbling upon last September's Best C# Article NET-CLR-Injection-Modify-IL-Code-during-Run-time and learning about endless security issues with the Java Runtime.
 
Are these platforms actually safer than conventional compiled executables?
 
Isn't the whole point of Data Execution Prevention (DEP) meant to stop run-time modification of running code? The CLR/JAVA Runtime engines have the only *native* code that DEP has any direct control of, but they are allowed to run without question, because of some dubious assumption that code for a virtual cpu/machine can do no real damage.
 
Maybe I'm wrong, but I can't help thinking that code under direct control of the 'real' cpu is safer than these virtualized runtime environments. Suspicious | :suss:
 
I'm not fully versed in .NET or Java coding. Anyone care to shed more light on the subject.



modified 9 May '13 - 20:02.

GeneralRe: Code Safety and The .Net CLR & Java RuntimememberLloyd Atkinson9 May '13 - 13:31 
dusty_dex wrote:
The CLR/JAVA Runtime are the only executable code DEP has any direct control of

 
Nope not true at all. It has full control over native code too. Also, don't forget that these runtimes are written in native code.
 
Just as a point of interest, some CPU's have a hardware based DEP[^]
           .-.
          |o,o|
       ,| _\=/_      .-""-.
       ||/_/_\_\    /[] _ _\
       |_/|(_)|\\  _|_o_LII|_
          \._./// / | ==== | \
          |\_/|"` |_| ==== |_|
          |_|_|    ||" ||  ||
          |-|-|    ||LI  o ||
          |_|_|    ||'----'||
         /_/ \_\  /__|    |__\

GeneralRe: Code Safety and The .Net CLR & Java Runtimememberdusty_dex9 May '13 - 13:57 
Sorry, my wording could have been clearer. D'Oh! | :doh:
 
[I've made a minor modification to the original post]
 
I know that the DEP handles *all* native code, but that's what I was getting at. The runtimes are native code but I wanted to know whether the MSIL code/ Java Bytecode is kept in the dcache or icache along with native code.
 
I thought native code, unless specifically marked as shared would otherwise be read-only and not modifiable at runtime. Which led me to wonder about the location .NET/Java bytecodes and the whole self-modifying code (code injection) problem, with the apparent side-stepping of DEP protection.
 
Smile | :)


GeneralRe: Code Safety and The .Net CLR & Java RuntimeprofessionalPIEBALDconsult9 May '13 - 16:09 
Wrong forum.
GeneralRe: Code Safety and The .Net CLR & Java Runtimememberdusty_dex9 May '13 - 23:55 
So which forum?
 
I based my decision on the WORST/BEST PRACTICES which is mentioned at the top.


GeneralLife of Software DevelopermemberJuhi Paunikar6 May '13 - 2:32 
I think the life of software developer is a nothing but "The journey between LOGIN & LOGOUT" Wink | ;)
What is your opinion??
eNJOY c0ding....

GeneralRe: Life of Software Developermemberradioman.lt6 May '13 - 3:41 
it's just a job, and it doesn't count as life Sniff | :^)
d{^__^}b - it's time to fly

GeneralRe: Life of Software DevelopermemberJuhi Paunikar6 May '13 - 20:18 
I agree it doesn't count life but it is not a part of life??
eNJOY c0ding....

GeneralRe: Life of Software Developermemberradioman.lt6 May '13 - 20:41 
it's a waste of life, mostly coding useless stuff D'Oh! | :doh:
d{^__^}b - it's time to fly

GeneralRe: Life of Software DevelopermemberJuhi Paunikar6 May '13 - 21:01 
I think you had something bad experience about cOding.
eNJOY c0ding....

GeneralRe: Life of Software Developermemberradioman.lt6 May '13 - 21:06 
i don't see whats so 'enjoyable', it's sunny warm day, and it's wasted sitting in the office... D'Oh! | :doh:
d{^__^}b - it's time to fly

GeneralRe: Life of Software DevelopermemberJuhi Paunikar6 May '13 - 21:14 
Take a break and spend time with friends and family.
it will remove your stress as you mentioned in you trailing message!!! Smile | :)
eNJOY c0ding....

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 21 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid