last day (26 days later) » 

15:00
@DanPantry If your test is "does it look good?", there's no automated way of doing that
That's true
.....yet
If your test is "does it still look good?", you probably can.
Selenium is incredible in testing visual regressions
@DanPantry Yes, keyword still :P
@madara :P still, I'm annoyed at the refactorign comment the manager made
15:01
You make sure you're happy with it once, and then automatically check for regressions across builds
@DanPantry I don't have full context, link please?
He's the project manager for the CRM we're developing (3rd party project manager). I want to raise that to someone, not really sure who
@Madara, TLDR is a manager in a meeting earlier said that refactoring is bad because it can introduce bugs and that that's what find/replace is for
@DanPantry Uh huh
(also +1 for name)
Yeah, well, what's his alternative?
Fine, let's agree that refactoring is bad for a second, but now the application needs a new feature, one that the current infrastructure can't accommodate to.
What would he have you do?
@MadaraUchiha get it right the first time, presumably
No unit tests are allowed either, those can be written wrong! ;-)
15:03
@DanPantry Would you look at the time! It's time to update your LinkedIn profile!
@MadaraUchiha L O L
It's not an in-house manager and we are parting ways with them soon (tm)
With all seriousness, I'd go to my CTO with that.
But the comment was so ludicrous I had to mention it
I'd like to show them this conversation, TBH
@DanPantry faulty unit tests can make the situation worse, but not a whole lot worse
Faulty code without unit tests on the other hand...
Let me tell you a story from my workplace.
/me pulls a chair by the fire
15:05
We had this ugly CLI built with PHP
> cli
> php
lol
@DanPantry What could even go wrong?!
The entire company was built around it, the single guy in the company who knew PHP (and wrote the monster) left ages ago
No unit tests, of course. Full of globals and bad practices, a real bundle of joy.
Now, when I arrived, I was the only person in the company who knew how to deal with that, make changes to it.
(as an aside is there an easy way to make a printout of a conversation from a certain message in here?)
And since the entire company was built around it, and there are no unit tests, and no one to code review me, git push was a real thriller.
@DanPantry Yes, you can bookmark a conversation
15:07
I've made a permalink to the start comment but that prints off the entire thread before it too
Ah, right never mind, I see
Sorry, continue :-)
The result were horrible horrible bugs that affected production every time I needed to touch things up a bit
Because that function is global, and this function has this other function that relies on its output format, and this function starts an SSH session and if you mess with it, the keys become invalidated.
The solution: I rewrote the whole thing in Java
(My first pick was nodejs, but our stack already has Java)
See, it's a little reassuring to hear this from someone more experienced than myself
Now, we have tested code, and we can make a lot of groundbreaking changes to our infrastructure without fearing for our lives
I'm still quite green to commercial environments (3 years, almost), don't want to go committing career suicide
Disregarding the fact that we have a properly layered application, we have tests
And those tests allow us to be sure that the current version of the code Works™
TL;DR - Tests are good. I especially like TDD as it forces you to think about your API
What your functions take, and what they return
What kind of state are you keeping?
15:12
@MadaraUchiha a state of disorder currently....
On my private projects, I spend only 40%~50% of the time actually coding new features/refactoring
The other 50%~60% is improving infrastructure, and mainly test code.
Hello @Vermis welcome to the 2nd monitor
How on earth do I go about training developers - who are senior to me - in learning how to write good unit tests?
Hi @vermis - sorry fi this conversation is taking over this chat btw... maybe we should go to a separate room
@DanPantry Show them the benefits
Show them how from that moment on, they don't have to fear breakage.
Do note, taking untestable code and retroactively refitting it with unit tests is incredibly hard.
15:14
Hi and no that's fine. I'm just checking out chat rooms this morning.
If your code has global state, you're pretty much screwed
@MadaraUchiha Definitely, I'm aware of this
If your code has service locators, unit testing is possible but hard.
There's no bloody way we can test the spaghetti code where we have right now
@MadaraUchiha Only I find that if I think too much about stuff, I'm not getting as much done anymore
15:15
example - you click a button, new company is retrieved, that company then sets variable on X service which is actually a global service that god knows how many others services read from
@DanPantry The solution is to surgically cut out parts as much as you can, rewrite them in testable form, and connect the pieces
@DanPantry No dependency injection?
@skiwi You need discipline and habit
@skiwi s/service/angularjs service
I still ship relatively large features within the week
While others with the same requirement complexity as myself take month(s)
That's because I refactor more than I add
15:17
angularjs has built in dependency injection, so yes there's DI, however none of the state is encapsulated and it's all stored in a 'global' service, so to speak, so anyone can access it if they really want and read from it
And test more than I write production code.
@DanPantry Yeah, that's hard to test
I find, in personal projects, tdd seems like an overhead until you've written half of a single feature
@DanPantry Depends on the project.
And then after that point you wish you had used tdd from the start
@DanPantry Is there something bad about this? Or is it just that you cannot figure out how to test it?
15:18
@skiwi it makes the program hard to reason about
My personal project is equally or more complex than the "enterprise solution" I do at work.
Lets say I refactor the global service variable into something else
Wait, when you retrieve a company, how does it set variable X on a service?
I have no idea how many systems I've broken without testing all of them manually
When dealing with global state, even manual testing is very very hard
15:18
@skiwi use HTTP call, on http response, set data on ShareSvc.Company to the JSON result which effects god knows how many things
Because you don't know what you break, and under what conditions.
There's no documentation, the only way to find it out is to deploy and cross your fingers
@DanPantry I find it unclear what the code even originally intended to do
@skiwi share the current company amongst many services
@skiwi I'm pretty sure he does too :P
15:19
Nah, I know what it was meant to do. I didn't write it
They wanted to share the company we just clicked with other parts of the app
So you want the "current company" to be stored somewhere
Precisely
So they store it in a service locator
But the problem is there was no need for it to be stored there
And if the company is set via any other method, then it also needs to be manually updated on "the share"
@Vogel612 Prodded:
1
A: What kind of community ads do we encourage as a community?

