Are today's major frameworks capable of enterprise capable applications?

But how can any programmer discover what constitutes “best practice” if they are not documented in a single source? If there are a thousand different documents labelled “best practice” then how do I decide which one to choose?

I have substantiated that view by pointing to the description of the “copy” program which Robert C. Martin wrote about in his article at http://www.objectmentor.com/resources/articles/dip.pdf
I have also defined “appropriate” several times, but you fail to acknowledge that fact.

How did I take what you said out of context? I quoted exactly what you wrote. Or perhaps you don’t read what you write, just as you obviously don’t read what I write.

Just as the exercise of amended a huge code base to switch from include/require statements to using an autoloader would be pointless. Fashionable maybe, but still pointless.

Hi @tony_marston404. You’ve made this statement:

Have you made it a point in any of these projects to specifically use DI to manage dependencies or try out using an autoloader to load your class definitions?

Years of practice, plus being bombarded with useless ideas by everyone who thinks he knows best.

I’ll just quote myself since you always ignore the important parts

For the hundredth or so time, nobody is asking you to change your code. There is a difference between saying “This house would be warmer if it had double glazing” and “Tear out the windows and get some better ones in there!!” You repeatedly fail to see the distinction.

And to continue the analogy, you then try to find reasons that the older windows are better or say things like “I don’t have the problem double glazed widows solve”.

I actually do use DI where I have a dependency which can be supplied from one of a number of alternative sources. I do not use DI where the dependency can only be supplied from a single source.

I do not use an autoloader because I handle the loading of classes in the old fashioned manner, and I do not see any benefit in changing my code to achieve the same result but in a different manner.

Since when does “can be used” mean “should be used”? The fact that I can use a sledgehammer to crack a nut does not mean that I should do so. If I have several tools at my disposal I will use what I determine to be the most appropriate (there’s that word that you simply cannot understand, again).

Exactly! But here we can actually define what we mean by appropriate and how we’re measuring it. A nutcracker is better because: It takes less energy, it’s more easy to move around, it’s easier to use, etc. You cannot provide any of this kind of reasoning for using a singleton instead of DI.

But, you did say that. You said this in your Dependency Injection is Evil drivel:

Unfortunately most OO programmers do not have the brain power to evaluate DI to see if it would actually provide any benefit in their particular circumstances. Either they are told by a supposed “superior” that they should always implement it, in which case they obey without question just like a bunch of trained monkeys, or they hear about a new ‘cool’ design pattern and they rush to implement it just to prove to their peers that they are pattern experts.

“Don’t have the brain power” and “…trained monkeys”. Shortened and paraphrased = mindless moneys

Scott

1 Like

This is a good question. New developers are often lead into bad practices because of the sheer amount of out-dated or just plain wrong tutorials and articles that still exist out there on the web.

Personally, if it’s a topic on which I don’t have enough experience or expertise to judge for myself, I tend to look at whether there seems to be a consensus of opinion or not… you can always find people arguing both sides of any issue, but is there a clear majority in favour of a particular practice? Are these people coming from the same (or a similar) language community? Some practices will vary according to the type of programming (strict vs dynamic typing, or functional vs OO). I’d also give more weight to an opinion coming from someone with more experience… anyone who has built a lot of different software will have had more opportunity to evaluate different ways of doing things and seen the repercussions of those choices over time.

1 Like

To me (and you can take it with a grain of salt), this means “No” you have not made it a point to use DI to manage dependencies.

If you have never implemented an autoloader in a practical manner, of course you won’t see the benefit of doing so.

As I said before, I won’t try to convince you that using these and other modern programming practices could be beneficial to you. However, I would encourage you to gain some practical experience implementing them. At the very least, having tried a new technique will let you provide your opinion with more pragmatic evidence.

1 Like

I agree it would be better if there were a single source at least as a starting point, however due to the nature of communication this simply isn’t ever going to be the case. Best practices change over time as new techniques are developed that are measurably better to existing ones.

That said, for for anyone at a level where they’re asking “Which method is better?” they are generally at a point where they’re able understand the pros/cons of different approaches themselves or at least understand someone else’s reasoning once it’s been presented.

The difficult part for mid-level developers is actually identifying the different approaches in the first place, however that’s where blogs like Misko Hevery’s are a great tool which essentially has articles in the format of “If you’re doing X you should be doing Y and here’s why”, which is a fantastic learning tool and understandable because it clearly identifies the pros/cons of the approaches being discussed.

Keep tilting at those windmills there Don Quixote.

There are hundreds of blogs out there written by people with different levels of experience and different opinions on what is right/wrong, or good/bad, or better/best, so how do I decide which blogs to follow?

The simple fact is that I do not pick a single blog from a single author and follow what he/she has to say religiously. When I research a particular technique or pattern, I use google, then I look at the results one by one until I come across one that presents an argument that I can understand. If I see that the technique or pattern, if added to my framework, can provide genuine and measurable benefits then, and only then, will I add it to my framework. What I will not do is insert a pattern into my code unless I have the circumstances for which that pattern was designed. Implementing a pattern without good reason will always be a bad idea.

I agree with this statement but you have proven time and time again that you cant grasp fundamental concepts like the problem a given pattern is designed to solve.

Incorrect. I DO use Dependency Injection in some places, but not in others.

At the end of the day it is still an opinion, and when someone says “in my opinion you should do so-and-so” that will not be good enough for me. I need to have proof that, if I expend effort to refactor my code to include this new idea, that it will produce genuine and measurable benefits. In most cases that proof simply is not there, so I consign that “suggestion” to the rubbish bin.