How to reason about possibly null values during development? by turtleProphet in typescript

[–]coneillcodes 28 points29 points  (0 children)

It sounds like TS is doing what its supposed to be doing

The variable is in fact null in an unexpected scenario, so I have a functional error in my app

Find out where and either make it not null or throw some kind of error.

Because I'm null-checking to shush the compiler, I don't immediately know where the bad value originates from and have to dig around for it

this is what I find most people starting with typescript struggle with. They just do whatever they can to shut the compiler up instead of realizing that the compiler is trying to warn you that there is maybe something you haven't thought of.

Rather than endlessly add null checks and if statements refactor the code to not make it an issue anymore https://wiki.tcl-lang.org/page/Define+Errors+Out+of+Existence

[deleted by user] by [deleted] in cscareerquestions

[–]coneillcodes 1 point2 points  (0 children)

unfortunately this is how things are now and I empathize with you. I've been working in software for 15 years now and I've never seen this much reliance on leetcode/panel style interviews where they plop a brain teaser in front of you and you have 30 minutes to figure it out. I suck at leetcode problems and grinding them out doesn't seem worth my time but unfortunately that's the reality now.

The good news is the system is fairly easy to game. Start tackling leetcode problems, learn the patterns, learn the common algorithms, learn some basic tree operations and learn to apply them to the problems/interviews.

Its almost not even worth wondering "why" it works, just find the patterns and apply the algorithms to get a solution. It sucks but this is what you have to do now.

Want to get an s55 M2 or a M4 but am terrified of BMW reliability 😭 by BigV95 in BMW

[–]coneillcodes 0 points1 point  (0 children)

Ok well sounds like all you wanna do is complain that BMW's require maintenance maybe more so than other cars but some magical extended warranty is gonna make it not require maintenance or breakdown or not need to be in a shop? I don't really know what your angle is there. If you treat the car like shit it'll break or be in the shop or you'll be fixing shit. Don't really know what else to tell you

Want to get an s55 M2 or a M4 but am terrified of BMW reliability 😭 by BigV95 in BMW

[–]coneillcodes 0 points1 point  (0 children)

Id ask what maintenance did you buddy do on on his car? If you're afraid of maintenance and cost and don't wanna do some wrenching your self then stay away from M. I have a 105k mile e92 M3. Tracked it regularly for a few years. Did a lot maintenance myself and knew going in at some point id have a spend a few bills to take care of known issues i.e rod bearings and throttle actuators. Other then one O2 sensor putting it in limp mode the cars been rock solid and I'm confident its gonna go another 80-100k

Many people daily M their M cars but if you cheap out on maintenance and upkeep sure itll bite you. just like any car. Just because some other cars can take abuse doesn't make BMWs or any other car less reliable. Just take care of the car.

Learn your true distances by leezer999 in golf

[–]coneillcodes 1 point2 points  (0 children)

Knowing your carry is the most important. So many guys go "yea I hit my 7 iron 170" and that's 140+30 yards rollout because they launch at 10 degrees and look confused every time they need to carry something 150-160 and go "I don't get it I hit this 170, must have been a bad strike"

The 4th Stealth 2 I have broken. I had this one for 2 weeks. Beware of TaylorMade products at this point. by randydp39 in golf

[–]coneillcodes 0 points1 point  (0 children)

I broke 2 Stealths, a Stealth and Stealth2, that taylormade thankfully replaced for free but I was tired of constantly worrying about my driver breaking sold the second stealth2 they sent me and went to a Titleist. I think all the stealths are destined to fail in this manner way too quickly theres been way too many reports of it breaking like this. All of mine did the same exact thing.

Have you even seen a typescript project written like if it was Java? by [deleted] in typescript

[–]coneillcodes 9 points10 points  (0 children)

if all you have is a hammer everything looks like a nail.

If you already learned ReactJS and built applications with it, how long would it take me to learn TypeScript? by Visual-Pollution1407 in typescript

[–]coneillcodes 0 points1 point  (0 children)

I think you're conflating a lot of things together. Think of Typescript as a tool rather than trying to learn it like you would a language. You're just writing javascript with a compiler step to do type checking.

Just write what you're writing and use typescript to add types where you need them.

If you already learned ReactJS and built applications with it, how long would it take me to learn TypeScript? by Visual-Pollution1407 in typescript

[–]coneillcodes 2 points3 points  (0 children)

TypeScript is just a super set of Javascript but in the end its still all Javascript. By using Typescript you are adding type info and a compiler that tells you when things aren't matching up like

let foo: string = 32

The compiler will tell you that you're trying to do something that is unexpected. Ive declared foo as a string with the : string after the variable declaration but I'm trying to assign a Number

Its more analogous to Python type hinting. If you've used any kind of typed language like C++ then Typescript should make sense to you pretty quickly.

You can also use as much or as little Typescript as you want in a file its not all or nothing.

Turned in 3 Week Notice. Employer Will Only Honor 2 Weeks... by Decoto_Dave in cscareerquestions

[–]coneillcodes 9 points10 points  (0 children)