rolflCommunity ads are an extension of the site. They are probably the most colorful and visible component on a site's home page (if/when you see them). Community ads were created to allow "people" to advertise on Stack Exchange without paying money to do so, on the condition that the ads and their b...

Everything they ddi could have been achieved with encapsulated state with no problem in Angular
15:20
TBF I'm not familiar with Angular, I've never bothered learning it and I'm not looking back
@Madara understandable, however, I enjoy Angular + the current company enterprise project is done in it.
Basically, the main problem is that each service does osmething like THIS in Java
If you always need to know the current company, then making that part global does seem to make sense? Or am I missing something?
@DanPantry The problem I have with Angular is that even the very team that wrote it don't believe in it
@skiwi Nope.
   class MyService {
     void doSomething() {
       var company = ShareSvc.company;
        ....
     }
   }
Global state should never ever be used.
2
15:21
@skiwi You don't have to make it global. You can always encapsulate it.
@rolfl so what's the problem now?
0
Q: Is my simple Calculator efficient? and help on Good coding style

FrankI am a beginner to java. I am learning about using methods. I want to make a simple calculator that uses methods effectively. I would like a review of my program, and I would also like to know if there is a better way or shortcuts to write this program better. I would like to know at the same ti...

0
Q: Is it bad to reference the best titles?

SirPythonRecently, on new Code Review questions, I've been seeing this: Welcome to Code Review! As we all want to make our code more efficient or improve it in one way or another, try to write a title that summarizes what your code does, not what you want to get out of a review. For examples of ...

