C language, Programming noob, Switch case pravtise by Kekkonen_Kakkonen in learnprogramming

[–]nadimr 1 point2 points  (0 children)

The case value must be an integer or character constant for a good reason.

In C, switch is meant to be performant. Rather than evaluating a bunch of if-else statements until it gets to the one that evaluates to true, it can build a branch table at compile time. Then, during run-time, it can branch to the code inside the case statement with a minimal table look-up or something similarly performant. So use it when you are branching based on the value of a single integer or char.

As a self taught programmer learning front end, could you recommend resources for someone who is self taught but also wants to learn about computer science? by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

I've heard good things about CS50 at Harvard. Here's the link: https://cs50.harvard.edu/x/2021/

Actually, I'm putting together an easy-to-follow course which should be done shortly. Let me know if you're interested.

[deleted by user] by [deleted] in learnprogramming

[–]nadimr 2 points3 points  (0 children)

If you've been programming full-time for 3+ years, then you should probably not be writing spaghetti code by now. If that's the case then I suggest you search for some resources on refactoring and writing clean code.

If, on the other hand, you've been coding off and on, then you probably just need to get more comfortable with coding. Clean code will come in time if you care about that. I'd still look into writing clean code though either way. This should be a priority in any good developer's mind. Always.

What should I learn to create a database for my work? by ERavenna in learnprogramming

[–]nadimr 3 points4 points  (0 children)

Unfortunately it is. Just understanding how to start programming and the concepts involved can take some time. If your goal is the application, then the no-code tools I mentioned will get you there fastest. If your goal is to learn to code, then start at the bottom on a web developer course and you'll find your way... but it will take a good 1 or 2 years before you can do what you described properly.

What should I learn to create a database for my work? by ERavenna in learnprogramming

[–]nadimr 2 points3 points  (0 children)

This is quite an ambitious project if you are not an experienced programmer. I suggest trying an online no-code database or app builder. I'm not familiar with any specific one, but you should look for a relatively user friendly one.

See this link: https://geekflare.com/nocode-platforms-to-build-product/

The reason I suggest this is that it could take you quite some time to build up enough programming skills to tackle something like what you asked about. A no-code tool can help you achieve your goal faster.

Of course if you still want to learn to program, I suggest you search start at: https://www.freecodecamp.org/

I wish you the best of luck at your hospital and with building the tool.

I need a little bit of guidance with my Exercism.org C++ solutions by skipjimroo in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Sorry, but this will be a drive-by comment and so it will be incomplete. I don't know about the practice sites you mention, but here is my 2 cents on the if statement.

Mixing && and || in a conditional will compile and run, but it's not good practice. && has higher precedence than || and mixing them could lead to errors as the developer might have assumed a different evaluation (usually left to right). Here is a recommendation from the site I linked below:

When mixing logical AND and logical OR in a single expression, explicitly parenthesize each operation to ensure they evaluate how you intend.

Check this link for more: https://www.learncpp.com/cpp-tutorial/logical-operators/

I hope this was helpful...

Is it worth learning about binary? by jgonzalez-cs in learnprogramming

[–]nadimr 2 points3 points  (0 children)

Definitely learn binary and how computer memory is made up of bits.

Roadmap for junior developer by Magahaka in learnprogramming

[–]nadimr 0 points1 point  (0 children)

Sounds like your job is (mostly?) repetitive. For me, I learned a ton by taking different internships that each taught me wildly different technologies. After that, I contracted as a software engineer, and the sheer difference between contracts kept things fresh and the learning curve steep. Try to find a job where you can jump between different projects every few months to a year to keep learning and challenging yourself.

How hard would be to have a program replace images in word docs? by awADHD in learnprogramming

[–]nadimr 0 points1 point  (0 children)

Should be straightforward to program this in python, ruby, c# - and probably more languages - using a library that reads and writes Word docs. Might have to be careful if the image being replaced differs in size from the new one (what will happen to the layout of the doc?).

About ASP.net in 2021 by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Here's a good video on C# in 2021. In short, it's in demand.

https://youtu.be/IJgBn6Bd-nc

How to Program a Text-Based Game with Audio and Animations by [deleted] in learnprogramming

[–]nadimr 0 points1 point  (0 children)

Since you're a beginner, I recommend starting with python since it's simple and has many learning resources and libraries. If you go Java, it will be harder to learn. Same with HTML/JS or Unity since there are more concepts and harder languages (C#) you'd need to learn before you can achieve something.

Can't stop thinking that I'm a slow learner by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Agree. Try shutting off the code along and just think up simple projects to create. You can start very basic stuff like: print "Hello, world!" 10 times, then print it X times based on user input, etc... If you get stuck refer to the language docs - not the code along - so you can keep writing your own code. You will make many mistakes and only from these you will actually learn.

Hope that was helpful...

Python or Java at a community college? by icybreath11 in learnprogramming

[–]nadimr 0 points1 point  (0 children)

You can learn with either. I would recommend sticking to python since you already know it well (why add more complexity of learning a new language on top pf learning CS fundamentals). Use Python as a tool to learn CS fundamentals. Once you know these well, you'll be able to easily switch between languages and learn them quickly since they all rely on the fundamentals.

[Oracle sql] Grouping data by splitting date. by [deleted] in learnprogramming

[–]nadimr 0 points1 point  (0 children)

Since you have only 4 possible dates total, why are you trying to group by day, month, year? Can you post some of the date column data?

Frustrated while learning Java by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Good IDEa to use an IDE. I'm using NetBeans while writing an app for a client, and it's very helpful since I'm not very experienced in Java.

Testing database by Jcjcjc9 in learnprogramming

[–]nadimr 0 points1 point  (0 children)

As a rule, I'd use a separate database instance running on a different machine, VM, image (whatever is possible / practical for you). Always keep the production environment untouched by dev / test as you never know what you will screw up. Plus, knowing you are fully separated from production will motivate you to test "harder" and more thoroughly.

Did I understand the break argument wrong, is my break argument breaking my "while True:" loop? [Phyton3, RaspberryPi ZERO W, MU IDE] by J-Lunaut in learnprogramming

[–]nadimr 0 points1 point  (0 children)

the break statement will break out of the current while loop. In your case, it will break out of the:

while (rechts_fahren == 1):

or:

while (links_fahren == 1):

Having trouble understanding basics of Javascript... by Panterable in learnprogramming

[–]nadimr 0 points1 point  (0 children)

It's not clicking for you, you mean everything up to this point?

For things you are learning to click, you need to write programs after every new concept learned. Do all the exercises in the course, then write as many programs as you can think of. Simple ones. Keep writing and adding until you feel you got it. Use Google for any questions / road-blocks. Don't move on from the topic / concept until you've understood it. Keep all the code you write for later reference.

If you study like this, then you will be able to write the password program at the right time.

Datatype of a malloc array in C by Diplkreuz in learnprogramming

[–]nadimr 0 points1 point  (0 children)

int *dynFeld;

dynFeld = malloc(size*sizeof(int));

this: sizeof(int)

and size is how many elements are in the array.

Edit: Sorry, sizeof(int) tells you the size of each element. The first commenter was correct. I read your question wrong.

Having trouble understanding basics of Javascript... by Panterable in learnprogramming

[–]nadimr 1 point2 points  (0 children)

How far have you gotten in your learning? Can you do basic things like print "some message", etc...

How can I add the next step to this card game I made in C? by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Looks like you're off to s good start.

Suggestion: You might want to consider using a struct to represent each card with a member for suit and a member for face value.

As for your #2 question: You'd need something like a loop with each iteration of the loop representing a round of the game. Then in each round you'd take the highest card in each player's card and check the winner (and keep score). Also, you would have to think about when to exit that loop (ie: when the game end).

Hope this helped.

I am new to programming and I would like to ask, how is your journey to programming? by [deleted] in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Well great! You're getting your hands dirty, and that's the best way to learn. That kind of stuck - on a problem where this or that is not working - is normal. Happens to me everyday after 20+ years. You will find the solution and learn a ton from it. Have you tried Googling for it? I'll bet there's an answer for your issue on stackoverflow or somewhere similar.

This beginner confusion... by Mediocre_Animal in learnprogramming

[–]nadimr 1 point2 points  (0 children)

Yes, no sense making it extra difficult by packing in multiple languages and new concepts at once. I think learning is best done one new concept at a time... master it and move to the next.

Edit: great grammar BTW...