Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
loinburger
Jul 10, 2004
Sweet Sauce Jones
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

Adbot
ADBOT LOVES YOU

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

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.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
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".

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
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.

loinburger
Jul 10, 2004
Sweet Sauce Jones
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.

loinburger
Jul 10, 2004
Sweet Sauce Jones
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

Xarn
Jun 26, 2015
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.

loinburger
Jul 10, 2004
Sweet Sauce Jones
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.

WobblySausage
Nov 7, 2014
pre:
ALTER PROCEDURE [dbo].[Report_OrderPlanner] 
	-- Add the parameters for the stored procedure here
	@pAccountNum varchar(20)
AS
BEGIN

big trivia FAIL
May 9, 2003

"Jorge wants to be hardcore,
but his mom won't let him"

WobblySausage posted:

pre:
ALTER PROCEDURE [dbo].[Report_OrderPlanner] 
	-- Add the parameters for the stored procedure here
	@pAccountNum varchar(20)
AS
BEGIN

We've got one hanging out like:

pre:
ALTER PROCEDURE [dbo].[OrderTAT] 
	@orderId INT
AS
BEGIN
	RETURN 3;
END
I think my favorite part is that it takes input.

pepito sanchez
Apr 3, 2004
I'm not mexican
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

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



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.

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.

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.

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

-S- posted:

We've got one hanging out like:

pre:
ALTER PROCEDURE [dbo].[OrderTAT] 
	@orderId INT
AS
BEGIN
	RETURN 3;
END
I think my favorite part is that it takes input.

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?

Storysmith
Dec 31, 2006

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.

What's the funny on the first one, though? Is it just the "well, duh" nature of the comment?

I thought it was storing "account num" as a varchar(20).

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
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

Che Delilas
Nov 23, 2009
FREE TIBET WEED

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.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
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.

pepito sanchez
Apr 3, 2004
I'm not mexican

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?

Mr Shiny Pants
Nov 12, 2012

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.

TheresaJayne
Jul 1, 2011

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.

itskage
Aug 26, 2003


Wouldn't Database to DO technically be it's own MVC? :v:

pepito sanchez
Apr 3, 2004
I'm not mexican

itskage posted:

Wouldn't Database to DO technically be it's own MVC? :v:

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.

WobblySausage
Nov 7, 2014

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.

What's the funny on the first one, though? Is it just the "well, duh" nature of the comment?

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:
Insert into @ABM
    Select Distinct a.ITEMID,
        c.ITEMNAME,
        a.SALESUNIT,    
        a.SALESPRICE as 'BranchPrice',                       
        0 as 'UnitCost',
        Case 
            When a.COSTTYPE = 6 and a.DEVIATEDCOST = 0 Then a.SALESPRICE
            When a.LOADEDCOST = 0 Then a.SALESPRICE
            Else a.SALESPRICE - (a.SALESPRICE * (f.COSTCALCULATIONAMOUNT)/100)
        End as 'CorpPrice',  
        a.SALESPRICE * (f.COSTCALCULATIONAMOUNT/100) as 'RebateAmount',
        ISNULL(g.DESCRIPTION,'Other') as Category
    from CUSTINVOICETRANS a Join CUSTTABLE b on a.DATAAREAID = b.DATAAREAID and a.ORDERACCOUNT = b.ACCOUNTNUM
            Join INVENTTABLE c on a.DATAAREAID = b.DATAAREAID and a.ITEMID = c.ITEMID           
            Join BDCUSTREBATELINE f on b.DATAAREAID = f.DATAAREAID and b.REBATECODEID = f.REBATECODEID and c.PRIMARYVENDORID = f.RELATIONCODE and f.RELATION = 10 --Vendor
            left outer Join BDPRODUCTCLASSTABLE g on c.DATAAREAID = g.DATAAREAID and c.PRODUCTCLASS = g.PRODCLASSID
    Where b.REBATECODEID = 'FOO'        
        and a.ITEMID not in (Select ItemId From @ABM)  --If I have already calculated them don't calculate them again       
        and DatePart(YYYY,a.INVOICEDATE) = @pYear
        and DatePart(MM,a.INVOICEDATE) <= @pMonth
