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.
 
  • Locked thread
Fuck them
Jan 21, 2011

and their bullshit
:yotj:

Shaggar posted:

stay away from asp forms poo poo. use MVC and the templates that come w/ it. or write your own templates or get templates from somewhere else. someones probably already written a library to add razor helpers for generating jquery datatables.

altho if you really want to you could do just html/js and then use webapi to deliver the data into a datatable. but now u have html sitting somewhere, unattended and untemplated.

As much as I'd love to do it this way it would be me spearheading it all. ~The only other dev~ just poops out a standalone little forms page and throws it up on iis when he feels like it and has done so for ten years. My chernobyl meltdown earlier was largely how lovely forms turned out to be.

At my actually managed prior job with multiple devs we would just json data into a datatable where we'd define the rows in markup and use ko to help combine everything in a way that honestly worked pretty loving nice. The markup was so clean that it was honestly a breeze and is probably why I wanted to break poo poo trying to do this grid view bullshit. |

code:
 <table class="data-grid" id="NotesIndexTable-@ViewData("UniqueID")">
                <thead>
                    <tr>
                        <th>&nbsp;</th>
                        <th>PIN</th>
                        <th> Date</th>
                        <th>Notes</th>
                        <th> Report Date</th>
                        <th>Subject</th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: viewnotes">
                    <tr data-bind="click: $root.getCaseNote">
                        <td style="width: 40px;">*</td>
                        <td data-bind="text: PIN" style="width: 100px;"></td>
                        <td data-bind="text: Date" style="width: 100px; white-space: nowrap"></td>
                        @* //<td data-bind="text: Contact"></td>*@
                        @*<td data-bind="text: Author"></td>*@
                        <td data-bind="text: Notes"></td>
                        <td data-bind="text: Date" style="width: 120px; white-space: nowrap"></td>
                        <td data-bind="text: Subject" style="width: 200px;"></td>
                    </tr>
                </tbody>
            </table>
Is this not the way you'd advise doing it? Worked for me and was pretty drat clean. List of viewnotes and of each viewnotes I'd bind an element to a column.

Adbot
ADBOT LOVES YOU

Careful Drums
Oct 30, 2007

by FactsAreUseless

Shaggar posted:

stay away from asp forms poo poo. use MVC and the templates that come w/ it. or write your own templates or get templates from somewhere else. someones probably already written a library to add razor helpers for generating jquery datatables.

altho if you really want to you could do just html/js and then use webapi to deliver the data into a datatable. but now u have html sitting somewhere, unattended and untemplated.

I was thinking about making a toy pizza ordering/order management app using just web api and angular. Is angular still overkill or would knockout be enough?

FamDav
Mar 29, 2008

Malcolm XML posted:

wow its like if u buy into the mvvm pattern wpf is great!!!!

mods rename to mvvm wpf tia

Squinty Applebottom
Jan 1, 2013

Careful Drums posted:

I was thinking about making a toy pizza ordering/order management app using just web api and angular. Is angular still overkill or would knockout be enough?

all javascript libraries past underscore + jQuery is overkill

Shaggar
Apr 26, 2006

Careful Drums posted:

I was thinking about making a toy pizza ordering/order management app using just web api and angular. Is angular still overkill or would knockout be enough?

angular is always overkill unless you are applying for a job that uses angular (rip 2 u). even knockout probably isn't necessary depending on what u r doing

Careful Drums
Oct 30, 2007

by FactsAreUseless
but what if i want the back end to literally send nothing but json.

like, you go to one page and the back end says "here have a html page with a <script> to (insert library here) and and empty body, go"

then do everything else with ajax calls so the back end would only dump data and never worry about rendering a view.


that sounds like a thing that angular/ember are built for (based on watching a few pluralsight vids)

Careful Drums
Oct 30, 2007

by FactsAreUseless
that seems good because if the back end only returns json instead of rendered html then suddenly oh snap i have a back end so i can bang out a new mobile-first site, apps, even support your stupid winrt thing.

Workaday Wizard
Oct 23, 2009

by Pragmatica
i surf with js off :tubular:

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Careful Drums posted:

that seems good because if the back end only returns json instead of rendered html then suddenly oh snap i have a back end so i can bang out a new mobile-first site, apps, even support your stupid winrt thing.

it is good and you shouldn't listen to shaggar about anything

