|
Can someone explain why die would be needed or what that code is abusing to get some strange necessary result?
|
# ? Aug 15, 2014 13:25 |
|
|
# ? May 20, 2024 23:25 |
|
Jewel posted:Can someone explain why die would be needed or what that code is abusing to get some strange necessary result? Sorry - I'll try to explain stuff next time. The code "works" because it's used in some AJAX handling - this way echoing "success" on the screen is the intended behaviour and you don't want to output anything else afterwards. However, `die()`ing a script, in the middle of function at that, is not really any sort of solution you should use. Relying on global variables isn't an approach you should use. Overall - this is more of a function fail - why use function at all? (yes, it's used only once)
|
# ? Aug 15, 2014 13:59 |
|
A dude I have to work with is leaving and he finally pushed his code up to a sandbox branch on the repo and it's over a hundred days out of sync with master.
|
# ? Aug 15, 2014 19:35 |
|
Ugh getting tired of my job and the horrors surrounding it. Enough so that I may consider looking elsewhere, as things have especially gone downhill lately. Today I started working on a comprehensive mobile application for Windows Phone. When I asked for a source control repository to start committing everything, I was told to put it on our backup drive until that can get setup. I'm guessing that might be 2 weeks down the road at least? It bothers me greatly that my boss thinks that source control is used solely for backups, because I've run into this exact same issue with him before in the past. I've also been told that "clients don't care if the code looks pretty". OK I guess the client won't give a gently caress when we have to work on the program (with no source control) again and it takes us 3 times as long every single time since there's no time to refactor. Nevermind the fact that this particular program no one wants to spend time on has a host of terrible bugs and problems and they look at me wondering why the gently caress it won't work. Maybe using a library from 1995 that the previous terrible coder chose isn't the right choice just saying. [/rant]
|
# ? Aug 15, 2014 20:45 |
|
Knyteguy posted:Ugh getting tired of my job and the horrors surrounding it. Enough so that I may consider looking elsewhere, as things have especially gone downhill lately. Yeah, if they don't "get" source control, it's probably time to move on.
|
# ? Aug 15, 2014 21:03 |
|
There's no reason (or more like, no excuse) for not using your own source control. Use git for your project directory at least locally. You can always migrate.
|
# ? Aug 15, 2014 21:25 |
|
pigdog posted:There's no reason (or more like, no excuse) for not using your own source control. Use git for your project directory at least locally. You can always migrate. I do use git locally when I have to, and I am for this project, but it still is incredibly annoying.
|
# ? Aug 15, 2014 21:41 |
|
fritz posted:A dude I have to work with is leaving and he finally pushed his code up to a sandbox branch on the repo and it's over a hundred days out of sync with master. Hahah that is amazing. Hundred days thats p much 3 months so like probationary period right? I mean, hopefully he did not work there for years. Like, I picture whoever showing him around checking out a branch for him just as a courtesy like, so yeah this is where we push & pull. And then he just kept working against his own local branch for 3 months and got fired.
|
# ? Aug 17, 2014 06:21 |
|
The project I work on has seen two major iterations and currently suffering through it's third. The baseline written in the early 90s, the second iteration written in the late 90s, and the current iteration being worked on for the past 5 years. The baseline portion appears as if it was organized to minimize the number of header/source files. This means headers contain multiple declarations and defines, and source files are tens of thousands of lines. Everything is global and structs are used for organization. Executables require a majority of the project dynamic libraries be linked due to pervasiveness of libraries dependent upon libraries dependent upon libraries. The second iteration added functionality directly on top of the legacy capability. On the bright side, all the new code was written using "OOP". Classes make use of proper data encapsulation and source files are broken out accordingly. However, instead of separate classes to separate responsibilities and promote encapsulation, there are simply high level classes that handle a vast array of capability. To manage these beasts, the class method definitions are organized by similar functionality and put into a source file named so as to classify that functionality. (Kudos for at least naming the files appropriately!) With this design, all the classes are massive and all-inclusive with no interface(s). How do the monster classes interface with each other you ask? Make everyone a friend class of everyone else! This way, the private data is just available without the need for a proper interface. Problem solved. In the third iteration, my team and I have done our best to re-factor and improve. However, due to the size of the code base, schedule constraints and contract scope not everything can be fixed at once. Everything in due time.
|
# ? Aug 17, 2014 19:30 |
|
Snapchat A Titty posted:Hahah that is amazing. Hundred days thats p much 3 months so like probationary period right? I mean, hopefully he did not work there for years. Like, I picture whoever showing him around checking out a branch for him just as a courtesy like, so yeah this is where we push & pull. And then he just kept working against his own local branch for 3 months and got fired. This isn't the 'coder horror' thread so I'll just say that you might be surprised.
|
# ? Aug 18, 2014 16:28 |
|
I had a coworker leave and didn't check in their latest revisions. I had to pull their hard drive from their machine which, thankfully, never got picked up by It. They had 3 directories full of code and some of them had multiple versions of the same code. There was a lot of code-2" and "code-2-bak" Ugh.
|
# ? Aug 18, 2014 16:58 |
|
ijustam posted:I had a coworker leave and didn't check in their latest revisions. I had to pull their hard drive from their machine which, thankfully, never got picked up by It. They had 3 directories full of code and some of them had multiple versions of the same code. There was a lot of code-2" and "code-2-bak" I just started a new job a couple months ago, and my boss (who has been working on my project for ~ 4 years) hasn't ever used proper version control for anything, so everything is just nested directories named "templates", "templates2", "templatesbak", "templatesnotworking", "templates20140202", etc.
|
# ? Aug 18, 2014 17:33 |
|
What does 'bak' here stand for?
|
# ? Aug 18, 2014 18:16 |
|
Newf posted:What does 'bak' here stand for? backup?
|
# ? Aug 18, 2014 18:26 |
|
Newf posted:What does 'bak' here stand for? Winmerge automatically creates .bak files if you do any sort of changes - I always thought it stands for backup. At my first job we didn't have any version control and the "process" was to modify files through ftp and yelling which file you're editing. To put things more in perspective it had DB tables called "sex" and "god"; when I dropped "god" on my local nothing happened, but dropping "sex" crashed the site. Oh, the allegories
|
# ? Aug 18, 2014 18:30 |
|
Color Gray posted:On a related note, I once saw someone link to this "rebuttal" to that article: holy fuuuuuuuuuuck I tried to read that thread and it's just embarrassingly difficult to read. The general level of understanding in there is shockingly bad. Eevee explains most of his issues reasonably well but the other people totally fail to grasp any of the problems he's presenting.
|
# ? Aug 18, 2014 19:44 |
|
Oh devshed. I think I had an account there.
|
# ? Aug 18, 2014 20:21 |
|
I like the part where a poster tries to excuse the language based on it's history and how it came about. As if that was an argument in it's favor. These people are so emotionally invested, it's like PHP is their child. "You can't criticize PHP for that until you've walked a mile in it's shoes! You don't know the hard life it's had to live!" It's a programming language. Who gives a poo poo why it's bad, if it's bad then don't use it. Someone else asks what's the point of this criticism, even if it's flawed PHP is going to remain popular and won't be going anywhere. Hmm, you think maybe it wouldn't be so popular if people looking to build new sites were warned about it? You know, by others who had used it and elucidated its flaws in articles for the rest of us to read? Nah, that's just pointless navel gazing, no one is interested in that sort of thing. It's strange the things people will come up with when they start with their conclusion and reason backwards.
|
# ? Aug 18, 2014 21:26 |
|
HappyHippo posted:It's strange the things people will come up with when they start with their conclusion and reason backwards. And yet when PHP is used properly it's amazing.
|
# ? Aug 18, 2014 21:30 |
|
Westie posted:And yet when PHP is used properly it's amazing.
|
# ? Aug 18, 2014 21:34 |
|
Westie posted:And yet when PHP is used properly it's amazing. I'm not sure if this is trolling or not, but I don't think anyone would claim you can't write something amazing with PHP, or even that you can't write amazing PHP code. The question is...why would you choose PHP to do this? AFAICT, there are very few reasons to do so.
|
# ? Aug 18, 2014 22:44 |
|
Thermopyle posted:I'm not sure if this is trolling or not, but I don't think anyone would claim you can't write something amazing with PHP, or even that you can't write amazing PHP code. It's not trolling. But then again, the stupid stuff you have to do to objects in PHP to actually make them useful in terms of implementing stuff like ActiveRecord or getter/setter methods is insane. It's like getting your code and injecting it with heroin and cocaine. Somehow it's amazing but you end up dying inside. I don't know why I don't follow my friend's lead and use Python/Go or something else as equally hipster. Never Ruby though. Too omakaze for me.
|
# ? Aug 18, 2014 22:54 |
|
Westie posted:And yet when PHP is used properly it's amazing. Westie posted:But then again, the stupid stuff you have to do to objects in PHP to actually make them useful in terms of implementing stuff like ActiveRecord or getter/setter methods is insane. It's like getting your code and injecting it with heroin and cocaine. Somehow it's amazing but you end up dying inside. When you have to do "stupid stuff" to make something be considered "used properly", you probably shouldn't use it.
|
# ? Aug 18, 2014 23:08 |
|
Westie posted:And yet when PHP is used properly it's amazing. That's a tautology.
|
# ? Aug 18, 2014 23:39 |
|
Westie posted:And yet when PHP is used properly it's amazing. When my abusive boyfriend doesn't beat me the relationship is amazing.
|
# ? Aug 18, 2014 23:54 |
|
Westie posted:It's not trolling. I'm genuinely interested in what is considered "stupid" stuff. PHP really sucks mostly because there's no internal consistency as far as I can tell. Some function names are camel case, some get underscores, some are just all the words mashed together. How can anyone keep that poo poo straight? Don't get me started on error handling.
|
# ? Aug 19, 2014 01:07 |
|
Mogomra posted:I'm genuinely interested in what is considered "stupid" stuff. I've heard this guy Terrence is an expert.
|
# ? Aug 19, 2014 01:32 |
|
I'm honestly just curious what other people think. vv
|
# ? Aug 19, 2014 01:34 |
|
Westie posted:It's not trolling. Rails is omakaze dude. Get it right.
|
# ? Aug 19, 2014 01:37 |
|
Westie posted:It's not trolling. Ruby is one of the most flexible languages there is (perhaps to its detriment.) Rails is omakase, and that isn't to say it's inflexible. Omakase is shorthand for "convention over configuration."
|
# ? Aug 19, 2014 01:41 |
xtal posted:Omakase is shorthand for "convention over configuration." Sorry, no. It's Japanese for "my way or the highway". Or in other terms, "really inflexible".
|
|
# ? Aug 19, 2014 07:34 |
|
Mogomra posted:PHP really sucks mostly because there's no internal consistency as far as I can tell. Some function names are camel case, some get underscores, some are just all the words mashed together. How can anyone keep that poo poo straight? There is consistency - it's about as consistent as custard. Keep jumping on it and you'll stay afloat, rest for a moment and you'll find yourself knee deep in the stuff. All procedural functions are usually styled after C naming conventions - underscores, so, stuff like file_get_contents, curl_init, html_entity_decode, htmlentities, oh drat it. All object methods tend to be styled after Java naming conventions, camelCase and the like - and that's pretty consistent. Well, I say consistent - have a look at the MySQLi class, that's consistent in the fact that both procedural and object calls both use underscores, which, considering how much Java is seeping into PHP, is rather odd. But it pays the bills.
|
# ? Aug 19, 2014 08:57 |
|
I think this argument for/against PHP is futile. PHP is provided with apache webserver as default. (LAMP/XAMP etc) To add Tomcat/another language you usually have to download and install said language/tool PHP has a foothold much like Windows has. The first web language most newbies will touch therefore will be php. Knowing that. Is it such a bad thing? those who know better will not use it. Let the newbies use it until they realise that it is not as good as they thought - but by then they have the knowledge to know what is a better language. For instance at college i learnt a "4GL" (basically DB front end where it automatically created the forms) Ruby on Rails struck me as just being a Web based version of that.
|
# ? Aug 19, 2014 09:42 |
|
These arguments won't convince the hardcore dug-in PHP veterans, but if it leads to at least one PHP newbie trying something else, then is it actually futile?
|
# ? Aug 19, 2014 11:00 |
|
TheresaJayne posted:but by then they have the knowledge to know what is a better language. No they don't, by then they have a massive sunk cost and a huge pile of "evidence" that using PHP is productive.
|
# ? Aug 19, 2014 12:26 |
|
Westie posted:PHP [...] used properly code:
|
# ? Aug 19, 2014 13:17 |
|
So, which language has naming consistency?
|
# ? Aug 19, 2014 13:30 |
|
eithedog posted:So, which language has naming consistency? Brainfuck sticks pretty well to its one-character-per-instruction naming convention.
|
# ? Aug 19, 2014 14:12 |
|
Westie posted:All procedural functions are usually styled after C naming conventions I always hear that reasoning, but it's still a poo poo reason.
|
# ? Aug 19, 2014 14:15 |
|
|
# ? May 20, 2024 23:25 |
|
Keith Adams gave a talk about why we still use and improve PHP at Facebook: http://www.infoq.com/presentations/php-history
|
# ? Aug 19, 2014 14:28 |