Is it possible to rewrite any code that uses pointers (C #) without using pointers in Node.js?

-1

Is it possible to rewrite any C / C # code that uses pointers in a way that does the same thing without using them?

My fear is more complex codes. The simple ones I believe do not have difficulties to rewrite.

How could I replace pointers using the same concept in JavaScript?

    
asked by anonymous 27.10.2018 / 08:46

1 answer

0

Possible is yes, all programming languages can do anything. The question is the work it gives, it's usually so much, the risk is so great, rewriting will be bad, writing the same thing from scratch is much more interesting.

If the code is in C # it is unlikely to use any pointer. It is very rare to see the use of pointer in C #, and now almost every situation does not need more, and where it needs is in something that does not make sense to port to Node. In C it depends on a lot of things, but it does not make much sense to do this kind of conversion.

Even if you have good code running in C or C ++ or C # I do not understand why you want to convert it to JavaScript primarily to run on the Node. .NET has the same capability and is absurdly faster than the Node. If you have the code that solves your problem, use it directly. Why switch to less robust language?

If you think you will pick up a language and turn the instruction-by-instruction code into another language, or even begin, because it is not just that this does not happen, it means you have a naiveté that will certainly result in the bad end. There is no magic, there is no free lunch. Whatever you are trying to do, there is no face that will work. An experienced person knows that even she would not do well and probably would not. She would understand the problem and write a code even better. Or use the right tool. If you are wanting to do this, you must really (all) dominate all those languages, it's the only chance to work, and then it starts to make less sense to convert, so nobody does.

All objects in JS are types by reference. The pointer is what makes something be accessed as a reference, so anything that encapsulates an object is using a pointer. The fact that you do not know this, and no problem people do not know why they do not need to use something like this, shows that you are not prepared to do the conversion, this is the easy part, you will find many difficulties along the way that you will not know how to handle, is a project that is doomed to failure. I'm sorry, but the solution is not this one.

    
27.10.2018 / 14:09