Hacker News new | past | comments | ask | show | jobs | submit login

Libraries were created so that you could focus on mastering new and unexplored territory, not to replace programmers.

As a beginner, I didn't appreciate big libraries (like Cocoa). I couldn't wrap my head around the idea of having tons of prewritten code and stitching it together - I understood programming as writing code - so I wanted to write my own damn code, not just manipulate massive libraries.

So I turned to PHP and developed my own webapp (a stripped down Google Docs), from scratch. I quickly stumbled upon the purpose of frameworks and libraries. After writing my 20th SQL query I realized I was wasting time. About 10 hours later, I made my own light PHP framework. Now I didn't have to worry about my SQL syntax (it was automated based on the data model variables) and I got to start working on really cool/interesting programming issues rather than the mundane blah code.

Now I've started to investigate Cocoa again and I realize that libraries and frameworks have not hurt programming, but dramatically catapulted it into the realm of science rather than plug-and-chug. Today, our software is more complex than ever and it will only get more complex in the future.

I think if you see programming as just "stitching libraries together", then you've lost your passion or never had any to begin with. Programming has evolved into a science where you have to learn the foundations (languages) AND the pre-existing solutions (libraries) in order to figure out what's been done for you so that you can focus on exploring new and more complex issues.




Where does mathematics come into play in your evaluation? I just spent last quarter on discrete mathematics and digital design and it has given me a different perspective on programming in my learning experience.

I wouldn't call myself a programmer yet ( Joe Hewitt has made that apparent to me: http://twitter.com/joehewitt/status/9813494038 ), but it seems like modern software engineering is a form of alchemy now. I thought a software product is a combination of different mathematical techniques, but translating that into code seems so cumbersome (taken into consideration that I've learned and had experience in my choice of programming language and framework, which is also a major task on its own).


Math has always been a part of technical design. I think "programming" is starting to become a field where the actual authoring of code and the design of logic fuse completely. So the future of programming combines the design (engineering, mathematics, etc.) with writing code.

From my somewhat inexperienced standpoint, I think programming has gone from instructing the computer to complete a task, to telling the computer to create a logic and handle events based on a complex set of conditions. The former was simple - 1, 2, 3, done - while the latter requires you to design a system, then make that system function through code.

I see old-style programming as following a map: go straight, turn right, turn left, and then stop at the destination. Modern programming is more like telling the computer to use this logic to find its own way on the map, then follow through.

Basically, I see programming slowly morphing into the creation of artificial intelligence.


I think you have the wrong idea about programming. Programming has always had algorithms (the ability to find its way around a map). This "old-style programming" is called procedural programming, but even that paradigm had capabilities to implement algorithms. This is the computer science aspect of programming. Actually, it's not an aspect at all, it's the foundation of programming.

No, programming is a result of mixing math and linguistics to achieve information processing. Of course that's my inexperience evaluation and I bet a veteran of this field would quickly tell me that I too have an incorrect notion. But see, that's the thing. It shouldn't be this hard to comprehend! Sadly, as Scott Rosenberg says in his book Dreaming in Code, the reason why programming is imperfect is because people made it that way and people are imperfect.


I think you need to really learn what sql is. It's a 4th generation language, higher level than php or other oo/procedural/functional langauges. If you're finding php and a framework to be better you're underestimating the power of sql.


The SQL statements are not the problem. The problem is turning the list of tuples you get back into a usable data structure.

Also, abstracting away SQL doesn't mean you abstract away set algebra. It means you write "$current_user->messages( text => { -like => 'foo%' })->recipients" to get a list of people the current user sent messages containing the word "foobar" to, instead of some 200-character-long embedded program in another language. A good ORM is an essential abstraction.


By that example, I meant to highlight the DRY aspect of programming and how I realized, as an early beginner at the age of 15, that frameworks and libraries provide a good foundation so you can focus on more complex issues.

The SQL I kept repeating in that application was simple CRUD functions on MySQL tables. I know that SQL is so much more than that.


Sql isn't more than that. That's the whole beauty of relational programming, you only have to write queries and views, and this simple abstraction does most of the work that you need to do (with pl/sql or t-sql it is turing complete and you don't even need to leave the rdbms).


I don't get why some people keep praising SQL like this. SQL is great for complex queries that contain valuable logic, but it's not expressive at all when you want to do something trivial. Getting all the attributes of user X is so much more work, and harder to maintain, in SQL than it is in any ORM.

"select name, pass, hash, email, realname from user where id = ?"

versus

session.get("User", x)


SQL is not particularly nice for complex queries, either. The underlying model is good, but the particular syntax they chose is verbose, confusing, and non-portable.


I kind of agree, but I was conceding the most reasonable argument to the parent.


'SELECT * FROM user WHERE id = ?' OR 'SELECT getUser(?)' presuming you have a stored procedure/function getUser that returns the data you need, and you should (or a view, at least)


SELECT *? A function in the SELECT statment?

Oh dear god, a blasphemer!

The former can cause performance problems if you have blobs as well as being an unnecessary security hole, the latter can cause performance problems over large datasets as it often forces the execution plan away from a set based solution.


The fact that using the most trivial of examples triggers a discussion in on itself helps to prove my point.

Nobody debates session.getUser(id)


Relational programming may be beautiful, sure, I guess in some ideal world.

But SQL syntax is a dog. Especially when it's sitting next to real code, wrapped up inside strings and making everything feel dirty.

If you're using an SQL database from within another language primarily just to dump objects and pull them out, and especially if you're doing a lot of it, I have trouble thinking of a situation where you wouldn't prefer to abstract away the SQL bits. Maybe if you're working in a language with built in SQL syntax support? Even then, it's not exactly compact, and you've got quite a bit to do even after you get your results back from the database...


SQL, or more accurately, relational algebra, is a thing of pure mathematical beauty.

The problem is all the other crap that you have to layer on top of it for it to be really, really useful.


What about the very common cases where you need to do very simple things, like common CRUD operations? Abstracting the SQL required for these simple queries makes a lot of sense to me.


Sql is designed exactly for CRUD. Almost by definition there's no better way to do CRUD than sql. And about CRUD - most software should rightly be CRUD, because CRUD represents the highest level of abstraction in programming that you can get (below natural language interface of course). Sql CRUD abstracts away all hardware and software layers of the computer (the only hardware/software efficiency decision you have to make is where to declare indexes).


It doesn't abstract away the fact that your application is written in terms of polymorphic objects, rather than opaque relations. It also doesn't abstract away the fact that people like to represent their data with data structures richer than "set". SQL works reasonably well for CRUD, but most web applications are not CRUD, they're online transaction processing, where relational databases just get in the way. A good object database is a much better fit. (And no, I don't mean CouchDB.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: