|
naijaguru (m)
|
Did You Know? (Programming Tips)Hello! I would love to see a long thread of bits of programming tips from the corners of our heads You can reply to a tip by supporting and go further by adding yours or criticizing it and then post the right tip. Don't be scared of posting a wrong tip, you'll always learn. OK I START - Did you know that SIMPLE APPLICATIONS are less security prone?
|
|
|
|
|
|
naijaguru (m)
|
Did you know that Smarty is not just a Php tag replacement system but a Template/Presentation framework for seperating code from content, thus creating a clear division of labour between the coder and the designer
|
|
|
|
|
|
abdkabir (m)
|
Did u know, taking a few time, thinking of and planning your coding project could save you a lot of time rather than just jumping to coding thinking the ideas will come as you program
|
|
|
|
|
|
abdkabir (m)
|
Did u know, taking a few time, thinking of and planing your coding project could save you a lot of time rather than just jumping to coding thinking the ideas will come as you program
|
|
|
|
|
|
naijaguru (m)
|
Yeah you are right abdkabir. A proper use of UML or OOD (Object Oriented Design Methodology) gives u a robust and maintainable result.
did you know that PEAR Packages in PHP is Similar to JAVA's API ?
|
|
|
|
|
|
my2cents (m)
|
did you know that if, in a loop, you assign the size of an array outside of the loop as opposed to including it as ".size" inside, say, the for loop, that you actually save on memory?
In other words, rather than have: (for i=0; i < array.size(); i++), you should have: var j = array.size(); (for i=0; i < j; i++)
y? because in the loop, the processor has to calculate the size of the array each time whereas in the 2nd method, it is calculated and stored in "j" just once.
Pretty subtle, but worthy of mention.
I hope this helps.
|
|
|
|
|
|
|
|
abdkabir (m)
|
Nice one @ naijaguru Still even if the project isnt big enough to require OOA , OOD or UML. Did u know its still important u do the thinking about how you will do your coding before starting. IT ALWAYS HELPS U know just thinking about possible classes, attributes, methods , procedures, Algorithms, Data types etc.
|
|
|
|
|
|
naijaguru (m)
|
@ my2cents. I think using for(int i = 0; i <= array.lenght(); i++) { , your code here } (Java) is better. Why? What if you are coding a sort of game or a multi-threading app, and the length of your array increases during runtime. Your loop would simply accommodate the current array.length(). Copying array.length() in a variable would result to looping in a wrong number of times. did you know that nl2br() function in PHP adds a <br> to every newline in your user input from the <textarea> field?Seriously, I never knew that, I had to use TinyMCE, an application written in JavaScript to convert <textarea> inputs to HTML and also act like a sort word processor on your HTML forms, for a simple news management system. It was so stupid because TinyMCE takes over 1MB of space from ur host, and you also have to deal with JavaScript compatibility issues, tho light. Little functions like that could save you the stress of re-inventing the wheel.
|
|
|
|
|
|
simmy (m)
|
omo i bow for you guys o
|
|
|
|
|
|
|
|
|
|