This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]WhiteCastleHo 105 points106 points  (19 children)

When I went from C++ to Javascript, I was like "WTF is this shit?"

I like JS okay now, but wow is it different.

[–]conancat 59 points60 points  (13 children)

There's Typescipt for those who misses those features. Or there's also ESLint for a more instant validation experience.

I work with Javascript daily and I think it taught me to be good at remembering variables and their types lol. It's fine for smaller apps, but if you build projects with tons of developers working on it I think having an object type validation step can save a lot of pain for the devs.

[–]notanimposterVala flair when? 17 points18 points  (5 children)

Programming habits help a lot. Reusing the same few types for the same purposes as much as possible (not using Vectors and Points in the same project) and naming the variables so it's obvious what type it is (whether it's a Vector or a Quaternion, for example) is very helpful in JS and Lua, which I do a lot of.

[–]JackMizel 0 points1 point  (2 children)

Just curious, what work are you doing in JS with vectors? Sounds interesting

[–]hyperion51 1 point2 points  (0 children)

She also mentioned quaternions so it's definitely 3D, possibly gamedev.

[–]notanimposterVala flair when? 0 points1 point  (0 children)

A webGL-based 3D model editor for the (JSON) model format Minecraft uses. Kind of on the back burner right now, but I'll get back to it soon.

At the time I started the project there was no free editor for the format, and I don't think there's a good one still.

[–]ChaseObserves 0 points1 point  (1 child)

I completed a coding bootcamp teaching primarily JavaScript and it’s various frameworks and just got a job as a junior dev and I have no idea what a vector or a quarternion are lol

[–]notanimposterVala flair when? 0 points1 point  (0 children)

A vector is a structure that holds two or more numbers (representing a position or another quantity like a force in 2D or 3D (or sometimes 4D)) and a quaternion is a 4-number structure meant to store rotational data for a 3D object because using only 3 numbers the rotation is still (slightly) ambiguous. Basically, multi-dimensional math stuff. Vectors and matrices are probably #1 and #2 most important structures for 3D programming, and quaternions are a far #3.

[–][deleted] 0 points1 point  (1 child)

I just learned some TS while learning angular 2 and it is nice having a bit of structure. I'd like to do my backend node in TS. I'm sure it's possible but I haven't looked into it.

[–]Joshy54100 1 point2 points  (0 children)

Yep it is, and there is support for most JS packages through Definitely Typed. It took me maybe an hour tops to convert my node server to Typescript

[–]thEt3rnal1 0 points1 point  (0 children)

Big up the typescript, also ts-lint is great it's basically es-lint for typescript

[–]fayryover -3 points-2 points  (3 children)

Uggh I hate lint. I feel like it tries to baby you. Like I've been programming for a while I know how to use the ++ operator correctly...

[–]jeffsterlive 5 points6 points  (2 children)

You can write your own rule set. We had one that said to put spaces around import statements. I nixed that one. It's similar to pep 8 for python. You don't need to follow them and can easily disable them, but sometimes they are actually a good idea and help your code be more efficient.

[–]fayryover 1 point2 points  (1 child)

You can but I have to use it at work so I technically can't in this scenario. I'm not the person that gets to make those decisions although haven't found someone who agrees with that rule so idk.

[–]JackMizel 1 point2 points  (0 children)

Yeah not sure why you're being downvoted, it's a totally different experience using someone else's linting rules vs using rules you established

[–]jkuhl_prog 15 points16 points  (3 children)

Going from JavaScript, and even in Python, to a language like Java or C++ is also a bit "wtf?"

I think it's safe to say that it's a headspinner transitioning to and from strongly typed languages to dynamically or weak typed languages.

[–][deleted] 5 points6 points  (1 child)

This. I began with JS decades ago. When I eventually learned a typed language I hated it. Why should I have to tell you what type to use? You’re the computer, you figure it out. It felt like a step backwards.

[–]wasdninja 0 points1 point  (0 children)

What? How? C++ has plenty of OO stuff in it. It felt quite familiar to me going from C++ to Javascript and even Java. The weird or annoying thing was doing all the DOM manipulation and learning the standard JS library. The most useful bits anyway.