Wifi router opinions

I've had little-to-no formal training in programming, which means that people who have tend to roll their eyes at my structure (since I don't know all the caseConventions). Also I get criticized for my comments, but usually that there are too many.

--Patrick
 

fade

Staff member
Yeah, no offense, but I don't like too many comments either. In my opinion, the code should be self-documenting through structure and variable naming, with comments bringing up the slack. Except at the head, where I do write comments in Doxygen format so that I can pull out API documentation as needed straight from the code. As for conventions, well, everybody has an opinion on that. I like camel case for variable names and underscores for methods and functions, and capitalized camel case for objects. That way I can tell them all apart at a glance.
 
I've seen bad too many, and bad too few, but more of the latter. "Self-documenting" to me doesn't apply to function/method definitions. I have no faith anymore that anybody obeys any kind of contract, so unless it says it in your comments at the top of the function, I assume it's a bug. But unfortunately I have to deal with a metric fuckton of legacy code all the time, so the definition at the top rarely encompasses even a fraction of what it's supposed to do, and thus in-function comments are essential.
 
I have to deal with a metric fuckton of legacy code all the time, so the definition at the top rarely encompasses even a fraction of what it's supposed to do, and thus in-function comments are essential.
They probably encompass everything the function originally was supposed to do, but not all the additions that got crammed in over time.

--Patrick
 
They probably encompass everything the function originally was supposed to do, but not all the additions that got crammed in over time.
How I wish that were true. What I've found usually happens:
  • Function created along with 10-15 others as part of when the file was originally written. Perhaps some commentary at the top of the file telling what it's supposed to do overall. Maybe not.
  • Later others are asked to write new features in it. They add comments to their own functions, and sometimes alter what's at the top of the file too.
  • Still later others make tweaks to existing functions, and since they touched them, they are now responsible (under a new policy 10+ years after the file was created) to ensure all functions HAVE comments. And since they're the last one who touched the FILE, they put short and incomplete (because the functions are HUGE) comments at the top of ones they may or may not have touched.
  • Repeat 3, with some "emergencies" not updating comments at the top of functions.
Result: the insanity I usually deal with.

Remember, there are parts of this code more than 30 years old. And 20+ year old parts that SHOULD be touched/ripped out, but aren't. For example, we don't fix compiler warnings. We're mandated to not create new ones without HEAVY approval process (which is fine IMO, and what you do is then #pragma the warning away for the file (though it should only be for a section of it) ) but you don't fix any of the existing warnings unless you're re-writing the line anyways. Because there's 10s of THOUSANDS of them.
 
Back when I was first learning to code, my comments occupied two to three times more lines than my code did. I basically wrote out detailed descriptions of what every line of code was supposed to do.

My professor once took a look at my code, and just shook his head and said, "I think that's a bit much."
 
Back when I was first learning to code, my comments occupied two to three times more lines than my code did. I basically wrote out detailed descriptions of what every line of code was supposed to do.

My professor once took a look at my code, and just shook his head and said, "I think that's a bit much."
I would actually endorse that approach for a beginner, though I think I'd also agree with your prof. It CAN go too far.
 

fade

Staff member
Well. I bought the Netgear R6250 and I'm really unhappy with it. This is the worst wifi range I've ever had. I've tried all the obvious things. I've repositioned, I've scanned for optimal channels. I've tried 2.4 and 5 GHz. I can walk 15' away in open line of sight with the router and even though my bars are high, I drop from about 88 Mbps to 18 Mbps. The router is upstairs, and downstairs is all but unusable. I wish this wasn't an eBay purchase or I'd return it.
 
I went with the TP-Link Archer C7 and have been really happy with it. Though almost ANYTHING would have been an improvement over the ancient POS that the ISP had us on. Wifi transfers to internal network stuff no longer kills the internet! Yay!
 
No idea how expensive it's going to be (long-term), but if you are one of those folks who likes the open source builds for WRT, Linksys has announced a newer, faster model that supports it. Probably a good idea for people who want to tinker or want to expand their router's features BUT don't want to mess around with choosing hardware.

--Patrick
 
Top