HNHacker News
TopNewBestAskShowJobs

parham

77 karma · joined May 7, 2012

submissionscomments
parham··on Django REST framework 3
I'm not arsed to explain to you half of what is wrong with that comment, wtf I know you can use the ORM outside of Django but why the f*ck would you.

You're just arguing like a 10 year old fan boy now. Django is great for sites I love it. I also use other tools when I need different things. As for reinventing the wheel it's a very simple code snippet taken from a reliable source then changed to fit needs. So go home sleep learn new things... Don't attempt to build the next OS in Django.

parham··on Django REST framework 3
So this argument has now been forked into Django's ORM capabilities and wether or not you should use Django for an API. The former is up to taste, the latter is not.

> Not really. You're always free to use raw SQL, and it makes it pretty convenient to do so for the occasions when what you want exceeds the ORM's capabilities (which will likely happen).

I can't argue with this, fine.

> Stuff like a rate limiter, for instance, or a pluggable social media authentication backend. Or the one mentioned by the OP. All useful when making APIs.

Rate limiter is framework independent, can be built using Redis with a few lines of code. So not applicable.

Pluggable social media authentication backend is for websites not APIs for APIs you most commonly use API key/secret. for an api you can still build your portal in Django and do all authentication/whatever there and simply sign requests for the API.

> You're not railroaded into using any of those things if you don't want to (the same way you are with RoR). All of them are optional and most of them are even swappable without too much effort.

I am familiar with Django, and I know that you can (not the ORM though), but do you want to drive a monster truck when all you need is a car to get around? You could, you will get odd looks though.

Since you can't use Django's ORM anywhere else you need to use something that another "car" supports.

I'll leave you with: "if all you have is a hammer everything looks like a nail"

parham··on Django REST framework 3
> That's not a full comparison. It actually doesn't even touch on some of the advantages to using SQLAlchemy (i.e. in the more complex queries). It even says this at the bottom. Did you see that?

Well those are most of the comparisons that could be made, from the top of my head I can't think of any other features that the two share.

> Too many junior developers make the mistake of thinking that their problem, project or app is somehow a unique snowflake and end up reinventing the wheel because they had no idea the wheel existed. Semi-experienced developers will still make this mistake by making bad architectural decisions in the name of flexibility or performance that end up locking them out of library ecosystems that means they are forced to reinvent the wheel even when they know it exists.

Doesn't sticking with Django lock you into the ORM and it's capabilities itself? Unless the library you're using is a Django extension you have the same pool of libraries available to you, so that's an invalid point.

> It's a myth that Django is heavy weight.

I saw that blog post too, however by heavy weight I meant all the remaining stuff you don't need for an API, e.g. you don't need the template, view, form, ... layers

Again my argument is based on building an API not a Website.

parham··on Django REST framework 3
Well it's really hard to sell SQLAlchemy when you have never used it (I'm assuming, correct me if I'm wrong), read this blog for an full comparison http://lucumr.pocoo.org/2011/7/19/sqlachemy-and-you/ (quite old).

For the Django part of your comment the other modules it provides are useful for building a website but not an API which was in the root comment. Indeed for a website Django is my preferred tool too. Although in a project where I know the API is the core I would choose something lighter weight (using flask in my current project but learning from comments here Pyramid is something to look into too) and then build the portal in Django, handle user authentication there and allow access to the authenticated users to the API via requests signed in Django or direct access via API keys. In my experience it's the fastest/most flexible approach in terms of dev.

parham··on Django REST framework 3
Well it really depends on the data you have. It can easily be substantiated, it's like saying I want to compete in F1 let me put the biggest engine in this tanker truck, in other words do you need most of Django's layers for an API? That's why I said if you're "planning to go API first" (Note: I love Django for building sites not APIs)
parham··on Django REST framework 3
I was wounded in what made VIM flake slow while I was using Flask, I'm guessing it's the amount of modules imported at one go. Thanks for making me aware of Pyramid I will look into it further.
parham··on Django REST framework 3
I wasn't refering to performance, but the queries you could do. If performance was an issue and the ORM was the bottle neck then I would use raw SQL and scrap the ORM altogether. Thanks for this benchmarks though good to know that info! :)

Edit: The overhead thing was a secondary point my main point was handling data.

