|
#ifdef NDEBUG
static
#endif
int _counter;
When the freakin' debugger doesn't allow you to see file scoped symbols.
|
|
|
|
|
This one I planed for tomorrow for Lounge *grrr*
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Dirty is the normal way in C.
If there's any other way, please explain.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Here's some of my C goodness from the late 90s:
# ifdef __OVERRIDE__
# ifdef strlen
# undef strlen
# endif
# define strchr(str,ch) str_chr ( str , ch , CASE_SENSITIVE , NULL , NULL )
# define strcat(str1,str2) str_ncat ( str1 , str2 , 0 )
# define strcmp(str1,str2) str_ncmp ( str1 , str2 , 0 , CASE_SENSITIVE )
# define strlen(str) str_len ( str )
# define strncat(str1,str2,n) str_ncat ( str1 , str2 , n )
# define strncmp(str1,str2,n) str_ncmp ( str1 , str2 , n , CASE_SENSITIVE )
# define strrchr(str,ch) str_rchr ( str , ch , CASE_SENSITIVE , NULL , NULL )
# define strstr(str1,str2) str_str ( str1 , str2 , CASE_SENSITIVE , NULL , NULL )
# endif
|
|
|
|
|
Oh yes something like this I also remember
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Today I had to call a function taking two int pointer arguments for returning some stuff. But I wasn't interested in those returned values (I tried with 2 nullptrs but fail) so:
int result = peskyFunction(new int,new int);
|
|
|
|
|
Won't those two int's leak?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Absolutely (100% incontinence) but:
1) it was some demo PoC
2) that function is initialization stuff so it will only leak once (or rather twice )
|
|
|
|
|
I'm almost certain everyone here is dirty. This is all that it takes:
(void*)pValue
It's even more exciting (meaning dirty) coming out the other end...
|
|
|
|
|
I think most programmers aren't to keen on personal hygiene
My blog[ ^]
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Concerning "personal code hygiene" I have other experience. I was always the "only" one who was prepared to do such dirty "fixes"
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Wow, where I come from people don't even recognize dirty
Unfortunately, in software development, dirty is often a synonym for practical
My blog[ ^]
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Quick, not practical.
Reusable is practical.
|
|
|
|
|
Jörgen Andersson wrote: Reusable is practical. One word: YAGNI... Or is that five words?
My blog[ ^]
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Here's another dirty trick:
objects that are only created at program start up don't need to be deleted (because all memory is freed after application close)
Don't cringe - we are talking about dirt after all!
|
|
|
|
|
Thank you for this!
I think next discussion I will start is "program dirty to me", but I think than I have to move to soapbox
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Bruno Sprecher wrote: pragmatic
Right.
Explaining "handedness" in under 488 pages of English translation when all one really needs to mention is that what's at operation is a conspirator's dirk or a brother's rock.
|
|
|
|
|
Thank you
modified 19-Jan-21 21:04pm.
|
|
|
|
|
CNX[^].
Part of the OpenStax[^] Ecosystem.
These books are top-notch and high quality.
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
---
Do questions with multiple question marks annoy you???
|
|
|
|
|
Very cool!
Will Rogers never met me.
|
|
|
|
|
Yes, they are. My Psych class is using one. That's how I learned about the site.
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
---
Do questions with multiple question marks annoy you???
|
|
|
|
|
I went to the site, and tried searching C#: no results. I tried selecting the subject-area "Science and Technology" from the subject-area selector drop-down: a minute later still no results presented.
I tried entering "programming" in the search field: about a minute later a variety of results presented including "Independence for Texas" and other clearly non-science/technology related entries which, of course, just means they are doing a word-usage search.
I'd say the site has a ways to go.
But, why don't you list this in the "Free Tools" forum here ?
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
|
Hi Ranjan,
I think that site is making pirated copies available, suggest you re-consider posting link.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
Hi BillWoodruff,
Yes I believe so. Based on the below quote, I thought it's fine for personal use. These days it's so difficult to say what is legal and illegal. Not sure how this site is running? Sounds crazy and I don't understand their intent in hosting ebooks.
IT Books Quote: Reproduction of site books is authorized only for informative purposes and strictly for personal, private use.
Ranjan.D
|
|
|
|