|
Me, I'm more 70's fusion when I code
Weather Report, Return To Forever, Jaco Pastorius, Al Dimeola, Mahavishnu Orchestra, Stanley Clark, Billy Cobham, Wayne Shorter, and oddly, the decidedly non-fusion Motorhead.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Brian C Hart wrote: Anyone else have any favorite music they listen to make them write code at hyper speed?
I'd love to have the ability, but I get distracted by music. It hinders, it doesn't help, my thought process.
The only time I'll listen to music while coding is when I'm writing the sort of boilerplate code I've written a million times before, and don't need to make any sort of intellectual effort.
But then, if I've written the same sort of code a million times before, I've probably wrapped it in some library and no longer need to do it. So the occasion rarely presents itself anymore.
|
|
|
|
|
I code in silence and debug to Godsmack.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
When winter stops and summer begins I switch from learning to code
to making things with my woodworking power tools track saw and table saw
I have never been good at listening to music and enjoying it
IF I AM FOCUSED on another task
Any way the debate comes up when ever a Woodworking YouTube channel
has a promotional sponsor for hearing protection head phones with Blue Tooth
here are some interesting facts from one respected YouTuber
Can you focus on work while music is playing? - YouTube[^]
The most relatable occupation that are avid listeners to music while working
are the Surgeons I have know many and the one who did reconstruction surgery on me
I have worked in 5 different states and hospitals
and had reconstructive surgery at UH Cleveland Medical Center
10 hours under the knife
Most times the music does not start till you are under anesthesia
|
|
|
|
|
|
Nope, can't do that. When I listen to music, it's a foreground task for me, and the more masterpiece it is, the more real time compute of my brain it needs. So no chance for Bach here. However any job that can itself be put into background, like driving or washing dishes, I have to have something for the foreground!
PS: Brandenburg Concerto is amazing
|
|
|
|
|
I wouldnβt say for speed, but for depth/focus/concentration, I tend to drumming (world drum, tribal, Native American, etc.) or trance/edm. As others have mentioned, lyrics get distracting.
I do have some classical (Bach Cello Suites, Beethoven (Walter Weller), and Paganini (Itzhak Perlman)). Will have to try some of that.
Time is the differentiation of eternity devised by man to measure the passage of human events.
- Manly P. Hall
Mark
Just another cog in the wheel
|
|
|
|
|
It depends on how intense my concentration has to be. For reasonably routine coding, I listen to my usual music playlist, which happens to include things like Switched On Bach. When it gets more intense, I'll switch to new age (e.g., Diane Arkenstone). But if it's really at the limit of what I can do, I need absolute silence.
That doesn't happen very often but it does happen.
|
|
|
|
|
Wordle 1,058 3/6
β¬π¨β¬β¬π¨
π¨π¨π¨π¨π¨
π©π©π©π©π©
|
|
|
|
|
Wordle 1,058 4/6*
β¬π¨π¨β¬π¨
β¬π¨β¬π©π©
π©π¨β¬π©π©
π©π©π©π©π©
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
β¬π¨β¬β¬π¨
β¬β¬π¨π¨β¬
π©π©π©π©π©
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,058 4/6
β¬β¬🟨β¬β¬
β¬🟨β¬β¬β¬
🟩🟨β¬🟩🟩
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 1,058 5/6
π¨π©β¬β¬β¬
β¬π©β¬β¬β¬
β¬β¬π¨β¬π¨
π¨π©π¨π¨β¬
π©π©π©π©π©
|
|
|
|
|
Wordle 1,058 6/6
β¬β¬β¬π©π¨
β¬π¨π¨π©β¬
β¬π©π¨π©π¨
β¬π©π©π©π©
β¬π©π©π©π©
π©π©π©π©π©
|
|
|
|
|
Wordle 1,058 4/6*
β¬🟨🟨β¬🟨
🟩🟨β¬🟩🟩
🟩β¬🟩🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Gotos are frowned on. You should not use gotos. Long live gotos.
Until someone comes up with a better/faster/concise way of expressing the following DFA state machine (presented in part) I will continue to defend the use of gotos, even if their use cases have gotten significantly more narrow as progress has marched on.
When you need them, there is no better tool.
internal sealed partial class JsonStringRunner : FAStringRunner {
private FAMatch NextMatchImpl(string s) {
int ch;
int len;
int p;
int l;
int c;
ch = -1;
len = 0;
if ((this.position == -1)) {
this.position = 0;
}
p = this.position;
l = this.line;
c = this.column;
this.Advance(s, ref ch, ref len, true);
if (((((ch >= 9)
&& (ch <= 10))
|| (ch == 13))
|| (ch == 32))) {
this.Advance(s, ref ch, ref len, false);
goto q1;
}
if ((ch == 34)) {
this.Advance(s, ref ch, ref len, false);
goto q2;
}
if ((ch == 44)) {
this.Advance(s, ref ch, ref len, false);
goto q9;
}
if ((ch == 45)) {
this.Advance(s, ref ch, ref len, false);
goto q10;
}
if ((ch == 48)) {
this.Advance(s, ref ch, ref len, false);
goto q11;
}
if (((ch >= 49)
&& (ch <= 57))) {
this.Advance(s, ref ch, ref len, false);
goto q17;
}
if ((ch == 58)) {
this.Advance(s, ref ch, ref len, false);
goto q18;
}
if ((ch == 91)) {
this.Advance(s, ref ch, ref len, false);
goto q19;
}
if ((ch == 93)) {
this.Advance(s, ref ch, ref len, false);
goto q20;
}
if ((ch == 102)) {
this.Advance(s, ref ch, ref len, false);
goto q21;
}
if ((ch == 110)) {
this.Advance(s, ref ch, ref len, false);
goto q26;
}
if ((ch == 116)) {
this.Advance(s, ref ch, ref len, false);
goto q30;
}
if ((ch == 123)) {
this.Advance(s, ref ch, ref len, false);
goto q32;
}
if ((ch == 125)) {
this.Advance(s, ref ch, ref len, false);
goto q33;
}
goto errorout;
q1:
if (((((ch >= 9)
&& (ch <= 10))
|| (ch == 13))
|| (ch == 32))) {
this.Advance(s, ref ch, ref len, false);
goto q1;
}
return FAMatch.Create(10, s.Substring(p, len), p, l, c);
q2:
if ((((((ch >= 0)
&& (ch <= 9))
|| ((ch >= 11)
&& (ch <= 33)))
|| ((ch >= 35)
&& (ch <= 91)))
|| ((ch >= 93)
&& (ch <= 1114111)))) {
this.Advance(s, ref ch, ref len, false);
goto q2;
}
if ((ch == 34)) {
this.Advance(s, ref ch, ref len, false);
goto q3;
}
if ((ch == 92)) {
this.Advance(s, ref ch, ref len, false);
goto q4;
}
goto errorout;
q3:
return FAMatch.Create(9, s.Substring(p, len), p, l, c);
q4:
if (((((((((ch == 34)
|| (ch == 47))
|| (ch == 92))
|| (ch == 98))
|| (ch == 102))
|| (ch == 110))
|| (ch == 114))
|| (ch == 116))) {
this.Advance(s, ref ch, ref len, false);
goto q2;
}
if ((ch == 117)) {
this.Advance(s, ref ch, ref len, false);
goto q5;
}
goto errorout;
q5:
if (((((ch >= 48)
&& (ch <= 57))
|| ((ch >= 65)
&& (ch <= 70)))
|| ((ch >= 97)
&& (ch <= 102)))) {
this.Advance(s, ref ch, ref len, false);
goto q6;
}
goto errorout;
q6:
if (((((ch >= 48)
&& (ch <= 57))
|| ((ch >= 65)
&& (ch <= 70)))
|| ((ch >= 97)
&& (ch <= 102)))) {
this.Advance(s, ref ch, ref len, false);
goto q7;
}
goto errorout;
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Most developers know goto statements are "bad" but very few know why or have even read Dijkstra's letter in CACM. And I'm willing to bet most developers haven't heard of the ACM.
goto statements that target entry into a block (as you could do in older versions of Fortran and Basic) are frowned upon because they make automated program verification impossible - aka "I can't say with certainty how you got here". Well behaved goto statements are not only fine, you couldn't write code without them.
To make it harder for novice programmers to misuse the goto statement, many languages such as C, C++, Java and C# (and many others) have created statements that implement well behaved goto 's. They are:break - goto the end of a switch or terminate the closest enclosing iteration statement
continue - start a new iteration of the closest enclosing iteration statement
return - exit the function in which it appears and return to the caller
And most (I suspect all) modern compilers won't allow specifying the target of a goto into another block. So use goto 's, but use them the way nature intended.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: And most (I suspect all) modern compilers won't allow specifying the target of a goto into another block
Not exactly sure what you mean here, but C/C++ certainly allows you to goto into a contained block, or to a label in another code block within the same containing block e.g.
void f(int n)
{
if(n > 1)
goto foo;
if( ... )
{
if ( ... )
goto foo; }
if( ... )
{
foo:
}
} Will compile just fine. You can get a warnings if you have an initialization before label foo , with the right warning options (gcc/clang, at least), but a quick perusal of the warning options doesn't seem to suggest that there's a warning for a goto int a contained block.
But maybe you meant that you can't jump from one block to another, like
void foo()
{
foo_label:
}
void bar()
{
goto foo_label; } But for that you have setjmp/longjmp , which, of course, should be avoided like the plague.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
k5054 wrote: C/C++ certainly allows you to goto into a contained block, ... Thanks for the correction. The C# compiler doesn't permit that.
/ravi
|
|
|
|
|
C++ is painfully permissive at times, but not nearly so bad as C. C# brought a bit of sense to the mess, even if it sacrifices the ability to do some of the black magic.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
totally agree, Ravi. Well said.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Break, continue, and return are basically goto, when translated to low level machine codes
Also for-loop, if-else, while-do, switch, etc.
Gotos are frowned because some people used it badly. Maybe they caused infinite loop or something. Maybe they forgot to free the allocated memory. Also it shouldn't be used when your high level language provides more explanatory keywords above. The reason is obviously, for maintainability and readibility purpose.
|
|
|
|
|
One of my professors was the GOTO person for many of us students, in terms of resolving technical doubts and even giving career advice.
We need more such GOTOs, i feel.
|
|
|
|
|
If I were given the responsibility for a state machine implementation like that, I would immediately run to my boss asking for permission to rewrite the whole thing as a table driven machine.
There is no way, with code like that, that I could guarantee that all inputs/events are properly handled in all cases (or given the proper error treatment). I would have to make a huge effort if I were to report a complete set of normal (non-error) ways to go from a given state to another, and which inputs/events would lead to which error states.
I've never written any CP article, but code like this makes my fingers itch to compose an article about proper table driven state machine implementation! Maybe I some day get around to do it
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Fair enough. I generated that code using Visual FA. It's slightly faster than the table driven variety, which Visual FA can also generate.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|