Shaggar
Apr 26, 2006
there shouldn't be a difference between your mobile and non-mobile site. you should use media queries to properly size the page and add/remove content. those people call it "responsive design" which is a terrible term for it but that's what they use. your javascript should be absolutely minimal and only used to do things like update page content on user action.

it should not ever build the page layout.

using knockout to data-bind json data to an existing table? ok.
using javascript to build the table with content from json? no. bad. don't do this.

if you have content that's not shown in certain contexts, then hide it w/ css. don't delete and create it with javascript!

building an MVC app that delivers fully rendered html for browsers and that also has a webapi controller to deliver the same content via REST for non-browsers is very easy to do and very maintainable. it ends up creating a far superior experience for your browser users.

slowkit and failfox will struggle against any javascript you send them, so you want to minimize it as much as possible.

Shaggar
Apr 26, 2006

uncurable mlady posted:

it is good and you shouldn't listen to shaggar about anything

this guy makes bad websites that everyone hates

Careful Drums
Oct 30, 2007

by FactsAreUseless
i duno he's been dropping some good .net knowlege itt

Bloody
Mar 3, 2013

Careful Drums posted:

but what if i want the back end to literally send nothing but json.

like, you go to one page and the back end says "here have a html page with a <script> to (insert library here) and and empty body, go"

then do everything else with ajax calls so the back end would only dump data and never worry about rendering a view.


that sounds like a thing that angular/ember are built for (based on watching a few pluralsight vids)

this actually sounds reasonable, gives u good separation of concerns between your nodejs server and your javascript webpage

Shaggar
Apr 26, 2006
I wrote a thing that uses json to fill page content because I had the requirement of not using an app server and it works but it makes me cringe w/ all the content pop-in

Careful Drums
Oct 30, 2007

by FactsAreUseless

Shaggar posted:

there shouldn't be a difference between your mobile and non-mobile site. you should use media queries to properly size the page and add/remove content. those people call it "responsive design" which is a terrible term for it but that's what they use. your javascript should be absolutely minimal and only used to do things like update page content on user action.

it should not ever build the page layout.

using knockout to data-bind json data to an existing table? ok.
using javascript to build the table with content from json? no. bad. don't do this.

if you have content that's not shown in certain contexts, then hide it w/ css. don't delete and create it with javascript!

building an MVC app that delivers fully rendered html for browsers and that also has a webapi controller to deliver the same content via REST for non-browsers is very easy to do and very maintainable. it ends up creating a far superior experience for your browser users.

slowkit and failfox will struggle against any javascript you send them, so you want to minimize it as much as possible.

yeah that's a good point. heavy js sites means a lot of browsers are going to suck royal dick at rendering it.

and that's also a good point that if controllers are thin (as i've been told that they should be) then hacking a webapi on top of normal ActionResult controllers would be easy-as-gently caress.

okay thanks shaggar i will do it that way

Careful Drums
Oct 30, 2007

by FactsAreUseless

Bloody posted:

this actually sounds reasonable, gives u good separation of concerns between your nodejs server and your javascript webpage

gently caress nodejs i'm talking asp.net mvc/webapi

Careful Drums
Oct 30, 2007

by FactsAreUseless

Shaggar posted:

I wrote a thing that uses json to fill page content because I had the requirement of not using an app server and it works but it makes me cringe w/ all the content pop-in

yeah i've had to do this before with nothing but jquery and i thought 'hey i think this is a problem that ember/backbone/angular is for' and it works nice but all that javascript is kind of a kludge and i did my best to separate but well this is the terrible programmer thread

e: the jquery would do an ajax then render some html based on that ajax AND show/hide stuff by assigning css properties. is is p bad

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Bloody posted:

this actually sounds reasonable, gives u good separation of concerns between your nodejs server and your javascript webpage

this guy knows whats up

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

this guy makes bad websites that everyone hates

i make websites that don't require license fees to host

Shaggar
Apr 26, 2006

Careful Drums posted:

yeah that's a good point. heavy js sites means a lot of browsers are going to suck royal dick at rendering it.

and that's also a good point that if controllers are thin (as i've been told that they should be) then hacking a webapi on top of normal ActionResult controllers would be easy-as-gently caress.

okay thanks shaggar i will do it that way

right. you're db layer is where all the magic happens anyway so in your MVC controller you're getting a model from the db and passing it off to a view. in the webapi controller you're grabbing that very same model and just throwing it back out as is for the mediaformatter to convert.

