If this is working code, the it is off topic here and should be in the Code Review Stack Exchange, where people critique and make suggestions for improving otherwise working code. — MatthewMartin31 secs ago
I'm posting here my implementation of the game Connect 4. It's obviously a pretty trivial game and code but I'm primarily interested in any advice concerning improvements to the code structure: types, dependencies and coupling, concerns, etc.
I'm interested in attacking more complicated games bu...
> Get into the habit of placing the bodies of if, for, else, etc in curly braces, unless you have a VERY specific and convincing (to someone else) justification not to. Such things are strongly recommended in most style guides for a good reason. And remember that indentation does not change the meaning of code in any way.
> However, although it answers the question as asked, this is NOT a technique I would ever recommend. There are so many ways that such hacks could confuse programmers - including yourself in future - that it is simply not worth it. Code that is easy to misunderstand is easy to get wrong.
So, i'm trying to use the ld command to create kernel.bin file from boot.o and kernel.o, so, i'm trying to make a small operating system, i'm using Mac os x El Capitan, and when I type in terminal:
$ ld -T linker.ld -o kernel.bin boot.o kernel.o
and I will get this message:
ld: unknown option...
I have a system that only outputs reports in Excel 97-2003, and a second system (for the user to look at) that only accepts these reports in CSV format. The reports manager was previously opening each of the fifteen XLS reports, find/replacing all the commas with semicolons, saving as CSV, and r...
I built this auto registering registry to look into a package and import all modules and register any classes that are a subclass of a base class. I use it as a registry for a model's choices in Django and to be able to do a getattr on the class to get properties in a service that processes some ...
@nhgrif is that when you encounter a bug, write a test to cover it, fix the bug, and walk away happy with yet another green test so that the bug can't show up again without failing the CI build?
Tests confirm whether or not your code works. Bugs confirm whether or not your tests work.
If I can modify your code base an insert a bug, and then run your test suite... if you don't have at least one failing test, your tests aren't good enough, are they?
So for example... if you write func fizzBuzzify(value: Int) -> String and it does what we expect it to do... and your "tests" look like this...
Code coverage percentage is a useful statistic, but it only shows you which lines of code were executed during an automated test. Code coverage doesn't show you whether sensible asserts are being made.
> This is a very complex Axiom, it suggests that a project using XGH is immersed in chaos. Do not try to set order to XGH (See Axiom 16), it's useless and you'll be wasting precious time. This will cause the project to sink even faster (See Axiom 8). Do not try to manage XGH, it is self sufficient (See Axiomm 11), just like chaos.
Depends of the context. Take Rubberduck's resolver code; documenting it would be replicating 100% of the VBA language's scoping rules, and that would be a waste of time.. and a boring read.
what are the rules for codereview.se.com? namely, if i have 2 related code pieces that can function independently but make little sense to show them separately, can i post both in one question?
// Does the thing. If circumstance X, Y, or Z arises, the thing is actually not done. This method fails silently.
func doTheThing()
That's important to be documented.
Of course, the comment format should be in whatever appropriate format that assures it fills out tooltips in appropriate IDEs and can be generated into HTML or PDF documentation packet using whatever appropriate tools.
There's a great Xcode plugin called VVDocumenter that automatically formats my comments with AppleDoc comment style so that I get the IDE pop-ups and can generate an HTML page for my project fully documented. ;)
func evt_bookModel(bookModel: BookModel, didUpdateCurrentBook book: Book) {
var index: Int?
for (key, value) in DataStore.defaultInstance.books.enumerate() {
if value.id == book.id {
index = key
break
}
}
if let _ = index {
bookVie...
I'm pretty new to Guava's Service interface and to Netty in general and I'm trying to use both to implement a simple service which listens to TCP connections and discards packets (for now).
This is what I've got so far:
public class MyServer extends AbstractExecutionThreadService {
private st...
Cool; we don't often get visitors from the non-Technology side of Stack Exchange, we encourage you to look over this short post if you'd like to familiarize yourself:
So, you have found your way to the Code Review main chat room, The 2nd Monitor, perhaps for one of these reasons:
You were invited or "pinged" by a site moderator or other user to discuss a post on the main Code Review site;
You visited Code Review for the 1st or Nth time, and noticed the chat ...
Without wishing to make a fine point of it - this community already strikes me as being more friendly. I appreciate that and do not intend to spam the chat waves with questions.