parham··on Django REST framework 3
Depends on your data, if you don't need joins/complex queries Django indeed is a great framework, though if an API is all you need a lighter framework might be worth looking into.
parham··on Django REST framework 3
My thought too but if your data is complex you should consider building an API first using an ORM more powerful than Django's (e.g. SQLAlchemy) then use Django to handle users and then allow your users to access the API directly via signed requests or something... that way you get good performance without network/Django ORM overhead.
parham··on Django REST framework 3
Well Flask is just the "glue" the real thing I like is its flexibility, which allows you to use tools that fit your needs, which for handling data SQLAlchemy blows Django's ORM out of the water. Don't get me wrong I love Django and I do use it a lot for websites but for handling data... it's restrictive to say the least.
parham··on Django REST framework 3
Same could be said about Django and APIs!
parham··on Django REST framework 3
Django isn't built to be the main backend for an API, I've previously used Tastypie and it's just not flexible enough, you should really consider using Flask if you're planning to go API first.
parham··on Anti-Patterns in Python Programming
I never said it should, it was a challenge.
parham··on Anti-Patterns in Python Programming
Even shorter, nice. How about this one liner, the last bit is looking a bit messy any ideas?

    print " is in the lyrics \n".join([set(lyrics_list) & set(words)]), "is in the lyrics"
parham··on Anti-Patterns in Python Programming
Instead of this:

    # Do this  
    lyrics_set = set(lyrics_list) # Linear time set construction  
    words = make_wordlist()  
    for word in words:  
        if word in lyrics_set: # Constant time  
            print word, "is in the lyrics"
You could do this:

    lyrics_set = set(lyrics_list)  
    words = set(make_wordlist())  
    matched_words = list(lyrics_set & words)  
    for word in matched_words:  
        print word, "is in the lyrics"
parham··on Visualizing Algorithms
Power of visuals, so pretty.
parham··on Best practices in modern web projects
This didn't cover anything useful it just said what everyone was already aware of, the only useful part was the links. Everything else was like saying to spread butter on toast use a butter knife.
parham··on Best practices in modern web projects
These aren't really best practices, they're too abstract. Best practices would be exactly how you do said practices the best way possible.

A more appropriate title could be "list of must read articles for modern web development".

parham··on Lessons learnt making our web app responsive
Took the words out of my mouth. Credibility of the article has been diminished by that error.
parham··on Poll: Which JavaScript framework do you use (and why)?
I use backbone, I like it because it's less of a framework and more of a way of structuring your code, you can decide the rest and there are loads of modules/libraries out there to help you out.
parham··on Difference between Software Engineers and Programmer/Coders.
That is a very loose comparison, as even "trained" doctors have huge differences in skill levels. I personally ignore all formal programming education below a PhD in programming as IMHO programming is a discipline which needs self motivation and individual thought for anyone to excel at it. Teaching it to someone only goes so far.
parham··on Difference between Software Engineers and Programmer/Coders.
Given the same skill level a P isn't a strict subset of SE, by that I mean an SE wouldn't be able to do a P's job efficient/effectively as they don't posses the required knowledge/skill... and vice versa.
parham··on Difference between Software Engineers and Programmer/Coders.
I was thinking the opposite, I would've though a SE is more specialised in one field, but a P has broad knowledge and hence is more flexible in how he/she applies that knowledge in order to develop a specific piece of software required by a client.
parham··on Difference between Software Engineers and Programmer/Coders.
That's wrong, I think there needs to be an abstract term to describe all but then use engineer and coder to describe specific roles.
parham··on Difference between Software Engineers and Programmer/Coders.
I have to say, I disagree with him the two are separate disciplines, they need to be distinguished properly.
parham··on Introducing Jelly
Honest review of the video: very boring, cliché and didn't convince me to download the app after watching it. I wasn't sure wether I should post this or not (sorry for being negative) but I guess it's better than no feedback.
parham··on The RIAA forced me to shut down a successful website/apps I built in high school
Oh ok, I guess I have a lot to read up on, would you know any good free sources of case law? and/or anything interesting related to DMCA?
parham··on The RIAA forced me to shut down a successful website/apps I built in high school
You could argue that, YouTube has maintained their safe harbour, and hence they're a reasonable entity. It wasn't apparent to them that copyright was being breached so the "red flag" is not apparent to a reasonable entity, i.e. if the embeder is liable so is YouTube. This makes sense but I don't if it would be convincing elsewhere.
parham··on The RIAA forced me to shut down a successful website/apps I built in high school
I doubt it's illegal to embed a track that's been uploaded by the copyright owner, as they can just disable embedding. I'm assuming it becomes illegal if the uploader didn't own the copyright and was uploading the track illegally. This is impossible to verify unless the owner of the copyright gives a notice, YouTube does all it can, if they can't catch this then how can a normal user do so.
parham··on Coinbase Raises $25 Million From Andreessen Horowitz
That is a serious flaw. I was thinking they had evil intentions.
← PreviousPage 2 of 3Next →