|
keygen and kel posted:i'm an excellent debugger though. this was my saving grace at my last job no more programming for me ever
|
# ? Jun 3, 2013 17:14 |
|
|
# ? Jun 5, 2024 07:46 |
|
but for real my terrible thesis is like 80% c++ 17% java and 3% julia
|
# ? Jun 3, 2013 17:14 |
|
I'm seeing his post right now
|
# ? Jun 3, 2013 17:15 |
|
CamH posted:my school uses a lot of java and it is a dumb language this is what every student thinks until they graduate, get a job, and start learning to program.
|
# ? Jun 3, 2013 17:32 |
|
I'm a student and I think java is pretty cool. Much better than c++ which some of my classes have used.
|
# ? Jun 3, 2013 17:34 |
|
I woke with a start, bathed in cold perspiration. I was in my cubicle, at work. The last thing I remembered, I'd been going through the morning emails. Last night had been busy: patching the servers, plugging the latest security holes with bits of chewed bubble-gum, the usual routine. OK, I shouldn't have dozed off, but I suppose that the effect of last night's cheap bourbon had begun to kick in. I'm only an occasional drinker, the kind of guy who goes out for a beer, and occasionally wakes a few days later in Saigon with a full beard. As I pulled myself back to full wakefulness, my nerves tingled, sensing some evil presence, perhaps in the cubicle, veiled by the shadows. I glanced at my screen and then I noticed it. "What's this? A new database? Where did that come from?" I recoiled instinctively, as if a great cobra sat coiled on the keyboard. Dark forces seemed to be stirring. I shook my head. "My nerves must be out of order!" I told myself. After all, what's the harm in a new database. I'll just keep a weather eye on the server and it'll be fine. The phone rang. It was the SAN Admin, Mildred. She cut short the usual pleasantries, never a good sign. "How's the boy? What 'cha doin to my disks?" she hissed, as if I was personally doing her wrong. Hell, it must be that new database. I played dumb. "I don't know what you're talking about Mildred. Which server is having trouble?" I tried to sound nonchalant, but my voice came out as a nervous squeak; the disks were her girls and they weren't happy. "There are massive reads and writes going on. My girls are rattling like mice." "I don't know, Mildred. There was a new app released last night, maybe that's it." "Well, ya better find out, and fast. Don't you guys have any monitoring?" Mildred knows how to make a guy feel small. "We're working on it," I lied, smooth as a grifter running twenties on a barman. I put my feet on the floor, swabbed the back of my neck, and pulled the keyboard towards me. That poison snake of a database was bugging me. I did what I always do, go and shake down the historic records in the cache to see what falls out: code:
Used with skill, Object Relational Mapping software is a great way to build the data access layer of an application. In careless hands, though, it's deadly. If these queries had Thompsons, there would have been blood all over the server room floor. I wondered if they'd walked into the N+1 trap? I looked at another couple of queries...and there it was, like a great fat spider in the center of its malignant web: code:
I had better check the tables too. Just as I feared. Clustered indexes and logical constraints were conspicuous only by their absence. If you're using a relational storage engine, you have to work within its rules, and this object-oriented approach to tables was breaking as many rules as it could find. I was clearly on a path to the Developers' Den, but I wasn't going alone this time. I called Mildred back. "We're going to talk to the Dev Lead?" she asked in a voice quieter than I knew her capable of. A strange rattling noise echoed down the line, eerily reminiscent of her beaten-down disk drives. Her teeth were chattering with a nameless dread. The Developers' Den I met Mildred in the corridor, which had a smell of old carpet and furniture oil and the drab anonymity of a thousand shabby lives. Her smile was as faint as a fat lady's at a fireman's ball. The only way in to the Developers' Den was through a little sliding door that let those inside see who was trying to enter their space. It slid open a fraction, revealing a pair of eyes regarding us suspiciously. "We need to talk about the data access layer for your new application." "Who are you, the DBA? I thought you quit. Or maybe that was the guy before. It's a pity what happened to him…after he complained about our last application." How could I forget? "Look, we just need to talk to the Dev Lead for a few minutes. I'm sure we can sort this out." "He's busy. Just do what you usually do. Put a few indexes in the database." I sighed. Why do devs think an index is the answer to all their problems? "An index ain't going to cut it this time..." He was already sliding the door closed. "I hear you guys also have a few Access apps that need a lot of healing. Good luck with that!" It was desperate but it got him where he lived. The door slid back open to reveal a face with as much expression as a cut of round steak and a similar complexion. The smell of old pizza and Nerf washed over us. Keyboards clattered away on a hundred laptops and desktops. There was a lot of forking, pulling, and merging going on in here, interrupted by an occasional piercing scream, as someone attempted a rebase. He led us to one of the Dev Lead's assistants. "The DBA? I thought you quit," he sneered. "Rumors of my demise seem to be exaggerated. Listen, your new app is beating on our database like a heavyweight contender smacking a palooka around the ring in a fixed fight." "That's a real pity. Sounds like you need a few sticking plasters, or indexes as you like to call them." This guy had all the charisma of a plastic cup. I counted ceiling tiles for a minute then leaned over his desk, knocking a Lego Millennium Falcon off its stand. "No. An index won't help this time. This is a real code problem. And unless you want to spend the rest of your very short career putting in daily security requests for access to your dev database, get me to the Dev Lead! Now!" Keyboards quieted all around the room. I heard mumbling and pointing and the phrase "...thought he quit...". The developer fumbled with the Millennium Falcon, accidentally breaking off a missile launcher, before giving up and looking at me again. I hadn't known him long but I could tell that thinking was always going to be a bother to him. "OK. Your funeral." He grabbed his phone. The response was quick. "He's down in Conference Room C. It's just...". We didn't wait to find out more. Conference Room C Anger and frustration can carry a man far, but on nearing the Dev Lead's inner sanctum I took stock. Maybe the devs were right; an index or three might prop things up well enough. Forced parameterization might just help too. I glanced at Mildred. The look in her eyes told me I couldn't let her girls down. It was time to stop compromising. I shouldered on into Conference Room C. Around the room, little notes colored green and blue and pink fluttered faintly in the gentle breeze of the air conditioner. Don't let the pretty colors fool you; each of those pretty notes will become real code that can crush a database with one gentle waft of its bat-like wings. We walked in, as inconspicuous as a tarantula on a slice of angel food. And there sat the Dev Lead, fingers flying across the keyboard while one of his flunkies watched. "...and that will fix the object inheritance problem you were hitting. Now get out before I put you in charge of maintaining the source control and bug-tracking systems for the next project." The flunky stumbled into us as he tried to leave. The Dev Lead glanced up. He smiled, as stiff as a frozen fish, and glanced to either side of the door. That's when I noticed the code-droppers standing there, hulking, menacing developers, wearing Star Wars t-shirts and each with a paw full of pizza. I tried to ignore them as the Dev Lead started to speak. "Ah, Joe Deebeeay. I heard you quit. Who is that with you? Mildred from the SAN team. Darling, come in and sit here next to me." Mildred edged nervously around the conference table and perched herself right next to the Dev Lead. Suddenly my side of the table felt like the loneliest place in the world. "What can I do for the database team?" He beamed magnanimously at Mildred, but his eyes were like steel when they turned on me, and his voice as cool as a cafeteria dinner. Gulp. "The application that was installed last night, it's causing major problems with the database and the disks. I did a little investigation and it looks like you guys introduced an ORM for the data access layer." At the mention of the ORM, his brow furrowed. Suddenly, I was a particularly large rattlesnake and he had his gun ready. "Look, you know, I'm not going to have this 'ORMs are awful' conversation again." I took a chance and interrupted, "Of course not. ORMs are extremely useful tools that..." I choked on my own words for a second "...facilitate the speed of software delivery. No question. Keep using the ORM." The Dev Lead's jaw was hanging open and one of his code-droppers dropped his pizza on the floor. It bought me the time I needed. "The problem is not the ORM; just a few small mistakes in the way it was implemented. The database that it created is a direct copy of the objects in the code. Your guys turned ORM into OOM and that's the issue." He breathed softly, twisted one large hand around his knee and looked down at it. I took it as an excuse to go on. "There are some places where this direct object storage works well and others where we need to adjust the storage to be a little more...relational. After that, we drop a few clustered indexes in the appropriate places and we're almost home and dry." At the mention of indexes, there was an audible sigh of relief and the tension in the room lifted. Finally, I was acting like a proper DBA again. It seemed like as good a time as any to drop the bombshell. "Of course, to make this work, we'll have to adjust some of the code to use stored procedures." The final two words came out in a strangled whisper, about as welcome as a dead rat in the punch bowl at a classy dinner party. The two code-droppers closed in menacingly, "Thanks for the advice. Now, here's some for you and your stored procedures..." My time was almost up. "We'd only need to do this in one or two places. We could use your generated code for most of the CREATE, UPDATE, and DELETE queries, and those READ queries where it made sense. That's what the ORM does best. In other places, we'd just substitute straight T-SQL for the batch-mode processing that T-SQL is good at." The Dev Lead lurched to his feet, practically knocking Mildred off her perch. My next words, possibly my last, came out in a frantic rush. "Look, it's not as if this is premature optimization. Mildred and her girls, uh, I mean disks, are dying out there! This would eliminate the N+1 problem and many of the other issues with passing in hundreds of parameters." By this time, the Dev Lead was round my side of the table. Suddenly, I missed feeling lonely. His outstretched arm appeared to be heading for my throat but at the last second diverted and went around my shoulder. "You crazy kid!" I was older than he was, but decided not to argue the point. He turned to a code-dropper, "Can you believe the brass on this kid? He walks in here and tells us how to run our show?" He paused, and then laughed. "I love it!" That was all that the muscle needed to hear and they joined in the laughter. "OK, let's see what we can do, together, to save Mildred's girls." Mildred managed a weak smile. We made plans for further meetings to establish mechanisms of communication between the teams and start the process of identifying the worst performing code. We turned to leave, but the Dev Lead had a parting shot. "Oh, and Joe, I'll book a time for us to have a quiet word about those Access apps that are giving us trouble. It looks like the Access team might need a new member for a week or two." I managed a weak smile too. The Fix? Mildred and I finally made it out of the Developers' Den. I had a full schedule of appointments and a lot to explain to the Fat Man. Mildred was grinning from ear to ear but then noticed the look on my face, "What's the matter, Joe? Apart from your impending stint in the Access asylum, we got everything we wanted." "I dunno, Mildred. Time eats away at all good things, and some time real soon the devs are going to update that app, and their ORM will start messing again with the database. Your girls ain't safe yet." The smile vanished from her face. "Plus, once there's data in place, we can't just let the ORM create, drop, and alter tables, right in production. The Fat Man won't like it. He's funny that way."
|
# ? Jun 3, 2013 17:38 |
|
tl;dr: orms write bad sql and developers don't understand data design. do not ever use orms. do not ever let ur developers design ur data.
|
# ? Jun 3, 2013 17:42 |
Shaggar posted:this is what every student thinks until they graduate, get a job, and start learning to program. im learning java
|
|
# ? Jun 3, 2013 17:43 |
|
congrats. its pretty good.
|
# ? Jun 3, 2013 17:44 |
|
what cyberpunk actually is
|
# ? Jun 3, 2013 17:44 |
Shaggar posted:congrats. its pretty good. its gonna be in the context of android programming because gently caress web apps, but theres a lotta oop concepts you dont/shouldnt really use in plangs even if you can technically write w/them in "oop" style and i wanna get better at it
|
|
# ? Jun 3, 2013 17:46 |
|
does real java use the same awful infinitely nested brackets/paranthesis syntax that javascript uses?
|
# ? Jun 3, 2013 17:54 |
|
gucci void main posted:its gonna be in the context of android programming because gently caress web apps, but theres a lotta oop concepts you dont/shouldnt really use in plangs even if you can technically write w/them in "oop" style and i wanna get better at it i like oo very much because it made sense immediately.
|
# ? Jun 3, 2013 17:56 |
|
Shaggar posted:tl;dr: orms write bad sql and developers don't understand data design. do not ever use orms. do not ever let ur developers design ur data. I'm being told to use orms right now and it's like gently caress. I'm doing a thing where I want an object to be made by a little console app nobody sees running behind the scenes, which is to be passed to a webservice (webapi - all of this is .NET/C# poo poo). The object is going to represent data from two tables on the desktop machine which is going to be put into identical tables on a db up in the website. What I'm trying to figure out is the right way to do this so it's easier to go in and change things. Wouldn't the class itself handling the logic for "this value goes to this row right here" work fine? Then I'd just change poo poo in that class, and could leave the web service and console app alone if the tables change, since all they care about is transmitting that object. Also I've never done web poo poo before and I'm in over my head but the boss said to do it so I'm like welp okay The best poo poo is when I talk frankly about my workplace everyone in CoC said to literally leave. Everyone but myself is remote, theres no source control right now, my boss knows jack poo poo about development, the Sr dev is 500 miles away and the Web Guy works full time elsewhere and is a flake. I'm too drat new for this poo poo. I actually need mentoring and someone to slap me on the head if I do something retarded so I don't get bad habits.
|
# ? Jun 3, 2013 18:01 |
|
2banks1swap.avi posted:theres no source control right now, my boss knows jack poo poo about development, the Sr dev is 500 miles away and the Web Guy works full time elsewhere and is a flake. yeah that's the part where you should leave
|
# ? Jun 3, 2013 18:03 |
|
Shaggar posted:this is what every student thinks until they graduate, get a job, and start learning to program. Ahahaha I've found out school taught me basically poo poo about how to program but boy howdy did I learn about algorithms and S->aBb.
|
# ? Jun 3, 2013 18:04 |
|
Cocoa Crispies posted:yeah that's the part where you should leave This is the part where I learn what it's like to be in hell (but get paid at least) and take that with me to the new job. Interview tomorrow
|
# ? Jun 3, 2013 18:04 |
2banks1swap.avi posted:I'm too drat new for this poo poo. I actually need mentoring and someone to slap me on the head if I do something retarded so I don't get bad habits. but you see, every company needs senior developers
|
|
# ? Jun 3, 2013 18:20 |
|
Shaggar posted:tl;dr: orms write bad sql and developers don't understand data design. do not ever use orms. do not ever let ur developers design ur data. It was a good story though Also there are no other choices when you don't have a DBA
|
# ? Jun 3, 2013 18:37 |
|
why can't i use orms i loving hate dsls
|
# ? Jun 3, 2013 18:38 |
|
yep no way to use an ORM with an existing data source gotta have the developers design its schema! #yolo
|
# ? Jun 3, 2013 18:39 |
|
420 use ORMs every day
|
# ? Jun 3, 2013 18:39 |
|
gucci void main posted:its gonna be in the context of android programming because gently caress web apps, but theres a lotta oop concepts you dont/shouldnt really use in plangs even if you can technically write w/them in "oop" style and i wanna get better at it idk much about android dev but im guessing u can use stuff like cxf for service communication which is cool. 2banks1swap.avi posted:I'm being told to use orms right now and it's like gently caress. lol owned. uG posted:yep no way to use an ORM with an existing data source gotta have the developers design its schema! #yolo well you can but its still gonna write bad sql. use a statement mapper instead.
|
# ? Jun 3, 2013 18:52 |
|
2banks1swap.avi posted:Ahahaha I've found out school taught me basically poo poo about how to program but boy howdy did I learn about algorithms and S->aBb. faculty dont know how to program
|
# ? Jun 3, 2013 18:59 |
|
graph posted:faculty dont know how to program One guy literally made us turn everything in as a gigantic .java. We couldn't use multiple .java files. We couldn't even include a loving compilation script or a jar or anything. His loving CV is a mile long and he's been on the boards of some important poo poo and literally sets curriculums for schools and travels all over the country to do so.
|
# ? Jun 3, 2013 19:12 |
|
he just wants stuff to be easy to grade just do what he wants, its like a real job then!
|
# ? Jun 3, 2013 19:40 |
|
BONGHITZ posted:he just wants stuff to be easy to grade Yeah... I considered making some kind of script/program/w/e to take a bunch of java source files for something developed the normal, sane way, and cram it all into one .java for turning in. Then I quit giving a poo poo and learned to lean on IntelliJ and vim plugins to navigate a huge source file.
|
# ? Jun 3, 2013 20:43 |
Shaggar posted:tl;dr: orms write bad sql and developers don't understand data design. do not ever use orms. do not ever let ur developers design ur data. i just build raw unescaped strings and send them straight to the db
|
|
# ? Jun 3, 2013 22:01 |
|
i use big data instead of sql so its not a problem for me
|
# ? Jun 3, 2013 22:05 |
|
Nomnom Cookie posted:i use big data instead of sql so its not a problem for me the orm cloud
|
# ? Jun 3, 2013 22:54 |
|
Nomnom Cookie posted:i use big data instead of sql so its not a problem for me hope you're mongo driver doesn't have bson escaping problems
|
# ? Jun 3, 2013 23:45 |
|
mods namechange to m. bson
|
# ? Jun 4, 2013 00:53 |
|
db design is not rocket science, an autistic kid can do a good enough job of it 1st rule of mongodb: write the same thing in 3 different documents orms are great because table locks are scary
|
# ? Jun 4, 2013 00:59 |
|
MeruFM posted:db design is not rocket science, an autistic kid can do a good enough job of it the first rule of mongodb is don't use mongo, it's unreliable garbage written by idiots that don't understand the cap theorem if you're small, use postgres if you're big, use cassandra or riak 'cause they actually make availability and parittion tolerance guarantees http://aphyr.com/posts/284-call-me-maybe-mongodb quote:On the one hand, Mongo advocates usually tell me “but network partitions are exceedingly rare in practice.” Then I talk to Mongo users who report their cluster fails over on a weekly basis. One thing to keep in mind is that heavy load–like seasonal writes, recovering from a crash, or performing a rollback–can slow a node down to the point where other nodes declare it dead. This is a partition. I've seen my test cluster perform dozens of rollbacks as nodes go unavailable attempting to elect a new primary. You should probably instrument your cluster to watch for these events in production.
|
# ? Jun 4, 2013 04:56 |
|
And now babby's first thing-that-must-be-secure-and-will-go-into-production. I've been playing with WebAPI and there's all kinds of stuff I've seen for POSTing data to it, or big bulk file uploads, or poo poo with Azure, and serialization with json or xml or whatever. That's all fine, but not exactly what I'm looking for. What I AM looking for is a way to securely (as much as is reasonable) send small (a meg at most, honestly, and even that is big) send files from a C# console app to the WebAPI that I'm developing, and XML/JSON serialization just makes the stubble on the back of my neck raise up. Can I REALLY send rows from two tables that contain checking account/CC numbers securely if it's done through some kind of encryption layer? How do I call that? What I want to know is what kind of connection I can pick to put into the WebAPI's controller that would be good for having sql rows or data tables or serialized lists of objects that would be easy to set up for the WebAPI, the console app that's sending the stuff, and not be a pain to test or debug and log. The senior guys here have said line by line is better than a datatable, so I'm going to do that unless a goon here gives me a good reason not to. I'm glad to be able to play around like this, but I'm still green as poo poo, and it's making me a little paranoid of security, honestly. I've done desktop stuff with C#/.NET and am very comfy with that, and I've done some VERY minimal WebForm stuff. This is all very new to me and I feel lost and like I'm easily going to gently caress something up, bad, if I don't cross my t's and dot my i's over and over.
|
# ? Jun 4, 2013 05:00 |
|
what do you think https is lol step ur cj game up
|
# ? Jun 4, 2013 05:16 |
|
if it's a console app why not just use ssh or public key encryption?? awfya
|
# ? Jun 4, 2013 05:40 |
|
AWWNAW posted:And now babby's first thing-that-must-be-secure-and-will-go-into-production. if its not over the internet https it w/ a domain cert and call it a day if ur even gonna go that far. also the infosec guys would prob be willing to help u out or at least look over what ur doing and give u a thumbsup if ur worried ab it
|
# ? Jun 4, 2013 06:11 |
|
hey I forgot this thread existed and it's tl;dr so here's my masters thesis on why ~pointers are hard~ a pointer is a variable that stores a location in memory. ok, that part is easy you "dereference" a pointer by using the * operator. not too hard but the terminology is a little unintuitive oh you have some code that expects a pointer but you need to pass a variable? fine! pass it with the address-of & operator still pretty simple on the surface, but hey this spaghetti code is using pointers and & and you don't know why they use one here and another there and oops you need a pointer here but you don't have one and oops you dereferenced that variable which isn't a pointer &c &c it's a simple concept but bad commenting and handwavey documentation really trips up new programmers
|
# ? Jun 4, 2013 06:12 |
|
|
# ? Jun 5, 2024 07:46 |
|
nah people just think they can cheat on the mental model
|
# ? Jun 4, 2013 06:30 |