TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Help, I'm Drowning in JavaScript

51 pointsby casual-devalmost 3 years ago
I&#x27;ve had a rough day yesterday. I&#x27;m a web dev, but read that as in &quot;I learnt HTML in the 90s and worked on small projects maintaining websites&quot;. Hence the username. On my current job I&#x27;m working with a proprietary software, which uses VanillaJS to modify XML&#x2F;JSON files to make the data useable for our company. I&#x27;m not the dumbest person on the planet, or so I believe, I understand what coding is, I understand the fundamentals.<p>Yesterday I spent 4 hours regexing out HTML data from not so well maintained data sources and screamed at my computer, because I was not able to find patterns. I know, please don&#x27;t ask. This is not high level programming. We&#x27;re talking .replace and .match, with the occaisonal if&#x2F;else over hundreds of sets. My colleague calmed me down and took the time to help me. Bless him. This colleague has multiple projects within the company, because, to me, he is a modern web dev: Building scrapers from scratch with Node, uses multiple frameworks, you get the jist.<p>My path in this company should have been: Learning the code he writes, so I can help him maintaining the software and be on standby, if something breaks. This won&#x27;t be happening in the forseeable future.<p>My problem: I do not understand his code. Or anyone elses. While I basically use if&#x2F;else, he uses ternary operators. I write functions by hand, the uses arrow functions and symbols I can hardly understand. Multiple generations of Javascript foundation changes and yearly new crazes are lying between us. We do not have the time to code review his projects. Also, he should not be my teacher. But: I want to be able to help him and not be a burden.<p>I tried $learnToCode websites, YouTube tutorials, bought &quot;Master Classes&quot; from the usual suspects. But I&#x27;m literally drowning in the market of javascript. There is no clean line learning &quot;This is the 2000s&quot; to &quot;Welcome to the year 2022&quot; javascript.<p>For example, I do not get Typescript; I do not understand, how big projects can use Node, with it&#x27;s thousands of dependencies, while nobody cares, that 20 to 100 of them are deprecated, or in short: I do not understand, how this whole eco system works. But I want to. Do you have any suggestions on how to unclutter this mess, which absolutely overwhelms me?

29 comments

