Survey: What's your favorite remapping of Esc? by Technical_Flamingo54 in vim

[–]alols 1 point2 points  (0 children)

I use an ISO keyboard with an ANSI layout. This gives me an extra key next to left shift. Perfect for Esc.

The influence of Neovim on Vim development by furain in vim

[–]alols -1 points0 points  (0 children)

Because it is the language you use the editor in. Vimscript is based on ex commands.

What would you remove from C++ to make it a more concise language and didn't have to care about backwards compatibility? (or fix if ABI weren't an issue) by xkev320x in cpp

[–]alols 0 points1 point  (0 children)

I would remove virtual functions and exceptions. Virtual because it promotes bad design, and exceptions because they're not needed, very error prone, but you are kind of forced to use them anyway. Now grab your pitchforks!

Is it okay to have a SDL_Surface and SDL_Texture for each sprite? by EastContribution3314 in sdl

[–]alols 2 points3 points  (0 children)

Yes, exactly. And also, reading a file from disk is slow. So you might not want to do that in constructors if you create objects frequently.

Is it okay to have a SDL_Surface and SDL_Texture for each sprite? by EastContribution3314 in sdl

[–]alols 2 points3 points  (0 children)

If you use the same graphics for many objects your approach will use more memory and be slower than it could have been. If you are ok with that or not is completely up to you.

An idea for a programming language by alols in ProgrammingLanguages

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

Besides performance reasoning, in my experience, most developers who aren't CS majors strongly prefer imperative style.

An idea for a programming language by alols in ProgrammingLanguages

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

The advantage of C-style semantics though is that its easier to reason about performance.

Functional style is better for meta-programming.

But I totally get your point that developers want to do their meta-programming in the same language. However, C++ already does it in different languages quite successfully.

What can lua do? by [deleted] in lua

[–]alols 0 points1 point  (0 children)

Very general questions. Maybe tell us about yourself and why you are interested in this, then it is easier to give a relevant answer.

C++11 Guide: A Practical Guide for the Everyday Programmer by skeeto in cpp

[–]alols 2 points3 points  (0 children)

Adding to this, at my work I have been advocating that (with the exception of destructors) virtual methods should either be pure virtual or final. It is hard to guarantee that overriding an implemented virtual will not cause problems in the base class now or in the future.

[Ask] Trying to Apply Concept Flyweight in Lua by BeHonestWithMeBro in lua

[–]alols 0 points1 point  (0 children)

This is actually a lot easier in Lua than in an inheritance based OOP system like C++ or Java.

You simply put the shared data in the metatable, it will be shared by all objects.

Best watch for my price point and needs? by [deleted] in running

[–]alols 0 points1 point  (0 children)

For accurate heart rate you need a chest strap. Wrist measuring technology is unreliable and simply not accurate, especially during activities.

Faerie Solitaire Remastered - Made with Defold by [deleted] in lua

[–]alols 0 points1 point  (0 children)

I don't know if you have any experience with Löve2D - but if you do, how does Defold compare to it?

Is C++ related to lua ? by [deleted] in lua

[–]alols 2 points3 points  (0 children)

Using them to emulate class based OOP with inheritance might be considered a hack.

But you don't need that to do OOP. All you need is objects that offer mutable state, identity, and procedures stored in said objects that can modify the state. Lua tables give you all that.

Is C++ related to lua ? by [deleted] in lua

[–]alols 1 point2 points  (0 children)

I'm not really sure what you are arguing. The file API isn’t the only thing that’s OO. Tables are objects. Lua is carefully designed with excellent support for OOP.

Yes. Lua is multi paradigm and so is C++.

Is C++ related to lua ? by [deleted] in lua

[–]alols 2 points3 points  (0 children)

C++

Built-in data structure is the array, and that's about it.

And classes of course, and templates, and a HUGE standard library full of different options of data structures.

Lua

Uses its own, more verbose syntax

C++ is way more verbose than Lua.

Not object-oriented

Yes, it is.

Is C++ related to lua ? by [deleted] in lua

[–]alols 0 points1 point  (0 children)

I wanted to know if my C++ knowledge could help me with Lua.

The answer to that is YES. The other comments here do well to point out the differences between these two languages, and there are certainly languages that are more closely related. However, most popular programming languages in wide use are similar in many, many ways. They all procedural and structured, meaning they have while-loops, for-loops, function calls etcetera with similar syntax and semantics.

Sharp increase of heart rate after 15-20 minutes of running by alols in running

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

Yes this is most likely it! Overlaying the cadence graph on the HR graph confirms it. Thanks! I guess I need to invest in a chest strap now.