The code-organization tag has no wiki summary.
1
vote
1answer
60 views
Code to manage weekdays and hours
I have the following code:
1) the html part consist of two container. Both containers have a list of hour and day weeks
2) a javascript code which is used to manage these lists of inputs.
I ...
0
votes
1answer
47 views
Method Ordering - Readability / Maintainability [closed]
What is your opinion on method ordering?
Should it be public methods at the top followed by private methods?
or
Should it be linear order so that methods calling methods stack on top of each other?
...
2
votes
2answers
71 views
How can I better organize code that modifies the functionality of a page?
Here's a bit of one of my web forms which is reached by clicking on a link in a calendar. Based on what you click, you end up at this page with a different QueryString. Based on that QueryString, we ...
3
votes
1answer
54 views
How to improve method of opening file in python then writing to another?
Very simple I want to edit a virtual host files and replace the tags I made with some actual data:
import os, re
with open('virt_host', 'r+') as virtual
file = virtual.read()
file = ...
3
votes
5answers
267 views
How to avoid passing variable to a method again and again
Following is a chunk of code from my class which generate PDF document. I am refactoring my code and in the process I have created short methods. But I have to pass 'table i.e PdfPTable' to my methods ...
3
votes
2answers
120 views
Write it better/neat/fast (if condition)
How to write following if condition clean/fast/readable.
Any one of the fields 'address', 'city', 'district', 'province' can be null. I want to make full address by concat all these fields. Like
...
4
votes
2answers
138 views
Is this C game code OK? Structures and bitfield flags with some macros to handle them
I wrote some C code for working with some data for a game, I wanted to know what do you think and what could I do to improve it, what should I change, etc.
These are just some lines of the file, you ...
0
votes
2answers
55 views
Extract common code to enable/disable, show/hide controls on some condition
I have few controls on my page which I want to show/hide and/or enable/disable on some condition.
Images to help illustrate the requirements:
Following is the code to show/hide, enable/disable ...
4
votes
3answers
133 views
Alphabetizing `import` Statements
I did a quick google search, and it didn't show up.
I haven't noticed it posted in pylint.py, or PEP8.py.
My emacs mode doesn't warn me if my imports are listed arbitrarily...does anyone do this?
...
1
vote
1answer
232 views
General Review, Wheel of Fortune Game
The Demo for what I have made is located here: http://jsfiddle.net/maniator/H5LKy/181/
Basically I am trying to make a Wheel of Fortune type game.
Is there anything I could improve on in the code?
...
2
votes
1answer
240 views
Static quiz module with predefined answers
I was building a QUIZ module for one website. It is a simple TRUE/FALSE statements where you first choose the answer then correct answer is getting displayed and then you can move forward to next ...
7
votes
1answer
411 views
JavaScript Boilerplate - Review comments required
I am in between to create JavaScript Boilerplate (collection of best practices around) for low/medium complex project and will host on GitHub in sometime once finalized it.
Have divided the ...
1
vote
1answer
153 views
basic javascript to advanced javascript
I have following code for a content scroller. This has been implemented with basic jquery. Iam trying to convert the same using advanced javascript concepts. Guide me to implement the same.
Working ...
2
votes
1answer
72 views
Organizing a wordpress template with lots of variables
A question of organization and best practices with Wordpress templates:
Where should I put my variables? Directly in the template? In a separate file via includes()?
Should I place all variables at ...
4
votes
1answer
214 views
Optimizing and consolidating a big jQuery function
I understand this is a very vague question and a lot of code to look over. My question is basically: I have all these functions that work together to create functionality on a page: is the structure ...