The only exception is memory stuff, and you're in JavaScript, you honestly don't give a flying f*** enough about saving a few bytes of memory.
You can clearly see how what Iw rote above is an anti pattern in Java (ignore the var)
15:22
@DanPantry @MadaraUchiha SNR! please
@DanPantry But how would you find out what the current company is?
@DanPantry Yes, definitely.
@Vogel612 No problwm, you wanted me to see the post, I have responded.
@Vogel612 SNR?
@Vogel612 I agree
@MadaraUchiha start new room
15:22
@DanPantry That's ugly... yes
you guys definitely need a room
@Vogel612 How is this noise? It involves programming
Uh, sure.
@skiwi it definitely needs a new room
And it's a normal discussion
15:23
It's not noise but it's not code review
Start comment is #22891960
you got about 200 messages into transcript that are marginally related..
@DanPantry pass me the roomname then
I don't see the issue at all, is there something else more important, are we interrupting someone?
@skiwi It involves programming, but's it is such a strong topic between a few users that it would be better for it to be moved so that other conversations can happen.
2
@SirPython Anyone can jump into things about unit testing and refactoring
15:24
257 messages moved from The 2nd Monitor
Oof
Lol. Not empty anymore.
That was heavy :P
21 messages moved from The 2nd Monitor
If I've accidentally moved relevant messages, feel free to move them back
@DanPantry TL;DR If you care about it enough, raise it up to the higher ups
Personally, I'd go to the CTO with that
If you don't care enough
CTO? sorry
We don't have a CTO, they split everything up.
23 mins ago, by Madara Uchiha
@DanPantry Would you look at the time! It's time to update your LinkedIn profile!
@DanPantry Chief Technical Officer
Ah. Refer to @Mast's comment.
15:27
Usually the guy in charge of R&D in the company
I'm the only person in the company who knows AngularJS
We have no R&D either ^^
To a 'senior' level (if you will pardon the expression)
We have R&D but I don't think any of them are technical enough for this
Well, there's me and a collegue, but there is no dedicated R&D budget.
Which is why I'll be leaving the company before end of the year by the way...
@DanPantry For knowing the importance of tests and refactoring?!
1 min ago, by Madara Uchiha
23 mins ago, by Madara Uchiha
@DanPantry Would you look at the time! It's time to update your LinkedIn profile!
15:28
@MadaraUchiha I'm not familiar with the company structure too much, frankly, but there's absolutely 0 unit testing done here
The only senior to me who is technical uses the word 'unit test' so inappropriately if it were a child I would have called child abuse line by now
@DanPantry If you're surrounded by people who disagree or are unaware of refactoring and unit tests, you are surrounded by idiots. Get out.
3
@MadaraUchiha idiots that pay me £26k
when I'm 20
That's basically the pay cap in the UK unless you move to London
or have vastly more experience than I do
@DanPantry Do you want to evolve as a programmer? Don't you want to get more than that in the future?
Good pay can be a good reason to stick around, I'll have to admit.
Just don't do it for too long.
I mean, sure, definitely, don't get me wrong
15:30
Get your experience, get your pay and get out.
Good pay is awesome
@MadaraUchiha I do, but I feel that I would rather not jump out and I would ratehr actually try and make in roads into improving the company
There's more in life than money.
And teach them about unit tests and whatever
But solid, positive experience is more important on the long term
15:30
Than jump out
@MadaraUchiha This is very true. Working for peopel who don't value quality is a bad thing for overall career growth.
Honestly - the company is great. The environment is great. I love working here.
It's not just the pay.
@DanPantry I'm in a company where I'm the youngest dev in R&D
The peopl are great. But they are behind, technically.
I'm 23 and my nearest competitor is 30
15:31
Be careful to not learn bad habits, that's all I can say.
I'm 20, nearest to me is 27.. I think
@DanPantry Are they willing to learn though?
I was asked to talk about JavaScript since I'm the only one (well, one of two really, but he's a bit antisocial) who knows it to seniority level
@Mast I would hope so. Otherwise, I will update myl inkedin
That's the kind of company you should be looking for, one that looks for enriching the employees, and at least try to encourage good practices
15:32
@MadaraUchiha unfortunately, that is a pipe dream a lot
That PHP refactoring thing is the best thing I've done in my entire dev life, it taught be how to deal with crap, and more importantly, how to deal with other people's crap./
I would love to work for a company that uses TDD, UNix, node js, best practises, the lot
@MadaraUchiha That's an extremely valuable skill
however, I have to also be realistic and realize that that's a pipe dream, and I actually need to pay my bills for the mean time
I tried to towt he line with the third party and get them unit testing, but it was too much effort. I dealt with their crap by flagging it up to my manager and actually getting on with the work as best I could
@DanPantry I can relate. But don't take a short term solution and apply it on a long term problem.
15:33
However I am worried we are getting to the point where a full rewrite will be in order to support any changes
@DanPantry Full rewrites, especially panic full rewrites, never work.
@MadaraUchiha That's my concern.
You can rewrite a small component of the system
I know that as well as anyone else
Yeah, you'd want to rewrite it slowly, bit by bit.
You can maybe rewrite a core component of the system, if you're careful.
15:34
But this is a new project. I don't want the business to release on the back foot.
You cannot rewrite the entire thing. It never ever works well.
Again, I know, @MadaraUchiha
@MadaraUchiha Full rewrites sometimes work. Panic rewrites on the other hand.....
The only problem I have now is that this is a... I don't even know how many zeroes, project
It's already behind and unmaintainable
And we're not even done yet.
And the road we are travelling is not looking good at all.
@shuttle87 Full rewrites only work if all other parts of your system are very good
15:36
Not really sure where to go from here without committing professional sudoku.
A very good product dept with a very good developer with a very good QA team
(We have no QA team or product dept)
@DanPantry This is just getting better and better :D
How do you score on the Joel test?
@MadaraUchiha I definitely think the circumstances are rare that it's the best decision. Something that junior developers often think is more of a solution than it really is.
So it's likely I'm in agreement with you on this.
Do you use source control? Y
Can you make a build in one step? N
Do you make daily builds? N
Do you have a bug database? Y
Do you fix bugs before writing new code? N
Do you have an up-to-date schedule? N
Do you have a spec? Y (ish)
Do programmers have quiet working conditions? N
Do you use the best tools money can buy? N
Do you have testers? Y (UAT aka non technical manual testers)
Do new candidates write code during their interview? N
Do you do hallway usability testing? N
15:38
However systems with no unit tests or QA can pretty quickly end up in the situation where they are unsalvagable.
So, 4/12
Lets say 3.5, .5 for the UAT testers.
"Do you fix bugs before writing new code? N " this is especially concerning
UAT testers being testers that occur in the waterfall style of testing
@shuttle87 to be fair - This is only because we've had fairly few bugs
@DanPantry That's... surprising
15:39
it's still completely unacceptable
@MadaraUchiha That's a nice test, but it doesn't always fit the bill.
I personally always focus on bugs before new features
there is no 'company stance' on what to do right now, though.
@Mast No, but higher scores tend to correlate with how much one would want to work there rather nicely.
@DanPantry Is that because there are no bugs or no bugs that anyone has found?
@shuttle87 likely the latter
The stance at the moment is, found a bug? put on backlog and fix it by next release
15:39
usually that's the case
@DanPantry I work in a slightly different way
There is no one in house managing myself and the other developer on this project, it is the 3rd party dev I mentioned earlier
At least on my private project (which is enterprise-class)
We use TFS, and the other developer hates branching. So everything goes to the main branch.
@MadaraUchiha Only if it's a purely software facility. I'm in embedded, things get complicated.
15:40
develop on main branch with no unit tests, daily build or e2e test = GROAN
I have no scheduled releases. I get a stable snapshot, I push it to master, bam it's out there.
@Mast agree that embedded has a bit of a different situation
Work and branch off of develop branch, merge to master when things are stable.
@MadaraUchiha again, we use TFS in house.
@DanPantry My build is also in-house
15:41
There's no 'develop' branch, and branching is viewed here as a 'chore' (and to be fair, it is with TFS)
It's a bunch of super simple scripts and git hooks
No need for fancy tools
@MadaraUchiha Read: TFS :(
I'm the only person here with proficiency in git
(the best version control system IN THE WORLD btw)
@MadaraUchiha Have you had experience with gitolite or gerrit?
> Team Foundation Server (commonly abbreviated to TFS) is a Microsoft product which provides source code management
> Team Foundation Server (commonly abbreviated to TFS) is a Microsoft product which provides source code management
> Microsoft product
@MadaraUchiha We're an international company. Everything is Microsoft.
Honestly, I come from a unix background. I am forced to use Visual Studio to write JavaScript.
@DanPantry We're an international company. Nothing is Microsoft.
@MadaraUchiha Rephrase: international company from 1997
@DanPantry Point taken
everything is SQL, C# or VB
15:43
Have I mentioned the time yet?
Hahahaha. I like working here, honestly.
There's things to change, and they won't change if I leave.
In that case, disregard anything else I said, that's most important :)
You do need to surround yourself with more best-practice knowledgable people though
I'd rather at least try and make the changes and make the 1500 strong employees that will use the product happier. In the best case scenario, I do that. In worst casse, at least I can put on my CV I wrote a program for 1.5k users.
@MadaraUchiha why do you think I am here on 2nd monitor? ;-)
@DanPantry :)
Also consider contributing to open source
@DanPantry honestly enjoying where you work is most important.
15:45
I try to, but my personal project management is trash, and I have no idea where to start or look for projects or even how to fix them, a lot of the time.
I'd love to find a project I could fix bugs in, I really would.
@DanPantry Start with opening issues and reporting bugs
@MadaraUchiha currently doing that :-) github.com/danpantry
@DanPantry maybe you should look for projects you are interested in for non-programming reasons too
People often think that to contribute, you have to know all of the project and code structure
@shuttle87 not really sure where to start! otherwise I would.
I don't have many interets outside of league of legends.
15:47
Greetings
Why the ping?
I contributed to a site (champion.gg) here
But unfortunately the owner of the project had sold the project to a 3rd party before he could merge my changes in.
ah, crap, github 404
@DanPantry If git is too difficult for them, use SVN. But TFS is just horrible.
@Mast It's deeply ingrained. This is a company that firmly has its boots in the microsoft camp. It will be hard to convince them to move projects away from TFS.
Greenfield projects would be easier to convince them to use git with.
@Mast Git isn't that hard, especially with IDE integrations
@DanPantry I know the feeling.
15:49
there is a tfs-git bridge. There's no need to know git to use git.
there's even an official plugin to use git with tfs in visual studio..
Granted, there will be friction points, we moved from SVN to GIT and it did take some instruction and education
@MadaraUchiha Dependency on IDE = BAD
@Mast Yes, but Dependency on IDE > TFS :P
3
@MadaraUchiha helps that git svn exists, though.
Pick your fights
15:49
TFS is fucking awful
@MadaraUchiha Only by a little, since it's a specific instance of the problem.
The check out mechanic is a bad solution to a problem that doesn't exist 90% of the time
@MadaraUchiha absolutely this, getting git over something else may not be the best fight to pick.
@Mast I think me and another person here are the only two who use the Git CLI
and just lags out the visual studio
15:50
@shuttle87 (Catching up...) Doesn't that matter if you branch correctly?
It's all either through Intellij or SourceTree or a similar thing
@MadaraUchiha I have a vagrant box on this windows machine for ubuntu.
It works relatively well, there aren't that many whoopsies.
Where I can help it, I do all of my dev work through the ssh terminal
but unfortunately the entire clientside codebase has a dependency on visual studio because it uses typescript
@DanPantry Had a job like that once. Felt needlessly complex at first, felt heavenly in the end.
15:51
@skiwi I don't think that's the spirit of that particular guideline.
and instead of adopting the commonjs architecture or requirejs architecture, they decided they 'hope everything loads in the right order' pattern was good enough
if you run the client side code base through a stand alone typescript compiler it won't compile.
It's only because visual studio implicitly references every typescript file with every other file that it compiles.
It makes testing easier as well. scp the whole thing to a clean desktop and it should still compile.
@DanPantry That pretty much kills automated builds
@skiwi Branching properly lets you work on more code at once but I believe the spirit of the "fix bugs first" guideline is about making sure you fix bugs before adding features on whatever that development branch is.
@MadaraUchiha I use the CLI, IDE git and SourceTree...
15:53
@skiwi I exclusively use Git through the CLI
Including commit graphs, diffs and committing.
I do complicated stuff through the CLI
Only comitting I mostly do via something visual
Mainly for the reason that there are no integrations that support GPG signing of commits
@shuttle87 the branching model helps with that though. bug appeared in release? stashc/ommit changes, checkout release branch itnno new bug branch, fix bug, merge into master/develop
@shuttle87 Hmm, fair enough
And I'm kind of a paranoid freak in that regard
15:54
rebase your feature branch from the master/develop branch after fixing the bug
job done
@DanPantry but the point is more about the actual "fixing the bug" part
Git branching makes working parallelly easy.
We favor merging over rebasing here though.
I've worked on projects where so much was stashed away in favor of aggerssively pursuing features that it threatened the project eventually.
@shuttle87 Git stash is something you should never ever do.
Commit, git reset HEAD^ and branch
This is different to saying fix every bug immediately, but there's a balance. By "stash" I definitely do not mean git stash
I mean putting it aside.
15:56
Stash == commit - author - time - parent commit
stash was an example, if you're on a feature branch you never need to use stash
just commit and rebase before you merge back into develop
@DanPantry If you develop directly on master or on develop, you're going to have a bad time :P
@madara refer to prev comment about working off of master with TFS
@DanPantry What's the rebase for?
@DanPantry We can't really reason about a branching model when you aren't working with a proper VCS...
15:57
@skiwi interactive rebase cleans up your history
I dislike doing partial commits, hence I sometimes use the stash instead of comitting
@skiwi Why?
(That's probably what we are talking about now and what's not good practice?)
@MadaraUchiha I need to put it somewhere
You know you can retroactively (as long as you don't push) squash commits together, right?
2
You can have 3 partial commits that make up a whole, then squash them to a single commit afterwards
git rebase -i
@MadaraUchiha Some vague knowledge... but haven't used that
15:58
just make sure to start using -i from the first commit on your branch
because it's exclusive
git add -p is one of my favorite features that's missing from most IDE integrations :D
2
So interactive rebasing is somethign different than rebasing your branch onto another branch?
Woah, I'm learning new stuff everyday
@skiwi it works the same, but it allows you to interrupt and do stuff to the commits in the middle
and you can rebase your current branch (if you're feeling brave)

  last day (26 days later) »