that way all your maintenance in the server app is in the db layer or the views in mvc. you only touch the controllers when you're adding new functionality.

Shaggar
Apr 26, 2006

Careful Drums posted:

yeah i've had to do this before with nothing but jquery and i thought 'hey i think this is a problem that ember/backbone/angular is for' and it works nice but all that javascript is kind of a kludge and i did my best to separate but well this is the terrible programmer thread

e: the jquery would do an ajax then render some html based on that ajax AND show/hide stuff by assigning css properties. is is p bad

knockout does the same thing as ember/backbone/angular with 100000x less complexity. theres no scenario where angular is a thing you should be using. it just doesn't exist.


uncurable mlady posted:

i make websites that don't require license fees to host

even if you're doing just rest you're gonna be using webapi so you're paying for a license. if you aren't using webapi and you're doing rest then lol. enjoy impossible to maintain garbage p-langing on top of your impossible to maintain garbage javascript

Nomnom Cookie
Aug 30, 2009



except that jax-rs is a thing and free

Shaggar
Apr 26, 2006
jax-rs is ok and better than p-langing but the asp.net stuff is just better. webapi and mvc are so good and easy 2 use.

Careful Drums
Oct 30, 2007

by FactsAreUseless
http://thecodist.com/article/i_39_m_sick_of_gof_design_patterns

quote:

Given that languages today are often functional or hybrid types, the GOF patterns may be entirely irrelevant for many people. Today having a broader knowledge of how to use these types of languages and being willing to learn how to use them effectively is way more useful than remembering a static set of anything. Programming these days is constantly changing, and anything written twenty years ago may be partially or even completely pointless today.

So stop asking if people can name a design pattern. Everyone replies "Singleton" anyway!

this guy is dumb right? :ohdear: design patterns are very good things

Shaggar
Apr 26, 2006
patterns are useful as shorthand for common techniques, but that's it. i wouldn't ask someone to "write a singleton" as an interview question, but I might ask them when its appropriate to use a singleton.

more like dICK
Feb 15, 2010

This is inevitable.
Terrible programmer status: Wow JMX. Wow, automatically exposing Spring beans as mbeans. Wow wow wow :vince:

Shaggar
Apr 26, 2006
jmx is cool

more like dICK
Feb 15, 2010

This is inevitable.
Today JMX taught me that embedded Jetty + a small Spring MVC app loads ~5500 classes :eng101:

Nomnom Cookie
Aug 30, 2009



the only bad thing about jmx is its so old it uses rmi

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
I got to go back to my desktop app today. Then I was done making minor changes.

Now I'm back to web.

I suggested a little MVC and the sr dev looked interested. He said we had time to spare to try it. :unsmith:

BONGHITZ
Jan 1, 1970

if only i could do things without having to learn how to do those things, that would be really nice

Notorious b.s.d.
Jan 25, 2003

by Reene

Kevin Mitnick P.E. posted:

the only bad thing about jmx is its so old it uses rmi

jolokia exposes jmx over http

this especially makes it easy to use jmx data in p-langs

compuserved
Mar 20, 2006

Nap Ghost
i'm a terrible programmer in need of wrist rest, ergonomic mousepad, and/or ergonomic keyboard recommendations. i've been doing a lot more coding lately and i'm starting to feel some pain. please help me yospos :(

compuserved
Mar 20, 2006

Nap Ghost

compuserved posted:

i've been doing a lot more coding lately and i'm starting to feel some pain.

welcome to yospos!

Bloody
Mar 3, 2013

compuserved posted:

i'm a terrible programmer in need of wrist rest, ergonomic mousepad, and/or ergonomic keyboard recommendations. i've been doing a lot more coding lately and i'm starting to feel some pain. please help me yospos :(

we have a thread for this

Bloody
Mar 3, 2013

http://forums.somethingawful.com/showthread.php?threadid=3652407&highlight=

Luigi Thirty
Apr 30, 2006

Emergency confection port.

MVC is cool+good btw and you should deffo implement it

BONGHITZ
Jan 1, 1970

what is the point of blocks?

gonadic io
Feb 16, 2011

>>=

BONGHITZ posted:

what is the point of blocks?

you use them to build your houses. watch out for creepers!

Adbot
ADBOT LOVES YOU

compuserved
Mar 20, 2006

Nap Ghost

Bloody posted:

we have a thread for this


thanks!

  • Locked thread