4 ms·
I can't be the only one expecting it to say "just don't", right?
by brian-armstrong 9y ago
I can't be the only one expecting it to say "just don't", right?
- mhd 9y agoBecause of PHP or Uncle Bob?
- _pmf_ 9y ago> Because of PHP or Uncle Bob? Savage, but not entirely unfounded. Uncle Bob and his promoters try to keep an aura of Zen master around him, but there are no deeper insights in his truisms. "Clean Code" is nice for a novice coder, but dangerous if taken to an architectural or inter-module level.
- dep_b 9y agoI need to maintain quite a few reasonably large code bases that I have been writing alone or have maintained for a long time. I do not have the mental hard disk space to remember every detail about every parameter and what are it's side effects. Having more clearly named everythings and more limitations in the API's I write for myself really help me maintaining all of the things that I've been writing in the last decade or so. If I'm in my IDE I expect that when I have an instance of an object and I type `.` (or it's equivalent) it will autocomplete with only the things that I should touch and those things should make sense immediately without having deeper knowledge of the object I'm consuming. Languages like PHP but Java and C# a bit less but just as well are prone to writing code that can confuse the consumer. More modern or functionally designed and stronger typed languages can take guessing and confusion away, combined with the ideas expressed in Clean Code. But a lot of other sources as well, don't treat the guy like he's god. I love to read the analyses of Carmack's code for example.
- ge96 9y agoIs using PHP bad? I've seen speed comparisons and it is slow. I feel bad so far it's the only back end language I know unless counting JavaScript but don't currently use Node in development. I just keep seeing it being labeled bad a lot. I guess it depends if you can avoid it right? The current company that I work for (contract hourly) is a LEMP stack built on WordPress. Ideally I could strip WordPress out and get to the core purpose of the web application but it's not at that stage yet. I like the idea of separated services but Edit: I saw some infographic saying PHP was too easy to use/get into and resulted in many bad coders who were using it. It's also old, whenever I'm on the manual site and see the comments dating back to 10 years haha. What about machine code running on computers.
- thisrod 9y agoAfter being forced to use PHP, I've come to respect it a lot more than when I'd only looked at it. There is nothing ground breaking in bog-standard imperative control flow, a default data structure of association lists whose keys are numbers or strings, and libraries to parse every format under the sun into that structure and generate it again. On the other hand, that combination is very efficient for the many non-web programmers who occasionally need to do something with a web server.
- ge96 9y agoKind of funny going the other approach, web to non-hardware. Working with Raspberry Pi to hookup an LCD panel and get the local IP on shared network. Man that was challenging, not the python/code but the wiring... Then just include libraries and add to cron. It's cool interfacing sensors/physical with web.
- mtberatwork 9y ago> Is using PHP bad? No, of course not. There is no perfect language that you should be using right now. Like anything in software engineering, it's all relative to what context you are using it in and who is wielding the tools in the final end. Buggy, slow and terribly written code can be done in any language.
- ge96 9y agoOh man that's a good point. One thing I'm working on fixing is code redundancy, making global functions. I start to see it/get annoyed by it like ahh, should not be doing this (when I copy/paste a whole block of code into another place)
- kowdermeister 9y agoSlow is a meaningless word without context. You'll run into performance issues with any language and the answer is sooner or later will be caching. From that point is doesn't really matter what you use for static content generation.
- LeifCarrotson 9y agoBecause of PHP. Let's assume you are going to write really clean PHP code, with excellent readability, thorough tests, appropriate abstractions, and proper encapsulation. Understand first that it will be unnecessarily difficult: PHP lacks a number of concepts and constructs that allow you to write better code, and does not really reciprocate with sensible trade-offs that make the loss of these features worthwhile. It makes bad code easy to write and hard to fix. Then consider any third-party modules you might want to import. The standard libraries and modules in Python, Go, C# etc. are likely to be well-written, well-tested, and will fit into your clean-code project nicely. Sure, every language will have bad third-party code available, but PHP is especially likely to have cruddy tooling messing up any Finally, assuming you work past all the pitfalls (while still avoiding over-engineering), your beautiful masterpiece will still be hampered by the fractal of bad design [1] which is PHP itself. Your comparisons may be literate, the variables clearly descriptive and in the proper positive tone, but you'll be asking if they're empty(), is_null(), and isset(). Why start with a handicap? Choose a better language if you want to write clean code. [1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- deleted 9y ago[deleted]
- kowdermeister 9y agoBecause anyone tries to be constructive and change things for the better should be immediately stopped, right?
- junke 9y agoThis has nothing to do with PHP, but saying "don't" can be a positive thing too, and a change for the better.