0

I am fairly new to programming so I'm not really sure whats "acceptable" and what isn't.

I was wondering if it's okay to do something like, declare a function as boolean, and return true if the database connection inside is successful and false if it isn't then use that boolean to let the user know if the entry to the database was successful?

1
  • Your ideology is fine and follows usual practice methods. Commented Mar 26, 2013 at 13:35

2 Answers 2

2

Without formal education in programming, you should just do whatever works as you learn syntax. Increasingly as time goes on, you should be able to identify areas of your code which need improvement. If you just test that idea out, you will see that it works. Don't bother asking too many questions of best practice now; Stack Overflow is not Software Engineering 101, and you would only be overwhelmed (and so would the community!). Enroll in a Computer Science or Software Engineering course or two if you can afford it, or, if you can't, then buy a book. Good luck!

Sign up to request clarification or add additional context in comments.

Comments

0

Learning about best practices is a wonderful idea, but like Dan Verdolino mentioned, you will be overwhelmed with abundance of information which you, at your current level, will most likely not understand.

To bring perspective, imagine programming as a Jenga tower. With enough time, anyone can build the basic Jenga tower no matter your programming experience. However, IT systems never stay unchanged and you always have change it: whether adding new stuff or removing obsolete code. Moving one Jenga piece a time eventually makes your tower more and more unstable. This is when your experience shows how good your system is - a true professional would design the whole tower in a way making changes easy and not collapse the tower after you moved 2-3 blocks. An amateur would design a system that works, but once you start changing it, aka moving Jenga pieces, every move is an effort and takes more and more time to accomplish.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.