Different horror different developer (maybe not a horror):
SQL code:
    /***************************
        Read Request Parameters
    ****************************/
    select  
        @custAccount                = Node.value('(./CUSTOMER/@ID)[1]','nvarchar(20)'),
        @Debug                      = Node.value('(./SEARCH/@DEBUG)[1]','int'),
        @categoryHierarchyID        = Node.value('(./SEARCH/@CATEGORYHIERARCHYID)[1]','nvarchar(50)'),
        @categoryLandingSetID       = isnull(Node.value('(./SEARCH/@CATEGORYLANDINGSETID)[1]','nvarchar(100)'), ''),
        @sortOption                 = Node.value('(./SEARCH/@APPLIEDSORT)[1]','nvarchar(25)'),
        @firstResult                = Node.value('(./SEARCH/@FIRSTRESULT)[1]','int'),
        @resultsReturned            = Node.value('(./SEARCH/@RESULTSRETURNED)[1]','int'),
        @IncludeDiscontinuedItems   = isnull(Node.value('(./SEARCH/@INCLUDEDISCONTINUEDITEMS)[1]','bit'), 1),
        @InventLocationID           = isnull(Node.value('(./SEARCH/@INVENTLOCATIONID)[1]','nvarchar(10)'),''),
        @priceRangeThreshold        = Node.value('(./SEARCH/@PRICERANGETHRESHOLD)[1]','int'),
        @priceSortThreshold         = Node.value('(./SEARCH/@PRICESORTTHRESHOLD)[1]','int'),
        @attributeFilterThreshold   = isnull(Node.value('(./SEARCH/@ATTRIBUTEFILTERTHRESHOLD)[1]','int'), 200),
        @maximumAttributeFilters    = Node.value('(./SEARCH/@MAXIMUMATTRIBUTEFILTERS)[1]','int'),
        @provideMerch               = Node.value('(./SEARCH/@PROVIDEMERCH)[1]','bit'),
        @maxMerchItems              = Node.value('(./SEARCH/@MERCHZONEMAXITEMS)[1]','int'),
        @nsECFinderTypeId           = Node.value('(./SEARCH/FILTERS/FILTER[FILTERSTYLE="SuppliesFinderType"]/FILTERVALUE/VALUE)[1]', 'nvarchar(25)'),
        @nsFinderManufacturerId     = isnull(Node.value('(./SEARCH/FILTERS/FILTER[FILTERSTYLE="SuppliesFinderBrand"]/FILTERVALUE/VALUE)[1]', 'nvarchar(100)'), ''),
        @nsFinderModelId            = isnull(Node.value('(./SEARCH/FILTERS/FILTER[FILTERSTYLE="SuppliesFinderModel"]/FILTERVALUE/VALUE)[1]', 'nvarchar(100)'), ''),
        @nsFinderModelSearch        = isnull(Node.value('(./SEARCH/FILTERS/FILTER[FILTERSTYLE="SuppliesFinderModelSearch"]/FILTERVALUE/VALUE)[1]', 'nvarchar(1000)'), ''),
        @nsFinderCartridgeSearch    = isnull(Node.value('(./SEARCH/FILTERS/FILTER[FILTERSTYLE="SuppliesFinderCartridgeSearch"]/FILTERVALUE/VALUE)[1]', 'nvarchar(1000)'), ''),
        
        @brandPrioritySearchEffect  = isnull(Node.value('(./SEARCH/@BRANDPRIORITYSEARCHEFFECT)[1]','int'), 150),
        @maxTopAttributeFilters     = isnull(Node.value('(./SEARCH/@MAXTOPATTRIBUTEFILTERS)[1]','int'), 5),
        @maxTopAttributeFilterValues= isnull(Node.value('(./SEARCH/@MAXTOPATTRIBUTEFILTERVALUES)[1]','int'), 5),            
        @maxTopBrands               = isnull(Node.value('(./SEARCH/@TOPBRANDFILTERSMAXIMUMDISPLAYED)[1]','int'), 7),
        @minTopBrands               = isnull(Node.value('(./SEARCH/@TOPBRANDFILTERSMINIMUMDISPLAYED)[1]','int'), 3),
        @manufacturerFilterEnabled  = isnull(Node.value('(./SEARCH/@MANUFACTURERFILTERENABLED)[1]','bit'), 0),
        @maxTopManufacturers        = isnull(Node.value('(./SEARCH/@TOPMANUFACTURERFILTERSMAXIMUMDISPLAYED)[1]','int'), 7),
        @minTopManufacturers        = isnull(Node.value('(./SEARCH/@TOPMANUFACTURERFILTERSMINIMUMDISPLAYED)[1]','int'), 3),
        @identifyContractItems      = isnull(Node.value('(./SEARCH/@IDENTIFYCONTRACTITEMS)[1]','bit'), 0),
        @restrictToContractItems    = isnull(Node.value('(./SEARCH/@RESTRICTTOCONTRACTITEMS)[1]','bit'), 0),
        @availabilityFilterTypeDescription = ISNULL(Node.value('(./SEARCH/@AVAILABILITYFILTERTYPEDESCRIPTION)[1]','nvarchar(255)'), 'Availability'),
        @availabilityFilterEnabled  = isnull(Node.value('(./SEARCH/@AVAILABILITYFILTERENABLED)[1]','bit'), 0),
        @themeUsesRetailPrices      = isnull(Node.value('(./SEARCH/@THEMEUSESRETAILPRICES)[1]','bit'), 0),
        @webSiteIdentity            = isnull(Node.value('(./SEARCH/@WEBSITEIDENTITY)[1]','nvarchar(100)'), 0),
        @nonPrimaryHierarchySearchEnabled = isnull(Node.value('(./SEARCH/@NONPRIMARYHIERARCHYSEARCHENABLED)[1]','bit'), 0)
    from    
        @RequestXML.nodes('/OPXML') TempXML (Node);
