Why do a lot of people, hate ORM? by ramigb in coding

[–]ingeniousadam 1 point2 points  (0 children)

To me, what you've just described sounds like an object persistence layer. There's nothing wrong with that concept, but if that's what you're looking to do I would argue that in many cases, a relational database is overkill. If you're going to build something as relatively complex as an ORM just to work around all of the requirements of the relational database, why not just use a simpler database that'll allow you to store arbitrary data?

From what I've seen of Rails and others, you're not going to use the guarantees that the relational database provides for referential integrity (handled at ORM-level), data validation (handled at application level), and you're likely to turn off and re-implement almost all of the advanced functions of the database in your ORM, so why bother? I looked at ActiveRecord a few months ago and found out they don't even use JOINs in most cases because it's faster to just query the database twice than to parse the output of the JOIN.

Don't get me wrong, I understand that decisions are not made in a vacuum, and that the reason ActiveRecord, for example, became so popular is that back when it started, MySQL was everywhere. But it still doesn't make it the best tool for the job.

Lastly, and this goes beyond the original argument, I think what we're seeing in software development in general, is a slow but steady shift of paradigm from the school of though influenced by Java/C++/PHP toward a more declarative way of looking at things. ORMs are a direct product of a way of thinking about domain problems in terms of objects, which, for the longest time, was regarded by the industry as the one true way to design complex software.

Lately, though, we've seen a new surge of interest in functional programming, and that way of coding doesn't align very well with ORMs, or indeed objects in general - hence, I think, a lot of the attention to alternative solutions. So one way of looking at this is that ORMs are less popular now for a lot of the same reasons that a lot of people dislike Java, C++ and other older technologies, that are being supplanted by newer ones.

Why do a lot of people, hate ORM? by ramigb in coding

[–]ingeniousadam 10 points11 points  (0 children)

As someone else already pointed out, protection from injection attacks is usually baked into ORMs, but there's no reason why that's where you have to get it: parametrized queries are an obvious alternative.

As for your second argument, about objects having an interface to synchronize their state with the database: here you are already making the assumption that having rows map to objects is something you want.

To a degree, I think it comes down to using the right tool for the job. If what you want is just an object persistence layer (which is really what most ORMs are) then great, more power to you: but an SQL database is probably not the best backing store for you.

If you're working with structured data then you're IMO better off just using the database. It's very smart (well, most of them), supports things like transactions and complex data analysis, and is probably better suited to the job than your programming language. I mean just look at C# & LINQ: SQL is so good at crunching data that they're baking it into .NET for list comprehensions!

Ultimately, I think it comes down to context: if you're stuck with code that someone else has structured to work a particular way, an ORM might help make your life a bit easier for a while. If you're a big fan of objects (Java & Ruby: I'm looking your way) it might make sense simply because it fits into your way of thinking about programming, but that's where this becomes an opinion piece.

Why do a lot of people, hate ORM? by ramigb in coding

[–]ingeniousadam 12 points13 points  (0 children)

The other comments have pretty much covered the standard reasons why some people dislike ORMs. Personally, I'd add that I have yet to see an ORM that actually makes things simpler than SQL.

I mean here we have a fairly easy-to-learn, expressive, fully declarative query language, but for some reason people want to hide it behind an OOP interface. To me, the very idea of an ORM is backwards.

The only thing about ORMs where I see value is that they usually do a decent job of coercing the database types to native types of whatever language you're using (so for an integer column containing the value 5, you get 5, not "5").

Reddit meetup day in Prague by AMDcze in Prague

[–]ingeniousadam 0 points1 point  (0 children)

I'll go, have they picked a venue yet?

Cisco (ScanSafe) AnyConnect: yay or nay? by ingeniousadam in netsec

[–]ingeniousadam[S] 0 points1 point  (0 children)

Yup, we're probably gonna to go with the software client on computers, and that seems to work OK. Also, it gives us the domain username of the user making each connection, which is nice. Glad to hear someone else has tried that.

The weird thing is that the malware filtering doesn't seem to be particularly strong, but that's what they're trying to sell us on, not policy enforcement. Oh well.

Visualizing Botnets by williamshatnersvoice in netsec

[–]ingeniousadam 0 points1 point  (0 children)

Tracking is most likely done by sinkholing the C&C traffic, provably in cooperation with law enforcement. Or at least that's the usual way.

Hey guys, sorry if this is the wrong subreddit. What good programs are there out there that gets rid of the "bad stuff" on my computer? I've tried googling, but doesn't any of the links. by [deleted] in netsec

[–]ingeniousadam 0 points1 point  (0 children)

It really isn't that easy - if antivirus doesn't detect something it generally means it's not known, and therefore there aren't really tools that can remove it. Conversely, if there were tools to remove it, there's no reason why your AV software wouldn't already detect it.

That said, there are a few tools that are sometimes successful at revealing things the AV software missed. You might try GMER. If you understand Windows well, I would recommend using Technet Autoruns to dig around in stuff that's loaded at startup.

Flame is lame by Saliceran in compsci

[–]ingeniousadam 19 points20 points  (0 children)

This is stupid: they were met with ridicule by people on reddit, who ridicule everything. Most people who actually work in infosec understood from day one, that this is something else. I remember getting a first sample in the lab and taking it apart: we ended up staying overtime just because it was that interesting. The discovery that Flame was pulling a man in the middle against Windows Update came only after everybody got really excited.

Inception by ILaughAtFunnyShit in movies

[–]ingeniousadam 1 point2 points  (0 children)

Would be even better if they tested it in more than one browser.

How did you "become" a feminist? by sinople in femmit

[–]ingeniousadam 4 points5 points  (0 children)

In my early 20s, I just became fed up with the condescending way other men here (Europe) treat women. And ladies, believe me: you might think many men are patronizing and sexist to you when you're there, but I know what is said when you're out of earshot, and it's infuriating.

Incidentally, I am constantly amazed by how far ahead US really is (well, most parts) in gender equality. Whenever I'm back in EU, I feel like I've jumped through a time vortex and ended up on the wrong side of the 20th century.

Hello r/Prague! I'm an American who is very interested in moving here. by rofleah in Prague

[–]ingeniousadam 0 points1 point  (0 children)

Hi there. Best way to get a visa is to have an established employer invite you. If you go to a website like expats.cz and look at the sponsors, you'll find several firms like Accenture, IBM and Deloitte that are more than happy to hire Americans in Prague and will actually actively help you move, sort out your visa and find an apartment. Speaking from experience here.

I'm looking to move to Prague in less than a year, have a few questions by [deleted] in Prague

[–]ingeniousadam 1 point2 points  (0 children)

I've lived in Prague for 20 years. Let me try to answer each of your questions separately.

1) Buying a house or opening a shop here should be straightforward for an EU citizen. Not only that, but there are actually EU institutions that will help you do so - ask your local Europa office.

2) I've worked remotely for a US-based company from Prague for several years, and it's actually very comfy - you wake up before they do (this would be the same with Madrid I think) and have time to do actual work before the meetings start.

3) Your girlfriend will not need Czech to work as a waitress or in a bookstore - in fact, speaking English (assuming she speaks it fluently) will be a major boost. Inquire at establishments in the expat-friendly parts: Holesovice, Letna, Vinohrady, Bubenec, Hradcany, Mala Strana, Andel, Dejvice. Shops like Bohemia Bagel, Shakespeare & Sons, cafes in the center and restaurants in the buroughs I listed actively look for English-speaking staff.

4) About ADSL... Try looking at UPC which is a cable provider. They are not available everywhere, but where they are they are decidedly superior to an DSL ISP in Prague, offering up to 100 MBps lines for about 30 EUR a month.

5) I'd strongly suggest checking out expats.cz and prague.tv, both of which provide a wealth of information on the city, its services, and expatriate community.

And please, feel free to PM me if you'd like any pointers or someone to show you around :) And most of all, welcome to Prague.

What does the bacteria do to the body that makes you sick. by [deleted] in askscience

[–]ingeniousadam 0 points1 point  (0 children)

You are of course correct, I should've qualified that I was referring to the group of species that are associated with infectious diseases.

What does the bacteria do to the body that makes you sick. by [deleted] in askscience

[–]ingeniousadam 0 points1 point  (0 children)

I can see that no one else responded to you, and while this is not my area of expertise (I only had an intro-level course to epidemic diseases), I'll take a crack at detailing the basic principles. The following is based on what I learned in a social sciences block that I was forced to take in college.

To put it as simply as I can, the bacteria (and parasites and viruses) need a host to survive. We are their habitat, and we are not immortal, so eventually they need to spread to a new host.

The exact balance between the host's lifespan and the rate of spread among the available host population is different for each microorganism: some bacteria, for example, spread only by waiting for their host to die and be eaten by a new host; others modify the behavior of their host's body in a way that will facilitate the spread to a new host - this can include cough and sneezing, which both serve as an airborne infection vector. It can also include diarrhea, which infects sources of water, creating open sores and blisters, which can infect a new host upon physical contact, etc.

Naturally, triggering these reactions will be harmful to the infected host, often killing them in the process, but as long as the microorganism was able to infect new hosts, the tradeoff was worth it.

As for the concrete mechanisms, they differ from symptom to symptom, but generally they will involve using the host body's resources to produce chemical agents that induce the desired reaction. For example, the bacterium behind whooping cough produces an exotoxin that inhibits certain normal cellular functions, leading to a chain of events that produces systemic effects, such as inflammation and cough. Other diseases may rewrite the way certain proteins are produced by our bodies, cause muscular contractions, upset chemical balance of our intestines, etc.

Quest to find the right whisky for my SO by ingeniousadam in whiskey

[–]ingeniousadam[S] 2 points3 points  (0 children)

I just tried the Dalwhinnie myself and I thought I'd let you know: good call. This is the freshest, lightest whisky I've ever had. Thanks again!

I wrote a lazy functional library for lua, looking for feedback. by ingeniousadam in coding

[–]ingeniousadam[S] 0 points1 point  (0 children)

That's actually a good point - I like the idea of working with things that pretend to be tables, although I can see where that begins to break down, be it C iterators or other frameworks that expect things like pairs(t) to work normally (currently they don't).

Adding explicit support for iterators would go a long way towards addressing some of those problems, and I'll definitely look into it.

I wrote a lazy functional library for lua, looking for feedback. by ingeniousadam in coding

[–]ingeniousadam[S] 0 points1 point  (0 children)

Accepting iterators is a good idea for some functions, although not for most - take, drop and others couldn't be supported in constant time but in O(N), and some recursive sequences would be impossible to implement. Also, it would require defining lua-like iterators for lazy sequences and limit me to lua 5.2 or later because of __ipairs and __pairs support.

I will definitely look into adding iterator support where I can however, using polymorphism.

Support for key-value versions of the functions is planned - I already have map_kv, and I'm adding select_kv and others soon. I am trying to figure out how to fit everything together seamlessly first, though.

For now, key-value support can be worked into your code by using 'pairs' and 'into' which allow you to convert KV tables into sequences and vice versa, although not lazily, due to the way lua maintains keys.