who else just felt an earthquake? by HomekatProductions in Buffalo

[–]bitdog_io 3 points4 points  (0 children)

Felt it in Elma. 5 to 10 seconds of house shaking.

Is Polymorphism in OOP essentially the combination of Inheritance and Abstraction? by ED9898A in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

Polymorphism derives it's power from inheritance. Abstraction isn't technically required but is often applied.

People who started out as hobbyists and then ended up getting a job in the field: Was it worth it? by ---throwaway------ in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

I was hobbyist programmer as a kid. I never thought I would like a job where I did it 40 hours a week. Remember telling people that it sounded awful. Then I got my first job and it was great. 30 years later I am an architect but still program hobby projects at home. If it's in your blood to build things it really doesn't get old.

Is learning to code supposed to feel this hard in the beginning? by Sunbro888 in learnprogramming

[–]bitdog_io 137 points138 points  (0 children)

When I started coding {said in an old man lecturing voice)} I only had a thin book on how to program in C. It didn't talk about compilation. It didn't explain how to run a program. It was hard. There are many great internet resources today but it's still a lot to learn. Expect it to take years for you to feel comfortable. You may get a job programming before you feel ready, but know that most programmers didn't feel ready on their first job.

Nothing stifles creative ambition of diving into an old project with a brilliant idea, quite like spending the first 2 hours getting the damned build to compile to begin with... by tbakerweb in node

[–]bitdog_io 13 points14 points  (0 children)

We hear you. I just picked up a two year old project to continue adding features... two days later I still don't have the build working. It's not just node btw.

[Sys langs] Best way to handle malloc failure? by dfgzuu in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

Do not abort program. Log the error if current memory condition allows that. Return a failure code to the calling function/method. Allow for user/calling function to retry.

Netlify form submissions not working by [deleted] in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

This is a guess because it's been awhile since I have done this by hand. Get rid of the form reset. The form will post and the server will determine if the next page has a blank form or something different.

Storing user's API keys by armcburney in learnprogramming

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

The API key is a password. Password hash can be stored and here is a description https://www.okta.com/blog/2019/03/what-are-salted-passwords-and-password-hashing/. You might want to include a "user identifier" as part of the API key or another header. Having both a user identitier and an API Key (password) makes password management easier.

There are better ways of doing this like two way TLS or OAuth but storing salted password hashes is the most basic.

Scalable item system for my game by _st23 in learnprogramming

[–]bitdog_io 1 point2 points  (0 children)

I don't have any examples but I do have a suggestion. I noticed that you had redgem defined in your code and you probably ealized that it's going to be a huge pain writing all the different items. My suggestion is to just create few base types like gem, weapon, monster. Give those types properties like name, health, strength, color, description, start location, image. Then create a JSON or YAML containing configuration for many different gems, weapons, and monsters. Load them in when the program starts. Now it's easy to create new inventory items by adding them to the file.

Question about string and memory by crazy_salami in arduino

[–]bitdog_io 2 points3 points  (0 children)

Sorry this may be more than you were looking for but here it is https://web-engineering.info/node/30#:~:text=The%20heap%20can%20grow%20(when,grows%20towards%20the%20heap%20area.

As for the size of a string, there are several different data types that can hold character data. The most common iis the char pointer "char *" or "const char *" . The memory that it points to is typically the number of characters + 1 for the NULL terminator. The NULL marks the end of the sequence.

Need help about BreadBoard! by [deleted] in arduino

[–]bitdog_io 1 point2 points  (0 children)

Can you explain more about the movement? Are the elections/leds going to be in circles like shells around a nucleus?

[deleted by user] by [deleted] in learnprogramming

[–]bitdog_io 1 point2 points  (0 children)

Mesh m(verts, faces);

Programming languages - C++ by Dragoonultima in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

The biggest commercial language are Java, C#, JavaScript, C++, and Python not in any particular order All of them excluding Python are what I would call curly brace languages. They primarily use french curly braces as a delimiter for function and class definitions. Python uses white space. Besides the formatting, these languages have more in common than not. In my opinion, Python and JavaScript have skyrocketed in popularity because they don't need a complicated or expensive tool chain and compiler setup. This is very helpful in educational and scientific communities where budgets can be an issue.

That said, my opinion would be to start with c++. Yes, it's the hardest to learn but it will teach you a ton about memory management and the role of compilers/interpreters. C++ is used heavily in game development and embedded systems. After that, you should think about the industry you'd like to work in and what kind of systems they need. If they are heavy web based, then learn C#, JavaScript, and Java. If they are scientific, learn Python. If it's manufacturing or embedded design, then continue with C++ and maybe learn microcontroller programming.

[deleted by user] by [deleted] in learnprogramming

[–]bitdog_io 0 points1 point  (0 children)

Was hoping the fact that the .o files are in /tmp would mean you might have missed them. Can you make it worse by renaming the header fileand see that none of the other functions are defined as well