|
Nand32 wrote: Seriously I have so much pain tracking where the brackets begin and end if I'm reviewing a .js code snippet.
VS Code has an free add-on (forgetting it's name, but I've installed it on my machine) which matches brackets, rather displays matching brackets with the same colour, which I find very useful.
|
|
|
|
|
It's a setting, Editor > Bracket Pair Colorization. I have it Enabled.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
There's a similar issue with C# post 6 where anonymous functions and various shorthands obscure the code.
The simple answer to how I deal with it is I don't.
I rarely have to read such code, and I tend to have 100% control over my codebase and the tools I use, plus I have to target toolchains that are too old to do C++20.
I feel your pain. I started coding 1986 procedurally in BASIC, then in 6502 machine code, finally in the Apple mini assembler before moving to PC. I picked up OOP fine, and then even Generic Programming in C++ but beyond that it starts to lose me and I go cross eyed.
I don't even like LINQ.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
A witch after my own heart - learn and use what you need, ignore what you don't.
|
|
|
|
|
I totally understand your pain.
I came from a similar background -- started learning C++ in 1993 (along with MFC Microsoft Foundation Classes -- which was really an amazing implementation of OOP).
Those were the days that OOP was coming on strong, then Java was invented and everything was an object so really OOP design principles became even more codified.
Then, JavaScript...a dynamic language where it seemed there were no rules and didn't originally even have a way to create a class. Instead you had to create a function that acted like a class.
Slowly, things moved toward functional programming and the syntax can be so austere that you just can't even see what is going on.
Interfaces - In The OOP World
In the OOP world, we had Pure Abstract classes (in C++) and then Interfaces.
We could see that these described "contracts" of functionality: A bunch of functions that the classes would implement.
Remember what an Interface really is: it is the promise that the classes will have functions with specific names that will be implemented in the future. This allows you to have a DYNAMIC function. A function that can be changed in the future.
Dynamic Programming Languages
But, then on the dynamic programmning side (JavaScript) they had functions as first-class objects.
That meant you could pass in a function to a function and override the original functionality that could be run.
Altering Functions Any Time Anywhere
In other words they allowed a dev to write a function that could later be altered easily by anyone.
For example:
var myFunction = (param1, param2) {
Then later someone could come along and be like, "Oh, I need that function to do XYZ..."
myFunction = (param1, param2) {
But then this idea got inside people's heads and they were like,
New Devs undisciplined idea: Anything can be anything!!!! Any function can just do a new thing.
In the C++ world we learned "design" (ideas to create structures which were later extendable, maintained, added to, etc.) but in the JavaScript world these ideas were "backed into" --- people started typing code and then later (maybe) learned some design principles.
They just go the idea that, "Hey, you can do anything, anytime."
For me, I finally learned "Functional" programming when I started learning Kotlin (Android programming) and Swift (iOS) programming. Those languages do a great job of C++-like OOP while maintaining structure and implementing functional concepts.
But also, what you really need is someone who comes from OOP who has seen the changes come in C# (for example) to move toward functional programming. That person will explain the transformation of functions into anonymous / functional programming functions.
As difficult as the book is, I highly recommend the book C# In Depth by Jon Skeet[^].
He teaches the entire way that functional programming moved into C# by showing what C# 1.0 had and moving to each additional version over the years and showing what was added and why.
It is one of the main resources that got me over the hump and helped me see the new sytnax much more clearly.
That's my long 2 cents worth.
modified 25-Oct-23 9:31am.
|
|
|
|
|
Agree to keep in touch (10)
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
|
|
|
|
|
I see what you did there!
"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!
|
|
|
|
|
CORRESPOND (I've counted the letters today! )
|
|
|
|
|
I did wonder where you were Derek
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 858 5/6
⬜⬜⬜🟨🟨
🟨⬜⬜🟨🟨
🟨⬜🟩⬜🟨
🟩🟩🟩🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 858 X/6
⬜⬜⬜⬜⬜
⬜🟩⬜⬜🟩
⬜🟩⬜⬜🟩
⬜🟩⬜⬜🟩
⬜🟩🟨🟩🟩
🟩🟩⬜🟩🟩
reset count for me
|
|
|
|
|
Wordle 858 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!
|
|
|
|
|
Wordle 858 5/6
⬜⬜⬜🟨⬜
🟨🟩⬜⬜🟨
⬜🟩🟨⬜🟨
🟩🟩⬜🟨🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 858 4/6
⬜⬜⬜⬜⬜
⬜⬜🟩🟨⬜
⬜🟩🟩⬜🟩
🟩🟩🟩🟩🟩
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Wordle 858 6/6
🟩⬜⬜⬜⬜
🟩⬜⬜⬜🟩
🟩⬜⬜🟨🟩
⬜⬜🟨⬜⬜
⬜🟩⬜🟩⬜
🟩🟩🟩🟩🟩
Somehow this was really difficult!
I already glossed over the word a few times, but it sounded very different in my head (stupid English and you ghoti[^])
|
|
|
|
|
Wordle 858 6/6*
⬜⬜🟨⬜⬜
🟨⬜⬜⬜🟨
🟨🟩⬜⬜⬜
⬜🟩🟩⬜⬜
⬜🟩🟩🟩⬜
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
⬜🟨⬜⬜🟨
⬜⬜⬜⬜⬜
⬜🟩🟨🟩🟩
🟩🟩🟩🟩🟩
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 858 2/6
🟨🟩⬜🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 858 5/6
⬛⬛⬛⬛🟨
🟨🟨⬛⬛🟨
🟨🟩🟨⬛⬛
🟩🟩⬛⬛🟨
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
This doesn't look good. Hurricane Otis has undergone rapid intensification. In just 12 hours, it has grown from a tropic storm into a category 4 hurricane. It's located in the Eastern Pacific and appears to be heading toward Acapulco, Mexico making landfall as a category 5 hurricane. Mexico isn't prepared for this. Every weather model has failed to correctly forecast its rapid intensification. I've never heard of that happening before.
I wish they would make a point of including a hurricane's barometric pressure in the updates.
According to Wikipedia, the pressure is reported to be 927 mbar (hPa); 27.37 inHg. For comparison,
the lowest barometric ever recorded for a hurricane was 882 mbar. The lower the barometric pressure,
the more powerful it is.
Twitter post from US_Stormwatch:
https://twitter.com/US_Stormwatch/status/1716981123329470831[^]
|
|
|
|
|
Are you in its path Steve ?
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
|
|
|
|
|
Steve Raw wrote: Mexico isn't prepared for this
I don't mean to undermine the rest of what you wrote, but isn't that like saying "Japan isn't ready for earthquakes", or "[country in area prone to natural disasters] isn't ready for [natural disaster]"?
|
|
|
|
|
|
I wish them luck. I am still fighting my Homeowners Insurance company from Hurricane IDA 2+years later.
There is NO way to prepare for a Hurricane. Take it from me I have lived through many hurricanes in New Orleans.
Blown Away...
|
|
|
|
|