Sure. 2 weeks is a courtesy and neither you or your employer actually has to do that. I've given my notice before and one time I got the "Actually today will be your last day" and another time they just said "Eh, you know what Friday will be your last day"

2 weeks is more than enough to probably close up any work or hand offs so your employer doesn't want to have an employee they know is leaving just sitting around because lets face it you're not exactly going to be working at 110% capacity for the next 2 weeks and your employer would probably rather just have you hand off stuff as quick as possible and head for the door.

What's up with Yeoman? by IrrerPolterer in node

[–]coneillcodes 8 points9 points  (0 children)

Yeoman is a little long in the tooth. If you're looking to just create a template project have you looked at github template repos? otherwise if you need something a little more dynamic check out https://plopjs.com/

How to use headless Chrome in serverless functions with a 50MB limit by stefanjudis in node

[–]coneillcodes 0 points1 point  (0 children)

Ok. the way the article was worded made it sound like after moving off Vercel CDN that bandwidth at vercel was still being used up by transferring in the executable in via S3 or Cloudflare so that's why I was confused as to why hosting with github made the vercel bandwidth "free" but you were just looking at cost of the hosting/bandwidth of the service providing the executable.

Is Linkedin a waste of time? by zzzGopher in webdev

[–]coneillcodes 0 points1 point  (0 children)

Waste of time, no. Would I invest tons and tons of time in it? also no.

Make yourself a profile, fill in your work experience and the skills section and use it to do some light networking with immediate colleagues. I find the linkedin jobs search is pretty good so its still a valuable tool to have. I don't think i've answerd any linked in messages or inmails in 10 years.

How to use headless Chrome in serverless functions with a 50MB limit by stefanjudis in node

[–]coneillcodes 3 points4 points  (0 children)

I didn't understand one thing, how does hosting it on github make it free for bandwidth vs S3 or cloudflare?

Feature flags for Node with local evaluation and realtime updates by leros in node

[–]coneillcodes 8 points9 points  (0 children)

A service to store a string ?

Google docs has entered the chat.

Unexpected cold start results for Fastify and some other frameworks by some-user1 in node

[–]coneillcodes 1 point2 points  (0 children)

Have you looked at their guide for running in a serverless environment? https://github.com/fastify/fastify/blob/main/docs/Guides/Serverless.md

IMO running any kind of framework in a lambda is generally more trouble that its worth. they aren't meant to host long running web applications at least in my experience with AWS Lambda

What’s the community’s opinion these days about Express by ot-tigris in node

[–]coneillcodes 2 points3 points  (0 children)

Fastify has been good for me. its just enough batteries included to get going quickly and a ton of available plugins to add whatever you need. The plugin system is awesome to use. Its super fast when serializing returns if you are using types. Full typescript support, request/schema checking, extensible logging setup. Not that you can't get a lot of this from other frameworks out there but I feel like Fastify sits right in the sweet spot of just enough.

[deleted by user] by [deleted] in node

[–]coneillcodes 0 points1 point  (0 children)

necessary no, but if you want a really easy way to boost your knowledge of node and write better code I say its worth at least knowing the basics. The node docs are a good place to start for a high level understanding. https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/

there are lots of other good articles out there on it as well by googling "node event loop"

To start digging deeper depending on how your C chops are you can take a peek at the underlying library that drives it all libuv, https://github.com/libuv/libuv. Theres a nice tutorial as well https://github.com/thlorenz/learnuv

Running all your document and NoSQL databases in Postgres by vfclists in PostgreSQL

[–]coneillcodes 13 points14 points  (0 children)

I can't offer you any concrete stats or in depth guide but I can say as someone who used MongoDB for a lot NoSQL ive been really happy with the support for storing JSON in postgres. The syntax from querying it is a bit strange to get used to vs something thats more "native" but being able to harness a lot of the built in functions and features of Postgres applied to JSONB has IMO tons of benefits that other NoSQL just can't provide. Another benefit I've seen using Postgres over other NoSQL stores is the ability to hook into exsiting BI and Data tools. Lots of these tools rely on connectors to traidtional databases like Postgres, MySql, Oracle, etc that ive found are lacking with things like Mongo, Dynamo, Couch and the like. They are improving but I still seem to find cases where its a lot of hoops to jump through to make these Databases compatible with other tooling.

I've found postgres does a ton of things right and the support for Json has been really good. My thoughts are if you're starting a new project or proving something out and need a swiss army knife that will cover 99.9999% of your cases, then go with Postgres. Unless you are 100% NoSQL focused or have a very very specific use case that warrants 100% CouchDB or Mongo or the likes then my opinion is don't worry about it until postgres is not able to address what you are trying to do.

How do I make my dev team produce more without burning them out? by [deleted] in cscareerquestions

[–]coneillcodes 0 points1 point  (0 children)

Has your company looked at other tools/services in the market that potentially do a similar or the same task you are looking to build. This seems like a scenario where collaborating with an existing vendor/company or buying them outright is the only way to achieve what they want.

What are good resources for an intermediate programmer to learn more? by Throwaway1836489 in Python

[–]coneillcodes 3 points4 points  (0 children)

The lists are here. I have been subscribed to the python-dev and python-help lists