__ryan__almost 3 years ago
Accept that your understanding of JavaScript is outdated. Appreciate you have at least some experience though.<p>If you care to learn modern JavaScript, which you should, check out Eloquent JavaScript [0]. It’s a free web-based ebook providing an introduction to modern JavaScript.<p>Also, stop with the negative narrative. You are overwhelmed, not helpless. Instead of telling yourself you don’t understand code and giving up, just Google said code. It’s easier than ever. In a few weeks, you won’t need to reach for Google. If you encounter a dependency you don’t understand, try to find some documentation.<p>Accept that there are black boxes that “just work” despite being deprecated or lacking documentation.<p>Your job is not to learn the history of JavaScript and how it evolved from your understanding. Your job is to get up to speed with modern JavaScript enough to make functional programs to solve the business’ needs.<p>0: <a href="https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eloquentjavascript.net&#x2F;</a>
评论 #32339370 未加载
评论 #32332405 未加载
password4321almost 3 years ago
PS. It&#x27;s fine to stay old-school (until it finally isn&#x27;t, but that&#x27;s decades...)<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31660869" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31660869</a><p>Ask HN: Best alternative jobs for “outdated” skills with small websites&#x2F;apps?<p>&gt; <i>you should be applying at small to medium-sized companies that are not tech companies. There&#x27;s a ton of work in these companies and hiring is more focused on solving business problems</i>
solardevalmost 3 years ago
Hey, it&#x27;s okay. I was in your exact boat a few years ago. Javascript has exploded in popularity in just a few years and yes, the ecosystem is horribly complex. It&#x27;s an running gag even among full time JS devs how crazy it&#x27;s gotten. None of us can keep up.<p>It&#x27;s OK. Just tackle it one step at a time. Forget Typescript for now. Don&#x27;t use third party libraries until you need them. Arrow functions are optional. Ternaries are a form of jargon&#x2F;an optional shortcut.<p>If the other developer&#x27;s code is too hard to read, that&#x27;s okay, set it aside for now and you can come back to it when you have a little more experience.<p>Start with the problem you&#x27;re actually trying to solve (which isn&#x27;t terribly clear, sorry). You have XML and HTML you&#x27;re trying to parse? Which is it? (XML will be much easier than HTML, because it&#x27;s much stricter. HTML is notoriously loose, which is why there is only like three real browsers in the world.) What are you trying to do with the parsed input?<p>Regex probably isn&#x27;t the best tool to use here. There are specialized parsers for these data formats that we can help you use, if we better understood your needs.<p>Ask. Ask a lot. Find a mentor if you can. Ask on Stack Overflow if you can&#x27;t. It&#x27;s totally okay. Modern JS is a new and exploding field and we&#x27;re all pretty ignorant about it. Fortunately, 80% of it is relatively easy to learn, and the remaining 20% you can usually ignore or work around. Just take it one step at a time... it&#x27;s not you. It really just is a chaotic ecosystem.
评论 #32328929 未加载
评论 #32328441 未加载
andrewedstromalmost 3 years ago
You should check out the free online ebook series You Don&#x27;t Know JS [0].<p>Go straight to the last book in the series, called &quot;ES6 &amp; Beyond&quot; [1] which specifically covers the most important features of JavaScript that have appeared since you last worked with it.<p>For hands on practice with newer JS features, the best resource is Execute Program&#x27;s &quot;Modern JavaScript&quot; [2] course. Once you work through that, move on to their TypeScript Basics course [3]. Both are amazing. Execute Program is the best tool for learning a programming language that I&#x27;ve ever used.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;getify&#x2F;You-Dont-Know-JS&#x2F;blob&#x2F;1st-ed&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;getify&#x2F;You-Dont-Know-JS&#x2F;blob&#x2F;1st-ed&#x2F;READM...</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;getify&#x2F;You-Dont-Know-JS&#x2F;blob&#x2F;1st-ed&#x2F;es6%20&amp;%20beyond&#x2F;README.md#you-dont-know-js-es6--beyond" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;getify&#x2F;You-Dont-Know-JS&#x2F;blob&#x2F;1st-ed&#x2F;es6%2...</a><p>[2]: <a href="https:&#x2F;&#x2F;www.executeprogram.com&#x2F;courses&#x2F;modern-javascript" rel="nofollow">https:&#x2F;&#x2F;www.executeprogram.com&#x2F;courses&#x2F;modern-javascript</a><p>[3]: <a href="https:&#x2F;&#x2F;www.executeprogram.com&#x2F;courses&#x2F;typescript-basics" rel="nofollow">https:&#x2F;&#x2F;www.executeprogram.com&#x2F;courses&#x2F;typescript-basics</a>
potta_coffeealmost 3 years ago
You can learn ternary operators and arrow functions. I feel that you may be overwhelmed because you&#x27;re trying to learn so much at one time. I&#x27;ve been in your shoes. If you keep trying, you will improve. Something I&#x27;ve done in the past is to write down everything I don&#x27;t understand, and just chip away at that list daily by reading documentation and learning new things. Don&#x27;t try to learn them all in one day.
评论 #32328308 未加载
评论 #32328967 未加载
cosmodiskalmost 3 years ago
How to eat an elephant? One bite at a time. JavaScript is fairly complex language and skipping a few parts in foundation can lead to not understanding the rest of it. You also mentioned regex,which is a whole separate piece to learn.<p>Here&#x27;s what I suggest:<p>1) Get the language basics really well.Like really well.<p>2) Move on to more complex concepts,again don&#x27;t skim read, but do again and again and again.<p>3) learning from code written by a more experienced colleague may not be the best option. He may have a certain style, approach and etc. If you can&#x27;t understand the code , you won&#x27;t learn much from it.<p>4) Get yourself all &#x27; you don&#x27;t know JS&#x27; series and devour it. The books aren&#x27;t easy read if you really try to understand the concepts but way better than some random guy on YouTube covering the subject in 2 min video.<p>5) I&#x27;ve recently did a private job with Regex,which I barely know. It was painful.. but it gets easier. Again, start with basics and build up, instead of trying to run complex queries and not fully understanding them.<p>6) Be methodical. Don&#x27;t jump from one tutorial to another,from one book to another. Read one book,do all the exercises, only then move to something else.<p>P.S: Regexing HTML is by far the worst thing a dev could get to do, that&#x27;s why most would advise against it. Don&#x27;t be hard on yourself.<p>Good luck!
atoavalmost 3 years ago
Don&#x27;t panic! Do not despair! Solve it like any big problem: you split it into smaller, managable chunks and tackle them systematically, one by one.<p>For the syntax thing you might wanna pick out one particularily &quot;bad&quot; one and have your collegue explain it to you. Takes him maybe 15 mins and will safe you a good chunk of time. Where I work asking is expected. I ask our Network&#x2F;Linix guru for things all the time. He asks me as well when I use something he does not know. Pretending to know everything won&#x27;t get anybody ahead.<p>As for the regex hell: I always found tools that visualize the matches in realtime useful (like this: <a href="https:&#x2F;&#x2F;projects.verou.me&#x2F;regexplained&#x2F;" rel="nofollow">https:&#x2F;&#x2F;projects.verou.me&#x2F;regexplained&#x2F;</a>). Just make sure the flavour of regex matches yours.<p>Edit: I suspect your collegue relies heavily on ES6 syntax (as I would). A overview of that can be found here: <a href="https:&#x2F;&#x2F;www.w3schools.com&#x2F;Js&#x2F;js_es6.asp" rel="nofollow">https:&#x2F;&#x2F;www.w3schools.com&#x2F;Js&#x2F;js_es6.asp</a><p>Make sure to give yourself a little time to play, e.g. try to replace something where you would use a for loop with an Array.forEach loop or something like that.
评论 #32329168 未加载
salawatalmost 3 years ago
I&#x27;m sort of in the same boat, but I&#x27;ll tell you what&#x27;s been helping me keep my sanity:<p>The debugger is your friend. Figure out how to get it attached anywhere if you haven&#x27;t already.<p>That means running node with --inspect-brk=&lt;port number&gt; that also means figuring out where spawns are.<p>This exercise will greatly aid you in overcoming any surprising control flow going on by allowing you to single step the program. JS is one of those languages I just have to cling to my debugger in.<p>Two: node has two &quot;ClassLoaders&quot;(CommonJS&#x2F;ESM). They don&#x27;t mention squat about the differences between them until the middle of the nodejs documentation.<p>Start learning dependencies one by one. There&#x27;s really no other way around it.<p>Avoid using regex for XML&#x2F;HTML. Try something more akin to SAX parsers. Seriously. There:s way too much pain in doing regex XML processing. You could literally rewrite the damn thing in java faster than getting a shoddy, flaky JS monstrosity reliable.<p>God help you if they&#x27;re doing weird Async&#x2F;Event nonsense.<p>Keep cracking at it, but be aware, I think JS has broken my brain, because I just don&#x27;t even like programming anymore since I started dealing with the language and all the necessary tranpilation&#x2F;toolchains.
kyproalmost 3 years ago
You&#x27;re not alone - it&#x27;s nuts how much JS has changed over the last decade.<p>I don&#x27;t know if I can offer any suggestions beyond just Googling syntax you don&#x27;t understand and experimenting with it until you feel you understand it. From there it just a matter of time before you can glance your eye over the code and understand what it&#x27;s doing without needing to decipher every line. I just want to say you&#x27;re not alone. I think most frontend devs have gone through something similar at some point over the last decade - I know I have.<p>As for deprecated dependencies, that&#x27;s a huge problem. Senior devs generally do care and will be selective around dependencies. One of the problems is that the ecosystem is evolving so quickly. Libraries come into and out of fashion almost over night so frequent maintenance is needed to keep dependencies up to date. My guess is that either devs are not putting enough thought into what dependencies they&#x27;re using, or your not currently assigning enough time as a team to review &amp; maintain your existing dependencies - this is definitely something worth raising with your team imo.<p>The last thing I&#x27;ll say is that the use of ternary operators are something I&#x27;m very critical of and it&#x27;s interesting that you mentioned them in your post. A lot of devs seem to have this mindset that if you can convert 5 lines of code to 1 or 2 that&#x27;s always a good thing, but compressing 5 lines of code to 2 often comes at the cost of clarity and readability. It sounds like you might need to think about coding standards with your team. Is part of the problem here that the team is writing confusing &#x2F; messy code, and it&#x27;s that coupled with your lack of knowledge of modern JS that&#x27;s resulting in the stress you&#x27;re feeling here?
codeptualizealmost 3 years ago
I can see how it can be overwhelming, as with everything the beginning is the hardest but it will get easier over time. Seeing a ternary the tenth time will be much easier than the first.<p>I would look for the old-ish articles and tutorials that introduce es6, for example: <a href="https:&#x2F;&#x2F;babeljs.io&#x2F;docs&#x2F;en&#x2F;learn&#x2F;" rel="nofollow">https:&#x2F;&#x2F;babeljs.io&#x2F;docs&#x2F;en&#x2F;learn&#x2F;</a> idk if you need to go earlier, but surely there are tons of articles on each update to the language.<p>I think it&#x27;s good to realize most of it is not new, it&#x27;s largely the same stuff, just slightly different and more convenient.
Fradowalmost 3 years ago
&gt; I do not understand his code<p>I believe that&#x27;s your main problem. You are seeing a foreign language kinda close to what you know and expect to understand it right away (while it&#x27;s the same &quot;Javascript&quot;, using different writing ways is more akin to another dialect). It takes a bit of time and practice to familiarize yourself with it. Try to decompose it until you become fluent. When you learned to read, you would read a word one letter at a time. Do the same: read the code one operator at a time, until you understand what&#x27;s going on and how they work together.<p>For example, a ternary is just a compressed if&#x2F;else with a different syntax. An arrow function is just an inline function with a different syntax. etc...<p>&gt; I do not get Typescript<p>Typescript is Javascript with type safety. In Javascript, if you pass a number to something that expects a string, it will convert without any complaint. Typescript will complain that it&#x27;s the wrong type. You can go much further than this with complex types that have to be passed correctly.<p>&gt; thousands of dependencies, while nobody cares, that 20 to 100 of them are deprecated<p>Some people care, but for most dev, it&#x27;s a black box that just works. It&#x27;s frankly not something to worry about when starting.<p>&gt; I do not understand, how this whole eco system works<p>If I had to sum it up, it would be building on the shoulders of giants, over and over again, at a break-neck speed, valuing improvements over backward-compatibility. I&#x27;m personally not a fan of it, but that&#x27;s how it is.
评论 #32329791 未加载
lordvietalmost 3 years ago
The journey ahead will be long but it&#x27;s totally manageable if you put in the hours. First and foremost the whole situation gave you a glimpse of some of the things that are out there. It may lead you to more interesting and challenging work.<p>Nowadays the Internet is literally drowned in resources and you may quickly feel overwhelmed by everything. The trick here is to choose only a handful and stick with them for the time being.<p>Some of my personal favorites for starting out are <a href="https:&#x2F;&#x2F;www.freecodecamp.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.freecodecamp.org&#x2F;</a> to get your feet wet and up to speed with JS. You will build projects and explore some of the fancier syntax you saw.<p>You may also want to start building a strong CS foundation at some point. This is going to be really beneficial as you move forward. Arguably one the best (and completely free) resources for starting out is CS50 - <a href="https:&#x2F;&#x2F;cs50.harvard.edu&#x2F;x&#x2F;2022&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cs50.harvard.edu&#x2F;x&#x2F;2022&#x2F;</a>.<p>Also don&#x27;t follow courses blindly, take notes and try to implement things yourself. Moreover, start tinkering with some projects as soon as possible.<p>Good luck.
beardywalmost 3 years ago
You are right about node dependencies. It would be good to think someone is trying to get on top of it. Maybe someone here knows?<p>MDN is a very reliable source of reference for all of JavaScript.<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;JavaScript" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;JavaScript</a>
easrngalmost 3 years ago
You can&#x27;t parse [X]HTML with regex. Because HTML can&#x27;t be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently sophisticated to understand the constructs employed by HTML. HTML is not a regular language and hence cannot be parsed by regular expressions. Regex queries are not equipped to break down HTML into its meaningful parts. so many times but it is not getting to me. Even enhanced irregular regular expressions as used by Perl are not up to the task of parsing HTML. You will never make me crack. HTML is a language of sufficient complexity that it cannot be parsed by regular expressions. Even Jon Skeet cannot parse HTML using regular expressions. Every time you attempt to parse HTML with regular expressions, the unholy child weeps the blood of virgins, and Russian hackers pwn your webapp. Parsing HTML with regex summons tainted souls into the realm of the living. HTML and regex go together like love, marriage, and ritual infanticide. The &lt;center&gt; cannot hold it is too late. The force of regex and HTML together in the same conceptual space will destroy your mind like so much watery putty. If you parse HTML with regex you are giving in to Them and their blasphemous ways which doom us all to inhuman toil for the One whose Name cannot be expressed in the Basic Multilingual Plane, he comes. HTML-plus-regexp will liquify the n erves of the sentient whilst you observe, your psyche withering in the onslaught of horror. Rege̿̔̉x-based HTML parsers are the cancer that is killing StackOverflow it is too late it is too late we cannot be saved the transgression of a chi͡ld ensures regex will consume all living tissue (except for HTML which it cannot, as previously prophesied) dear lord help us how can anyone survive this scourge using regex to parse HTML has doomed humanity to an eternity of dread torture and security holes using regex as a tool to process HTML establishes a breach between this world and the dread realm of c͒ͪo͛ͫrrupt entities (like SGML entities, but more corrupt) a mere glimpse of the world of reg ex parsers for HTML will ins tantly transport a programmer&#x27;s consciousness into a world of ceaseless screaming, he comes, the pestilent slithy regex-infection wil l devour your HT ML parser, application and existence for all time like Visual Basic only worse he comes he comes do not fi ght he com̡e̶s, ̕h̵i s un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, HTML tags lea͠ki̧n͘g fr̶ǫm ̡yo ͟ur eye͢s̸ ̛l̕ik͏e liq uid pain, the song of re̸gular exp ression parsing will exti nguish the voices of mor tal man from the sp here I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful t he final snuffing of the lie s of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL I S LOST the pon̷y he comes he c̶̮omes he comes the ich or permeates all MY FACE MY FACE ᵒh god no NO NOO̼O O NΘ stop the an *̶͑̾̾ ̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s ͎a̧͈͖r̽̾̈́͒͑e n ot rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚ N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ<p>Have you tried using an XML parser instead?<p>- <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;1732454" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;1732454</a><p>With that aside, for parsing HTML with node, use cheerio. It has a jQuery-style API and IIRC is more lightweight than jsdom (which is what I&#x27;d suggest if cheerio isn&#x27;t enough). If you&#x27;re parsing HTML in a browser, you don&#x27;t need any libraries, use a DOMParser. Arrow functions are just normal functions but with `this` automatically bound to the `this` of the scope they are in. MDN is your friend.
评论 #32330154 未加载
评论 #32329547 未加载
评论 #32335358 未加载
ilakshalmost 3 years ago
Stop using regular expressions. Honestly, it sounds like you were having trouble with that, and blamed JavaScript.<p>Regular expressions are the worst.<p>Also if someone scraped web pages and then stored the HTML, that seems like a bad idea. You would want to actually extract the data at that point.<p>Also regular expressions are the worst way to extract data from HTML.<p>I think the real problem is the business model and technical approach. It almost sounds like you are scraping a massive number of websites using regexes, which is guaranteed to break somewhere on an almost daily basis since developers change the HTML and regexes are very brittle.<p>You are probably taking advantage of a lot of other people&#x27;s work, possibly quite a bit of it copyrighted and certainly most of it NOT curated with the idea of some other company profiting off of it.<p>So you deserve your pain.<p>But don&#x27;t blame JavaScript or lack of familiarity with new versions when it&#x27;s all of your other life choices that are the real problem.
评论 #32337697 未加载
aristofunalmost 3 years ago
It looks like you’re lacking some fundamentals.<p>And not if&#x2F;else type of, but rather oop, software design and organization of code kind of things.<p>What will help is to master a single decent beginners course that focuses on applying fundamentals to building practical projects. And it’s better to be python or ruby based course (to minimize friction and infra pain).<p>Don’t jump on anything else until you finished and have some coherent picture.<p>Only then you should proceed with learning other concepts bit by bit.<p>Js world looks complicated for beginners because of a diversity of tools and techniques like bundling, transpiling etc.<p>It is not easy to comprehend and it is not necessary, you just focus on your specific goals and moving from a goal to another goal you gradually build holistic picture.<p>You don’t just “get” Typescript etc. Im still learning typescript after 2 years professionally working with it.
评论 #32329248 未加载
gleam_useralmost 3 years ago
Maybe take a step back and look at foundational topics such as higher order programming. Then you can take this foundational knowledge and apply and use it in any programming language and not be surprised when you come across it.<p>The ternary operator is born out of the need for an expression form of if-else. Some languages have if-else already implemented as an expression so they don&#x27;t need a ternary operator.<p>Typescript exists to provide a static-typing discipline to javascript, if you don&#x27;t care about this obviously you won&#x27;t see the importance of typescript.
anyfactoralmost 3 years ago
I think Javascript environment encourages this behavior.<p>From day 0, a javascript project starts as a goal driven project of finishing things. Write hacky code for now we will figure them down the road. From that point on the hacks keep piling on top of hacks.<p>Another issue is &quot;syntax overload&quot;. Javascript allows for doing one thing ten different way. So keep doing things your own way as long as you don&#x27;t have to review other people&#x27;s code. The new things JS brings out doesn&#x27;t bring significant syntactical improvement and yet adds to the syntax overload syndrome.
moistlyalmost 3 years ago
Oh, god, please stop abusing yourself. Stop using bad tools for the job of manipulating XML&#x2F;JSON and start using a tool designed for the task: Saxon XSLT. It comes in Java, .Net, and JS forms.<p><a href="https:&#x2F;&#x2F;www.saxonica.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.saxonica.com&#x2F;</a><p>XPath&#x2F;XSLT3&#x2F;Xquery are full-fledged functional programming languages that specialize in querying and transforming tree data structures. They make it <i>so easy</i> to work with XML and JSON. You don’t have to hurt yourself using the wrong tools!
raszalmost 3 years ago
I just read <a href="https:&#x2F;&#x2F;insanecoding.blogspot.com&#x2F;2009&#x2F;11&#x2F;they-actually-want-bad-code.html" rel="nofollow">https:&#x2F;&#x2F;insanecoding.blogspot.com&#x2F;2009&#x2F;11&#x2F;they-actually-want...</a> and didnt believe it. Turns out its true :o<p>You are very lucky nobody at your company caught on yet. My suggestion is hire me as a subcontractor - I will do your job for half your wage, you will have plenty of spare time to do whatever.
ironmagmaalmost 3 years ago
Plug in unknown syntax into <a href="https:&#x2F;&#x2F;babeljs.io&#x2F;repl&#x2F;" rel="nofollow">https:&#x2F;&#x2F;babeljs.io&#x2F;repl&#x2F;</a> or <a href="https:&#x2F;&#x2F;www.typescriptlang.org&#x2F;play" rel="nofollow">https:&#x2F;&#x2F;www.typescriptlang.org&#x2F;play</a> and it will convert it to vanilla JavaScript.
joshxyzalmost 3 years ago
knowing difference between es5 es6 es2017 es2018 and so on<p>knowing the internal modules of nodejs such as fs, events, process, streams<p>knowing utility modules like lodash, asyncjs, rxjs<p>these could help.<p>but the fact is if your workmate is writing unreadable and unmaintainable code, hes the problem, not you.<p>you need linters, code conducts, test sequences, dependency upgrade schedules, node runtime update schedules, things like that.<p>i once left a high paying job because a colleague there is code golfing on our code. the team suffered more when i left lol.<p>in life choose your battles, dont stick with a shitty one. when applying for work, it is not just you applying for their company, it is you screening if their tech stack and coding practices is the right fit for you. screen hard.
评论 #32329804 未加载
speedgoosealmost 3 years ago
You could try to learn modern JavaScript&#x2F;TypeScript as if it was a complete new programming environment you don’t know about. Which is a bit the case from what I can read.<p>A bit like learning Golang when you know C99.
haspokalmost 3 years ago
I would highly recommend learning FP fundamentals in another language, not Javascript.<p>For example, there is an excellent introductory FP course on Coursera by Martin Odersky (&quot;Functional Programming Principles in Scala&quot;). It happens to be based on the Scala language syntax, but most of what you learn there will be directly applicable in other FP languages too. For me, taking this course was a game changer ~10 years ago. Highly recommended.<p>Once you understand the basics, picking up stuff like &quot;arrow functions&quot; (lambdas) will be just a matter of adjusting to the JS syntax.
darrelldalmost 3 years ago
Never forget: The original version of Javascript was written in 10 days.<p>Javascript is a mess, especially at smaller shops which may face pressures to ship projects to a client that work, regardless of the state of the code.<p>Breathe. You&#x27;re overwhelmed and that&#x27;s ok. Just take it day at a time, line at a time and don&#x27;t be afraid to have to google the same thing over and over again. It eventually sticks.<p>Don&#x27;t be afraid to ask for help after you&#x27;ve exhausted yourself trying to solve something. Lots of other great advice in this post too. You&#x27;ll get there.
lysergiaalmost 3 years ago
Write some Greasemonkey&#x2F;Tampermonkey scripts as a hobby and forget Node, and insecure npm. Forget $frameworkOfTheWeek and just hack.
schwartzworldalmost 3 years ago
&gt; While I basically use if&#x2F;else, he uses ternary operators. I write functions by hand, the uses arrow functions and symbols I can hardly understand.<p>What you are describing is commonly known as ES6 or ES2015 syntax. The language got some features at that time that solve gotchas related to using JS and arrow functions are a great example. These features make JavaScript easier to work with if you use them, and learning the most important ones doesn&#x27;t take more than a day. <a href="https:&#x2F;&#x2F;www.boardinfinity.com&#x2F;blog&#x2F;top-10-features-of-es6&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.boardinfinity.com&#x2F;blog&#x2F;top-10-features-of-es6&#x2F;</a> After 20165, they only released like 2 features per year, and most of those haven&#x27;t had the same adoption.<p>Arrow functions are a great example, as they don&#x27;t have their own `this` and it makes the `this` keyword work how you think it should.<p>&gt; ternary operators vs if&#x2F;else<p>Sometimes new features make sense in a certain context. If&#x2F;else makes sense if your code has actual branching, but if the assignment of a single variable is all you need to branch for, ternaries are great.<p>``` &#x2F;&#x2F; classic JS let variable;<p>if (someCondition) { variable = &#x27;foo&#x27;; } else { variable = &#x27;bar&#x27;; }<p>&#x2F;&#x2F; with ternary<p>const variable = someCondition ? &#x27;foo&#x27; : &#x27;bar&#x27;; ```<p>&gt; We do not have the time to code review his projects.<p>That&#x27;s crazy.<p>Ternaries are also a great example of a feature that can be abused. As conditions get more complex, ternaries become more opaque and are a worse choice. More concise code isn&#x27;t necessarily better. This can be true for a lot of JS. Fancier code isn&#x27;t better if the rest of the team can&#x27;t understand it, and if you don&#x27;t have a review system, you can&#x27;t blame him for writing in his own accent and you not being able to understand. Developers on a team need oversight. I catch bugs my teammates write, and they do for me too. If you can&#x27;t understand it when the PR is made, you&#x27;re not going to understand it later.<p>So my answer to you is to try to start doing code review. Reading code is important, and a PR should be focused enough that you can track what a feature or bugfix is actually doing. If you can&#x27;t, you should be speaking up.<p>&gt; Also, he should not be my teacher.<p>Why not? What dev wants their teammates to struggle? I love helping more jr developers, and I&#x27;ve never had someone on any team bristle when I asked them to help me.
kiryklalmost 3 years ago
Try transpiling to earlier js (ES) <a href="https:&#x2F;&#x2F;www.tutorialspoint.com&#x2F;babeljs&#x2F;babeljs_transpile_es6_features_to_es5.htm" rel="nofollow">https:&#x2F;&#x2F;www.tutorialspoint.com&#x2F;babeljs&#x2F;babeljs_transpile_es6...</a> Or transpiling TS to JS <a href="https:&#x2F;&#x2F;transform.tools&#x2F;typescript-to-javascript" rel="nofollow">https:&#x2F;&#x2F;transform.tools&#x2F;typescript-to-javascript</a>
mardiyahalmost 3 years ago
So natural... as it&#x27;s the most dynamic PL over the others