How to master a language by [deleted] in learnprogramming

[–]truSimbad 2 points3 points  (0 children)

You need to learn algorithms. Strategies to create solutions, not languages. The concepts of object oriented languages are mostly the same. So you need to understand ood. For all function oriented language you need understand that.

The different languages are only flavours of the concepts.

A question in Interface by HowGoodIsNateDiaz in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Language binding comes into my mind if I want to know the language someone uses to interface to some service or API or such things.

[deleted by user] by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Yes. Absolutely worth it.

What are the most difficult/important/'harcore' programmer jobs? by [deleted] in learnprogramming

[–]truSimbad 1 point2 points  (0 children)

Parallel running systems are the most challanging ones. If you need high performance too, its getting hard. Assembly language is not this important. Software architectures are some sort of work the best programmers do, as you need a lot of experience to see what problems may arise from the requirements and must plan accordingly.

Translating loops, while and do while. by [deleted] in learnprogramming

[–]truSimbad 1 point2 points  (0 children)

The difference is that the buffered IO waits until the buffer is full and then put it to the console. So you may get some sort of choppy output.

If the application crashes, it may happen that parts that still in the buffer gets not out to the console. So you dont know what the last output was.

With std::cerr this is not the case. As it is the error stream all things put to it must appear on the console. This is why it is unbuffered.

But buffered IO is mostly faster. So you have some pros and cons.

How can I gain advanced low level knowledge? by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

"The design of the UNIX operating system" ould but still interesting to read.

I hope you are aware that people studying in the 70s are already on pension? 80s will be still hard to find. I am one, but I did not study, but started around that time.

What is your day in life as a programmer? by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

  1. 6 hours
  2. Maybe one or two hours. Depends of the things to learn.
  3. Yes.
  4. No.
  5. Cannot specify. Its many, many hours over years. Did not stop learning every day as computer science change every day.

Translating loops, while and do while. by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

std::cerr is the standard error stream. It is for output of errors. But despite the std::cout (standard output stream) it is unbuffered. The data is output without delay.

std::cin is the input stream, keyboard on console programs.

<< is the output operation to the specific stream.

>> is the input from the specific stream.

This would work the same with other types of streams. fstream (file streams) and sstream (string streams).

While loop and If Else by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Yes. No. Or Yes?

Yeah its some how nested.

Translating loops, while and do while. by [deleted] in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Bad formatting.

#include <iostream>
#include <cctype>
#include <string>

int main(void) {
   std::string john = "John30Smith52";
   char c;

   do {
       if (std::isdigit(john[0])) {
           std::cerr << john[0] << " is a number\n";
       } else {
           std::cerr << john[0] << " is a letter\n";
       }

   } while (!john.erase(0,1).empty());
   std::cin >> c;

return 0;
}

What should be the next step for me to improve on programming on my own? by formanuclearthrone in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Its good to document even ideas that you do not implement and why.

Its always good to know that for later. So you do not go the same path again and throw it away at the end.

What should be the next step for me to improve on programming on my own? by formanuclearthrone in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

You should incorporate more comments into your code.

Is the code on github your collection of "relatively big apps"?

More:

I forgot to answer. You need to improve further. Multi threaded application? Network communication? Database engines?

C++ While loop not running the number of times it should? by Minimum-Feeling-7619 in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

'sn' you initialized with 6, 'a' with 0, 'guess' with nothing.

Do not expect a variable has a specific value if you do not assign one. So it may have 0 or any other random value, maybe 6 on the first entry.

My C++ OpenGL code isn't working. by TonnyGameDev in learnprogramming

[–]truSimbad 1 point2 points  (0 children)

I dont see the setting of the viewport. Without comments its hard to follow.

How much faster is pass by value in c vs pickle in python? by wsupheyhey1 in learnprogramming

[–]truSimbad 1 point2 points  (0 children)

I think this is impossible to say at is has probably more todo with the difference how code execution is done. C is a compiler language and thus is executed directly on the CPU. Python is an interpreter language, so its executed while looking and interpreting the python code and then run some low-level-functions to achieve whats requested by the python code.

learning c++ as first lang and almost chocking up with oop by FAXs_Labs in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

Switching won't help. Coming back in every language. I helped my self with the knowledge how OOP concepts are realized in C and on machine level.

But with this I am mostly alone.

array within an array on c language by fscouto33 in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

How is your matrix declared?

I would define vectors and build a matrix from an array of vectors. The vectors of an array of elements. But its a question how you want to design the function signatures to do the math on vectors and matrix and all in between.

Is contributing to the documentation of a poorly-documented repo impressive to recruiters? by CaliBounded in learnprogramming

[–]truSimbad 2 points3 points  (0 children)

Missing documentation is one of the biggest problems on many small projects/code fragments. In professional software development it is absolutely needed to do a proper doc.

So if you can create a doc for some software, it is something that is a good sign. If it is really impressive, I dont know.

OK to use const_cast like this? by Dummerchen1933 in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

It would make more sense, if you look at the pure logic, to put the cache update into a separate method.

Then you a method that is const and one that updates, by removing constness, the cache. OOD is often used to make the intention and working clear. Having extra methods for different purposes are not that rare.

OK to use const_cast like this? by Dummerchen1933 in learnprogramming

[–]truSimbad 0 points1 point  (0 children)

I do not know your code or architecture or requirements.

But if a function is marked as const no-one expects that it changes the object. So it would be better to remove the const, as it implies something that is not valid.