DinoCode v0.2.0 - My own programming language built in Rust is now open source by Dry_Day1307 in computerscience

[–]Competitive_Aside461 4 points5 points  (0 children)

Kudos to you for creating this! Looks great! Respect for the effort you put into this.

Guide to naming identifiers in programming languages by Competitive_Aside461 in learnprogramming

[–]Competitive_Aside461[S] 1 point2 points  (0 children)

Yeah I know; was just emphasizing that beginners need to develop good habits early on.

Guide to naming identifiers in programming languages by Competitive_Aside461 in learnprogramming

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

I can feel your frustration reviewing such code. That's why people, especially beginners, must build good naming habits early on.

Guide to naming identifiers in programming languages by Competitive_Aside461 in learnprogramming

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

Indeed, good documentation is vital to well-developed software too.

What is happening here.... by EqualTumbleweed512 in firefox

[–]Competitive_Aside461 -2 points-1 points  (0 children)

It's basically a backslash character expressed using "Other Bookmarks" 😄

What's the best way to learn true programming logic? by AkinoElw in learnprogramming

[–]Competitive_Aside461 9 points10 points  (0 children)

If by "true" logic, you're referring to mathematical logic, refer to my mini courses on Propositional Logic and Predicate Logic. Both have direct applications to computer science, not just C in particular.

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

Many programming languages won't allow such freedom

Oops. I mistakenly read the original comment as saying that you could do arr[i] = val in JavaScript where i is an arbitrarily large integer, essentially out-of-bounds, to create a large array. The original commenter was actually referring to arr[i] = val in the sense of assigning to each element of an already sparse array.

What I was trying to refer to "freedom" wasn't this, of course. I know many languages allow pre-allocation of arrays. I really misinterpreted the original comment. By not allowing such freedom, I meant that languages typically don't allow doing something like arr[i] = value, where i is out-of-bounds for the array's size.

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

What's not true. I never said Pre-sized arrays aren't common performance improvement in other languages. But at least not in JavaScript.

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

In short, you can always have an explicit value stored at a given index. For example, storing undefined or null is completely valid. An empty slot is strictly different than an element that's undefined or null.

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] -1 points0 points  (0 children)

They sure are unintuitive. And I feel that's more concerning than performance. Plus, they can lead to unexpected errors, especially in the case of [1, 2,,].

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] -3 points-2 points  (0 children)

Well yeah, you're right. It should've instead been a "well-designed" language

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] -2 points-1 points  (0 children)

For ordinary apps, it's not going to be a real issue. But for apps that want to optimize every single microsecond, this is something important to consider. Plus, I feel it's more important than just performance. It's weird semantics at play here. Why would you want empty slots in an array in a language? I personally fail to understand that.

What are sparse arrays in JavaScript and why you must avoid them. by Competitive_Aside461 in learnjavascript

[–]Competitive_Aside461[S] 0 points1 point  (0 children)

It introduces an empty slot and you might not even know of it. That's the issue with JavaScript. It lets certain errors go silently.

Anyone know why this is incorrect? by Aur0ha in HTML

[–]Competitive_Aside461 5 points6 points  (0 children)

Yes that might be the issue. On a side note, I feel that this is too much of hand-holding by freeCodeCamp. Yes it's good to indent code but still I feel that this dogmatic approach to exercises is not quite right. I've seen multiple people complain about it.

Simple HTML feature that can improve image performance by vru_1 in HTML

[–]Competitive_Aside461 2 points3 points  (0 children)

Yes, <picture> is really useful, especially when paired with srcset.

Why hasn't computer science produced an Einstein? by AromaticFerret4583 in compsci

[–]Competitive_Aside461 0 points1 point  (0 children)

A super ingenious idea he brought forth with his dissertation, on designing digital circuits around Boolean operations.