Skip to content

u/bryanalves

In this archive from Jun 2009 to Mar 2020

10
posts
21
comments
0
media
106
score
2 saved before deletion

Top posts

Why isn't vyos more prevalent?

As an alternative to pfsense? I admittedly don't have much experience with pfsense, but CLI configuration of vyos, being similar to juniper seems to have a lot of benefits. The crossover to prosumer level hardware -- edgerouter -- also seems beneficial. Does pfsense really have that much more to off...

24 points14 comments
Open on Reddit

E3-1220v3 as router?

Looking to maybe play around with upgrading router from edgerouter to something a little bit beefier. As I like whiteboxing (have a 4u x9drh right now as primary server), I kind of want to build a 1u/2u myself so I have better control of the noise, etc. Will an E3-1220v3 (with maybe 8gb of ram), be...

5 points12 comments
Open on Reddit

Will an NH-L12S fit in a 2U Chassis?

Thinking about whiteboxing an ivy bridge setup, E3-1270v2 probably. And I'm looking to quietly and effectively cool it. NH-L9x65 will definitely fit a 2U chassis (rosewill or istarusa probably). Will an NH-L12S fit though? Would love to go as beefy as I can to hopefully keep volume down. Any other c...

2 points2 comments
Open on Reddit

Top comments

We've defined a class at work that is used as a wrapper for functions implemented in PHP core. We use it for dependency injection to allow swapping out implementations when under test.

For example, some of our low-level database code calls mysql_connect. instead of calling mysql_connect directly (and dealing with all of the implications of what that means when writing unit tests), we pass a Php_Core object into the class that calls mysql_connect, and then make the call via:

$phpCore->mysql_connect(blah, blah, blah).

The basic Php_Core class just provides __call, and hands off control to the actual native function. It's easy to build mocks and subclasses though that intercept behavior for testing purposes. This makes writing tests for failure of exceptional situations a lot easier.

7 points

I didn't really read you post, so I'm approaching this as "tldr; the codebase I use sucks and I want to fix it by rewriting everything"

Rewriting everything is almost universally wrong. Take steps to make code better over time. Trying to do it all at once will

  • Waste time
  • Halt feature development
  • Halt $$$-making productivity
  • Introduce more bugs as you fix things, move them around, and forget implementation details. Even worse, you might lose entire features.

I'd recommend reading something like "Working Effectively With Legacy Code" by Michael Feathers, which outlines a series of steps and techniques for working with large monstrosity codebases and turning them into good unit testable codebases over a period of time.

You don't have to do it all at once, just make it a point that whenever you DO do something, make it a point to leave it in a better place than it was. Over time, you'll see a marked improvement in the codebase. It takes discipline, but being able to do something like this effectively is was separates bad coders from good coders, and good coders from great ones.

If you don't have the people around you to support the coding ability and discipline necessary, then this will never work. But guess what, a complete rewrite won't work either. So it might be time to bail.

6 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.