Here is a short description of Programming Style from Wikipedia: Programming style is a set of rules or guidelines used when writing the source code for a computer program.
1
vote
2answers
45 views
getTweets in JavaScript
I'm a JavaScript newbie who was first introduced to JavaScript by jQuery. I'm trying to switch over some of the small things I've written in jQuery to JavaScript as a way of learning. I was wondering ...
2
votes
3answers
149 views
JavaScript code cleanup
As this community is full of experienced JavaScript developers, and I'm a newbie in JavaScript, I would like if some of you could look over my code for a website I'm building (personal portfolio) and ...
0
votes
0answers
43 views
Could an IDE give feedback to the developer? [migrated]
I was thinking about IDEs and how they could be changed. I came across projects like the Light Table IDE on Kickstarter, which gives more of a visual touch to modern IDEs (as well as other neat stuff ...
2
votes
2answers
69 views
Two similar API calls PHP optimisation and structure
I have the following script that I'm part way through and I'm not happy with it at all, it feels messy:
<?php
class Process {
public $search = ...
0
votes
0answers
16 views
Plan9 rio script to tile windows. How can I improve this (rc-shell)
Here is my window tiling script for rio window manager in plan9. It fetches the current screen size, and calculates the locations based on the layout given. How can I improve this program? am I ...
1
vote
1answer
64 views
Collapse long text (with more/less links)
I wrote a little function to compact long text. I am relatively new to JavaScript so I am not sure I wrote it as elegantly as possible. I wrote it to be runnable on the server side (Node.js) as well, ...
3
votes
1answer
65 views
Column selection and URL modification
I have an HTML table representing a database table and a sidebar which holds different anchors ready to perform CRUD operations on click.
Because the hrefs in the anchors aren't in general valid for ...
0
votes
1answer
28 views
Rails stylistic exception and bang usage
Question whether I should be throwing exceptions in the below model code (and rescuing in the controller - rescues not implemented below) or returning nil (in both or one of the exception cases). ...
2
votes
1answer
111 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 ...
2
votes
1answer
81 views
Is this good Ruby?
This is the "codebreaker" game in Ruby, tell me what I can make better!
#!/usr/bin/env ruby
class Sequence
attr_accessor :guess, :code
def initialize
puts "Type the difficulty level you ...
1
vote
3answers
107 views
Temperature Conversion Program
I'm having trouble accessing variables throughout multiple functions. For example, I need to use userinput throughout many other functions, but do not have access to it with my current code. I am ...
1
vote
3answers
146 views
Bash script to swap out, edit host files
So this is my first useful bash script. It's meant to make it easy to switch between a "work" hosts file (that blocks sites like reddit.com, youtube.com, etc.) and my normal hosts file, and also to ...
1
vote
1answer
148 views
Review my prolog code for bibtex reader
I am trying to learn Prolog, and wrote a bibtex reader using gnu prolog.
I would like some feed back on my code in terms of: the way I write Prolog, and how it can be improved.
I am new here, and ...
5
votes
1answer
169 views
Review of my code: Tic Tac Toe in Objective-C
I am completely new to Objective-C. I have written a simple SingleView Tic Tac Toe Application application for learning purposes. While writing the app I tried to be as much sound as I could, but ...
4
votes
4answers
297 views
Spaghetti return statement
I've just came upon this fine return statement :)
I am curious how would you rewrite this, I will post my edited version later.
public bool Changed(bool Cascading)
{
return ...