4

So i bribed a fellow dev/friend who HATES php and Magento... to help me grind out a Magento site while im super behind on a bunch of crap that's mostly boring administrative bs (#ReluctantlyInCharge)

He knew I was coding in python several times over the past several months... yet, despite my near constant griping of formatting bs and high preference of basically anything that doesnt require readability-esq formatting... he apparently didnt get it.

I need to make a quick splash page with a timer on it (other cool elements that i dont think ive ever seen done but i figured why not... weird shit is totally on brand here... like scripting page elements to change and see if people catch on... in very basic ways)...

I know js plenty... but I'd likely have looked up the syntax, was lazy, he loves js (for the intended purpose... he does a lot of blockchain dev) so i asked if hed write me a quick timer line cuz... well im lazy.

He totally overcomplicated it and sends me a page he typed up incl html header. Timer was 3 short block/lines with semicolons... i laughed and wondered why he did all that instead of just the little js... he didnt know either. I told him as a courtesy id make sure to keep the js formatting as he wrote it instead of 1 line...

He sends me 2 examples of a js timer in 1 line... like 1semicolon... i had to show him what i actually meant... 3 'lines' with semicolons on 1 visual line...

He was stunned, then realised i must really hate python

Comments
  • 0
    Sounds like the meat of the js would be a callback firing off in a settimeout.
  • 2
    if you're working on magento in 2024

    you've already lost
  • 0
    What is the advantage of 3 lines of code on one line? Or did I miss something? What was the code?
  • 0
    Are you writing code like this?
    const x = 1; const y = 2;
    As opposed to this:
    const x = 1;
    const y = 2;

    It’s ok if you’re the solo dev, but if you’re working with a team, other devs are going to have a difficult time reading your code if you don’t format it with new lines and indentations bc they give a sense of scope within a function, if statement etc. it will be hard for them to read your PR’s and catch bugs and other issues within the code you’re trying to merge.

    What you can probably do is write it your way, run a formatter like prettier so it can be split into new lines, push it out, then ctrl-z to undo formatting back to your original

    Just a 2 cents
  • 1
    @fullstackcircus oh...there's a reason for it... and typically, id fully agree with you. That said, even though magento is essentially req for right now, it's not like im using as packaged... ive been tearing apart OSes (including windows... which really doesnt like knowing its no longer really windows) since ms paint no longer let me use the + and - keys to make brushes and erasers any size i wanted (still in the single-digits of childhood)...

    Im not exactly a fan of any framework... i know too much to not just be blinded by the bloat that's everywhere. It's even a constant battle of over-engineering to use most of the typical/main imports in most languages... ive had to set personal breakpoints like not tearing apart packages to make new versions with only the func/methods/classes im using if those account for 60%+ of the unedited import.

    TL;DR
    Magento gets torn a new asshole if/when i use it. I need mainly the backend GUI. Am/will be modding the majority of the rest.
  • 2
    @TeachMeCode yes/no... mines naturally even more mass-like than that.

    Im also fully aware that i gotta start writing code so *not_me* can easily understand it... even with just html and css (which id normally use scss over css) it took me 2x as long as actually writing the entire site from scratch just to format, put variables in english that could be understood by *not_me*/had no clue where to comment anything.

    it's way worse w/actual coding. idk whats not common sense to others. Its been reminiscent of 1st gr. i had no clue why the teacher kept writing all the different, verbose, variations of, what i now know, was an 'answer' to the math 'question'... 7 + 5, 10 + 2... etc... took me years to realise that others viewed that as anything other than "12".

    Part of query chatGPT/Google for forums is cuz idfk, or have a clue/valid frame of ref whats complex/advanced. Ive been coding 25yrs/since age 6

    Now network devs dont even know what half-duplex is/was!

    Im a dinosaur; im aware.
  • 0
    @awesomeest I LOVE SCSS!! I never went back to CSS after going that route, it makes the code MUCH easier to reason about bc you can stricture the hierarchy of parent children rules like how your HTML content is. It’s not the only reason but it’s the biggest one.

    You don’t need to waste time formatting code manually, there are tools out there like .prettier configs that do it on the run
  • 0
    @TeachMeCode ehh... many of those tools don't like my code.
  • 0
    @awesomeest oh….I guess it’s language dependent. I know for a fact python won’t even compile if the formatting is wrong so throwing that in a prettier or formatter would be a silly idea since it already forces indentation out of the box (I could be wrong, I don’t code in python I’m mainly typescript these days).
    Your avatar says PHP on the tshirt so php is your top? I don’t code in PHP but there may be formatters out there though I’m guessing you probably found them at this point and for some reason they puked on whatever you fed them (which makes them lousy formatters to begin with)
  • 1
    @TeachMeCode the avatar options ate limited... main reason i picked this one is because it's wrong, imo.

    I don't really have a top language, but i do prefer languages that dont use newlines and whitespace as format reqs.
  • 0
    @awesomeest l LOOOOOOVE TypeScript
Add Comment