Using TypeScript for about 2 hours made me wonder why anyone would write JavaScript ever again. This was several years ago, when TypeScript wasn't nearly as good as it is now.
Ask HN: What made you change your mind about a programming language/paradigm?
61–70 of 401 posts
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#62Re: Ask HN: What made you change your mind about a programming language/paradigm?
#63ORMs, until i wrote my own.
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#64The best code is code you don't have to write, because someone else has already written it. I've decided that number of libraries is the most important feature of a language, which is of course strongly correlated with popularity. Javascript is king in this regard.
In this regard, JavaScript is far from good. There's huge amounts of package instability, a lot of mucking with node_modules, a lot of useless breakage.
I have found that Python and Ruby are much better in this regard. The libraries serve way more purposes, they're stable and work well, and I can count on library improvements being incremental and easy to digest
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#65Rich Hickey's "Value of Values"[0] is what finally sold me on the benefits of pure functional programming and immutable data structures. (It remains horrifying to continue working with MySQL in my day job, knowing that every UPDATE is potentially a destructive action with no history and no undo.) [0]: https://www.youtube.com/watch?v=-6BsiVyC1kM
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#66My current job is with a company that primarily uses Python, and I still strongly dislike it even after using it for a lot more things. I'm very much a proponent of using the right tool for the job, and Python is almost never it.
Almost.
One of my solo projects was to write a desktop client to unify a couple different warehouse systems. I experimented with quite a few different languages and toolkits in the hopes of finding something that'd satisfy all my conditions:
- Support for an embedded WebKit widget (one of the systems being integrated was entirely web-based)
- Portable (I needed to support Windows clients, but didn't want to use Windows as my dev environment, so the app would need to support Linux; plus, I wanted to extend the possibility of replacing the Windows machines with Linux at some point in the future)
- Support for Windows' winspool API (I needed to send raw ZPL data to label printers; in Linux this is easy to do by wrapping the lpr command, but with Windows this entails either winspool or a bunch of special filename hackery)
- Preferably no C++ or Java, since I dislike those languages quite a bit, too (and statically-typed languages like that didn't feel like the right fit for the amount of JSON mangling I needed to do)
Ultimately, I ended up settling on Python 3 + Qt5, since it was the only stack that actually checked all those boxes, and consequently that stack is in my "right tool for the job" list (when "job" equals "graphical desktop application with the need to embed a browser view"). I'm still on the hunt for something better (and for cases where I don't need an embedded browser, Tcl/Tk is still that "something better"), but it does the job well enough for now.
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#67The blend of statically-typed functional programming with eager performance characteristics changed how I thought about writing computer programs. I started using C after that and found the language much easier to use.
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#68Peer pressure. --- "What? You DONT know regular expressions?!?! I thought an ace like you would be all over those".
Not enough official work. --- "I think I'll try learning Java. Maybe use it to create a moving average stock buy/sell tool..."
Need it for work. --- "Stop bothering the database guys. They can't be answering your WHERE clause questions all the time. Just go learn SQL yourself"
Work (again). --- "Well, we don't have a Pascal compiler for CP/M. You're gonna have to learn C. Like or not."
Work (again). --- "The 3060 uses an HP-9825. The HP-9825 runs HPL. Not BASIC. Here's the manuals for it. Now, get busy and stop complaining."
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#69Every once in a while I search for something I need in Python and find that it only exists in Python 3, but I'm not quite convinced it's worth the effort to transition from 2. However... I've just learned about Python 3's f-strings and they gave me a big smile, and probably the final push I needed :) (Yes, I do know that sounds silly and there are probably much better reasons to transition to Python 3 ¯\_(ツ)_/¯ )
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#70Earlier quoted context omitted.
> What's the correct way to use typescript... You write TypeScript the same way you write JavaScript. It just enforces a lot of the proper discipline and practices that JavaScript doesn't, and it doesn't let you incorrectly use APIs. > you're explicitly asking for things you know you have in your document, but it reports an error I'm not 100% sure what you're talking about, but I bet you'd get a great answer on Stack…
I'm using jquery for certain layout libraries that I need unless you have another library that provides it. Also I'm using datatables. I don't think there's an alternative to datatables that even comes close to being as well put together. There's just a huge number of libraries around that depend on jquery, and are rock solid with continuing support. I would prefer to use something proven than something that will be…
I suspect jQuery and it's ecosystem will themselves become irrelevant and eventually (effectively) abandoned. The (at the time compelling) rationale of abstracting away different browser behaviour has become less and less necessary, and what I would see as the other advantage of using jQuery - like easier access to behaviours like animation, $ajax - less relevant.
$ajax supports async/await, yes - https://petetasker.com/using-async-await-jquerys-ajax/ - but why would I not want to just use the fetch apis? https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API (ignoring browser compatibility, which is becoming the norm)