So basically a big XML string is built in web code (asp) and then sent into a stored procedure to be parsed, instead of using proper stored procedure parameters. I don't see the advantage here, and I think it's unreadable as hell.

WobblySausage fucked around with this message at 15:27 on Sep 9, 2015

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

sarehu
Apr 20, 2007

(call/cc call/cc)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

To be fair, I trust David M. Gay more than I trust my compiler.

fritz
Jul 26, 2003


Ah, the good old vt320 experience.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:
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:
if (something == 4 | something == 5) { }
Instead of the standard
C# code:
if (something == 4 || something == 5) { }
No matter how many times everyone told him to stop doing that poo poo, he kept on doing it. Now that's enough of an horror, but today I found this EF query (anonymized):

C# code:
var query = from f in Foo
  where f.Code == Something | f.code == SomethingElse
  && f.ParentId == parentId
  && f.IsActive
  select f;
From the context in which this code is used it's clear that the first part of the query should actually be in parentheses, but because there are no parentheses it seemingly evaluates to (f.Code = Something) OR (f.Code = SomethingElse AND f.ParentId = parentId AND f.IsActive = 1)

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.

Pollyanna
Mar 5, 2005

Milk's on them.


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". :v:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
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

Kazinsal
Dec 13, 2011



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.

Pollyanna
Mar 5, 2005

Milk's on them.


I write Clojure.

xzzy
Mar 5, 2009

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.

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Volmarias posted:

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

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.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.
I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror? :ohdear:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

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.

brap
Aug 23, 2004

Grimey Drawer

SupSuper posted:

I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror? :ohdear:

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)

TheresaJayne
Jul 1, 2011

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.

There is an upper limit where it stops making sense and hurts more than helps but I do like having everything neatly compartmented.

Back in the 80's i was programming in MUF made me want to commit sepuke...

Forth for Muds/mucks

ExcessBLarg!
Sep 1, 2001

SupSuper posted:

I always use parenthesis even if it's a language keyword and not a function, am I the real coding horror? :ohdear:
I'm guilty of using parentheses with "function-like" keywords like sizeof. It's a little weird, although not entirely uncommon to smash control flow keywords (if, for, while) against the condition parenthesis. Common C style guides (KNF/style(9) and Linux kernel) do include space there, I think in part to distinguish them from function calls, but also because those keywords also introduce expression blocks anyways.

Adbot
ADBOT LOVES YOU

Drythe
Aug 26, 2012


 
225 if statements on a single page that a company uses to fill out 25 fields about their company.

:suicide:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply