|
It would take about five minutes to change it back to returning JSON - I'm returning four serializable classes that are automatically converted to JSON by the controller, and all I'm doing to appease this guy is calling toString on the output
|
# ? Sep 4, 2015 02:56 |
|
|
# ? Apr 25, 2024 21:03 |
|
loinburger posted:It would take about five minutes to change it back to returning JSON - I'm returning four serializable classes that are automatically converted to JSON by the controller, and all I'm doing to appease this guy is calling toString on the output Understandable you want to let it slide, but seriously... stop it there before it spreads. It can only get worse, and if you don't put your foot down, they might actually blame you when it falls apart.
|
# ? Sep 4, 2015 03:20 |
|
Seriously, just tell him "this is what the library outputs, if you want to massage it into something else you can do it on your end".
|
# ? Sep 4, 2015 04:11 |
|
Just write the JS (all one line of it) and sell it as a way to be lazier for you both. Half of working with idiots is convincing them the right way was their idea all along. Then you get a much better job and move on with your life.
|
# ? Sep 4, 2015 06:35 |
|
At present I'm producing or am able to produce a ton of data that he's not consuming, e.g. originally the back end would throw an exception if you submitted a job while another job was executing, but now we're enqueuing the second job after verifying that it's not a duplicate. I've got REST calls to return the queue's state, to cancel a job, and to reprioritize a job; the front end isn't using any of these, I think in large part because it would be pretty much impossible to parse the queue's state using string fuckery. So the current plan is that at the next team meeting with boss's boss (who has been on vacation) I'll say "oh hey I'm producing all of this JSON data" and he'll say "neat, hey front end guy you should consume this data" and the front end guy will say "I don't wanna!" and then he'll get fired and replaced by somebody competent and then I'll win the lottery.
|
# ? Sep 4, 2015 14:35 |
|
In the meantime I've changed his code to consume JSON - the challenge will be to convince/force him to do this from here on out
|
# ? Sep 4, 2015 15:03 |
|
Seriously though, how did he get hired? Like... I hate front end development with a passion, my JS sucks absolute rear end and I still could do better job.
|
# ? Sep 4, 2015 17:23 |
|
He's a contractor, so I'm guessing that his contracting agency did a really good job of overselling him. I was once on the receiving end of that - this contracting agency called BoldRadius wanted to hire me and send me to work on a client's contract, and during my interview with the client we both discovered that BoldRadius had been spinning this tale that I was a brilliant programmer who had been working for them for years.
|
# ? Sep 4, 2015 17:45 |
|
pre:ALTER PROCEDURE [dbo].[Report_OrderPlanner] -- Add the parameters for the stored procedure here @pAccountNum varchar(20) AS BEGIN
|
# ? Sep 4, 2015 21:31 |
|
WobblySausage posted:
We've got one hanging out like: pre:ALTER PROCEDURE [dbo].[OrderTAT] @orderId INT AS BEGIN RETURN 3; END
|
# ? Sep 4, 2015 21:48 |
|
what kind of front-end dev complains about receiving JSON? it's the easiest thing to work with. seriously, if i were you, i'd simply teach him how to use it. it might save you a lot of time in the long run. edit: maybe he just doesn't know about stringify and toJSON and similar things? i can't remember the last time i used indexOf in anything meaningful, apart from some angular filter or something. pepito sanchez fucked around with this message at 07:27 on Sep 5, 2015 |
# ? Sep 5, 2015 07:24 |
|
pepito sanchez posted:what kind of front-end dev complains about receiving JSON? it's the easiest thing to work with. seriously, if i were you, i'd simply teach him how to use it. it might save you a lot of time in the long run. There's a deeper problem than not knowing about the format though. He may have come from some weird mainframe background or something. The real problem is that he sees a format, is told what the format is, and does not consider looking up how to decode it. I'm pretty sure this will keep happening under different names until he learns that looking up stuff is not an admission of failure.
|
# ? Sep 5, 2015 07:55 |
-S- posted:We've got one hanging out like: OK, that one is pretty funny. I am guessing it's a legacy of a time when that procedure actually did something. What's the funny on the first one, though? Is it just the "well, duh" nature of the comment?
|
|
# ? Sep 5, 2015 09:03 |
|
Centripetal Horse posted:OK, that one is pretty funny. I am guessing it's a legacy of a time when that procedure actually did something. I thought it was storing "account num" as a varchar(20).
|
# ? Sep 6, 2015 15:07 |
|
So I'm still a pretty junior developer, but I've run into some frustrations at my company and figured I'd vent to see if they are actual horrors or normal things. Our code seems to be coupled together way too tightly. All of our Java has a ridiculous amount of dependencies on other modules. For example, we have a module for talking to the database with our ORM classes and query classes and "DAL" layer that is pulled into pretty much every single other module we use. What the gently caress is the point of something like this? This code calls our Mongo instance, why not just have an actual Java app that exposes our database info instead of pulling in all these dependencies. Then we have essentially the same loving thing but instead of this talking to Mongo where we store smaller objects, it talks to Dynamo. Same code used all over that could really be separated out instead of making everything a dependency all over the god drat place. A few things about this suck. First, we have to deploy the Play web app EVERY loving time a change is made to the DAL with an indexed/unique class because saving two nulls results in an error and other modules may create a new object from code (which sets it as null) then when it gets pulled into Play it isn't set and boom, two null "uniques". Second, Jenkins projects take a long loving time to build and this slows down our process like crazy. Third, you have to update an absurd number of modules when doing work in what could really just be one module because of interdependency. Like I said, I'm pretty junior.. are these issues everyone faces or just a product of crappy organization? I feel like all of our databases (the business entities, real-time stats, other reporting numbers which we store in Redshift) could be exposed via very elegant APIs. We have to make calls to the database anyway, why not set up individual Amazon APIs for everything instead of clouding up the code and call that in a line or two and get a JSON response? Good Will Hrunting fucked around with this message at 20:38 on Sep 6, 2015 |
# ? Sep 6, 2015 20:35 |
|
Good Will Hrunting posted:So I'm still a pretty junior developer, but I've run into some frustrations at my company and figured I'd vent to see if they are actual horrors or normal things. Horrors can be normal. Programs that were poorly designed, poorly implemented, or just made for a much smaller business that has outgrown the original design, are quite common. Not to mention older code hanging around that was written before modern design patterns and technologies existed/were adopted. My advice is to let as much of it go as you can. A major refactoring that won't show some kind of short-term gain (like, if there's a performance problem you need to fix) is going to be a really hard sell to managers and project leaders who are mostly going to want bug fixes and new features. I have a big old tightly-coupled code base to work with at my company, and what I do is code things as "properly" as I can and hook into our existing systems as late as possible, so that my own stuff remains as testable and maintainable as possible. Ideally we could refactor our entire product so that our dependency graph wasn't a big ball of yarn (among other problems) but it just doesn't benefit us enough to do compared to all the other things we can work on. Now, if your deployment process is stupid to the point where it's wasting a lot of time, you might be able to convince people to re-work it. Come up with a proposal, get some numerical data and give them a plan (we spend X man-hours per month deploying, we're wasting Y of them because of <reasons>, I propose we change it in <these ways>, which should shave off Z of those hours). Maybe they'll be amenable, maybe not. No matter what, try and let it go. You need to work with what you have most of the time, and I think you'll find that the vast majority of code you work with is not going to be written or designed in an ideal way. Especially since the definition of that term is constantly evolving.
|
# ? Sep 6, 2015 21:20 |
|
That makes sense. I was working on an API that exposes basically all out business entities to a front-end and it went so smoothly. Very testable and easy to work with. It got me thinking about how it would be nice to have something like that available to all modules, and when I got to working with other modules and seeing how poo poo was coupled like it is I really missed the API I was working on.
|
# ? Sep 6, 2015 21:23 |
|
Good Will Hrunting posted:That makes sense. I was working on an API that exposes basically all out business entities to a front-end and it went so smoothly. Very testable and easy to work with. It got me thinking about how it would be nice to have something like that available to all modules, and when I got to working with other modules and seeing how poo poo was coupled like it is I really missed the API I was working on. i really don't understand the original problem. having a DAL and BLL is pretty common, where the DAL is only an interface exposing so and so to the user instead of exposing the entire BLL, so you send DTOs instead of objects from the BLL. it just sounds like it was really poorly implemented in this particular case. like Che Delilas said maybe put in place a long time ago. but i can't think of a time when i exposed the entire BLL to any kind of UI like you're suggesting. modern frameworks guard against that, and working with things like SOAP services you just have to do it by hand. maybe i'm just misunderstanding?
|
# ? Sep 6, 2015 23:06 |
|
pepito sanchez posted:i really don't understand the original problem. having a DAL and BLL is pretty common, where the DAL is only an interface exposing so and so to the user instead of exposing the entire BLL, so you send DTOs instead of objects from the BLL. it just sounds like it was really poorly implemented in this particular case. like Che Delilas said maybe put in place a long time ago. but i can't think of a time when i exposed the entire BLL to any kind of UI like you're suggesting. modern frameworks guard against that, and working with things like SOAP services you just have to do it by hand. maybe i'm just misunderstanding? I think he means within parts of the program itself all the dependencies are needed to get it up and running. No interfaces, no dependency injection so you need everything just to test a small bit.
|
# ? Sep 7, 2015 05:46 |
|
Mr Shiny Pants posted:I think he means within parts of the program itself all the dependencies are needed to get it up and running. No interfaces, no dependency injection so you need everything just to test a small bit. Sounds like a hell on earth. I know several systems i have worked on like that. There was one in VB6 that took OO to extremes, Login --User- UserName - NameString - String |- Password - PassString - String I changed that to global Username, Global Password -- But back to your issue. Sounds like they have tried to use MVC but got it wrong. Question: do you have to restrict the data coming out of the database dependant on the user's access level or is that being done in the BLL layer? One place i worked we used Transformers to protect data integrity so even if a hacker got into the front end the extra data isnt actually there. so we were Database -> VO (Value Object) -> Transformer -> DO (Data Object) -> BLL -> Controller -> View The problem is that with the usual MVC tutorials they cover the simplest systems where each DB table consists of one object in the front end so there is a lack of "getting" how MVC really works MVC (Model View controller) is designed to separate the DB storage from the logic and the View. But lots of people thing that the Model is the DB. in the simplest Application it May be but that is not the truth of the matter. In the example above the DO is the model not the VO or the DB. As a DO could be an amalgam of many tables (including objects inside lists inside other objects making a full data MODEL) So the best plan would be to have the DB access system (if it is ORM - i don't know anything about Mongo so can't help there) Loads up into DO (DTO) but its not a 1-1 relationship. so the user DTO may pull in from the User Table, Permissions Table, and Address Table into one complete DTO. BLL should be Business Logic only and should have services and controllers that can be used. Controllers are then called by the View which can be GUI or WebPage or API, That is why you split everything up. So that you can add new functionality without having to rewrite everything I cannot start to understand how your system is currently setup and I am sure that your company would not want the internal nitty gritty passed out to the goons. Take some time work out what it should be doing and how you can improve it - If there are no unit tests start adding them. This will make refactor easier going forward.
|
# ? Sep 7, 2015 06:05 |
|
Wouldn't Database to DO technically be it's own MVC?
|
# ? Sep 8, 2015 15:24 |
|
itskage posted:Wouldn't Database to DO technically be it's own MVC? you can just do it with active record. db -> model -> dto. this leaves out the C in mvc. there are other patterns you could use. active record's probably the easiest to do this correctly and if you don't get anything out of more SOC.
|
# ? Sep 8, 2015 15:46 |
|
Centripetal Horse posted:OK, that one is pretty funny. I am guessing it's a legacy of a time when that procedure actually did something. Just the well, duh part yes. Boy if you saw that developer's queries sometimes though... Actually here's an example of bad table aliases he does constantly: SQL code:
SQL code:
WobblySausage fucked around with this message at 15:27 on Sep 9, 2015 |
# ? Sep 8, 2015 22:00 |
|
|
# ? Sep 9, 2015 04:33 |
|
|
# ? Sep 9, 2015 04:43 |
|
To be fair, I trust David M. Gay more than I trust my compiler.
|
# ? Sep 9, 2015 05:07 |
|
Ah, the good old vt320 experience.
|
# ? Sep 9, 2015 05:44 |
|
An idiot ex-colleague of mine had the really annoying habit of using bitwise AND or OR when comparing booleans. So (e.g.) he would write this:C# code:
C# code:
C# code:
However, the query builder for EF is smart enough to recognize that bitwise operations have precedence over logical operations, so it turns in into the correct query (f.Code == Something OR f.Code = SomethingElse) AND f.ParentId = parentId AND f.IsActive = 1 So his idiotic habit actually saved him from a bug. That, or the more terrifying alternative that he actually did this on purpose thinking he was smart, which might actually be that case as the ANDs ar all logical ands, whereas he would normally use bitwise ANDs as well.
|
# ? Sep 9, 2015 10:13 |
|
Or he ran into the bug while writing it, got frustrated, figured out that he needed logical ANDs, and chalked it up to "this language is obviously stupid".
|
# ? Sep 9, 2015 13:50 |
|
People laugh at my overuse of parenthesis. Well, who's laughing now, huh?! no one, not even me, my life is a hollow shell of despair
|
# ? Sep 9, 2015 14:41 |
|
I use the poo poo out of parens in some of my kernel code. Partially because it helps make casts and such look saner, and partially because it seems to turn dummy mode on in some programmers and they just assume I'm a loving wizard.
|
# ? Sep 9, 2015 15:21 |
|
I write Clojure.
|
# ? Sep 9, 2015 15:31 |
|
My first programming was done in mud/mush code which is roughly equivalent to lisp in terms of the number of parenthesis. End result, I use a lot of parenthesis still. There is an upper limit where it stops making sense and hurts more than helps but I do like having everything neatly compartmented.
|
# ? Sep 9, 2015 15:40 |
Volmarias posted:People laugh at my overuse of parenthesis. Well, who's laughing now, huh?! You are not alone, friend. My code is packed with parentheses. A few extra keystrokes to eliminate ambiguity is an acceptable trade, in my mind.
|
|
# ? Sep 9, 2015 18:42 |
|
I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror?
|
# ? Sep 9, 2015 19:05 |
|
Centripetal Horse posted:You are not alone, friend. My code is packed with parentheses. A few extra keystrokes to eliminate ambiguity is an acceptable trade, in my mind. In MUMPS operations are always evaluated left-to-right. There is no precedence of operators. Parentheses are mandatory, and the ingrained habit of using them everywhere shows through in code I right in good languages too.
|
# ? Sep 9, 2015 19:21 |
|
SupSuper posted:I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror? Invoking return like a function is weird because it's basically the opposite of a function invocation (pops a function call off the stack instead of pushing another call onto the stack)
|
# ? Sep 9, 2015 21:26 |
|
xzzy posted:My first programming was done in mud/mush code which is roughly equivalent to lisp in terms of the number of parenthesis. End result, I use a lot of parenthesis still. Back in the 80's i was programming in MUF made me want to commit sepuke... Forth for Muds/mucks
|
# ? Sep 10, 2015 06:49 |
|
SupSuper posted:I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror?
|
# ? Sep 10, 2015 15:32 |
|
|
# ? Apr 25, 2024 21:03 |
225 if statements on a single page that a company uses to fill out 25 fields about their company.
|
|
# ? Sep 10, 2015 18:49 |