|
Strong Sauce posted:Read the whole thing: As Janin said, php really doesn't deeply care about he difference between strings and numbers and will generally auto convert to integers (usually 0 if they're non numerical). Introducing a breaking change like that is pretty dumb considering it goes against how strings usually behave in PHP. Stuff like this seems pretty par for the course on PHP though. The person who filed the issue put it best: quote:[2010-01-08 21:26 UTC] endosquid at endosquid dot com Also it probably should have returned the empty string all along, returning 0 here doesn't really make sense. A breaking change like this is similarly dumb though, especially his suggested fix, which is pretty in and of itself: quote:Months? Being a bit dramatic here?
|
# ? Jun 22, 2012 15:15 |
|
|
# ? May 20, 2024 23:40 |
|
What in the loving gently caress Rasmus posted:I think the right solution for you here is to be explicit about casting code:
The final indignity: the documentation doesn't mention this. For output, it says it outputs a formatted version of number. It does not mention null. Christ, and this was undocumented? What the gently caress? I say this as a full-time professional PHP programmer, holy poo poo. This single incident is making me to learn another language. What do y'all recommend?
|
# ? Jun 22, 2012 15:17 |
|
I'm happy with Python.
|
# ? Jun 22, 2012 15:29 |
|
Golbez posted:I say this as a full-time professional PHP programmer, holy poo poo. This single incident is making me to learn another language. What do y'all recommend? Depends on what you want it for. Web development? Ruby (+Rails), Python (+Django or probably dozens of others I haven't tried), if you like some static typing (and who doesn't?) Scala (+Play or, if it has actual documentation now, +Lift).
|
# ? Jun 22, 2012 15:32 |
|
ToxicFrog posted:Depends on what you want it for. Web development? Ruby (+Rails), Python (+Django or probably dozens of others I haven't tried), if you like some static typing (and who doesn't?) Scala (+Play or, if it has actual documentation now, +Lift). Web development. Currently rocking PHP/MySQL, and have been wondering about finding a better alternative to MySQL as well.
|
# ? Jun 22, 2012 15:41 |
|
Without more information about their needs or wants, I always tell people who want to learn a new (or first) language that the answer is Python. However...I can't say for sure whether that's an objective recommendation. Python* is the first language I learned so I may just have a soft spot for it. *Besides QBasic, but I learned QBasic when I was like 12 and then didn't touch programming for 20 years.
|
# ? Jun 22, 2012 15:42 |
|
If you've got the time, throw a look at Haskell. While I haven't done web development with it personally it's a really exciting language. I'm using Python/Django for web development and it works like a charm. \/ Postgres is just so much better than mysql KaneTW fucked around with this message at 16:15 on Jun 22, 2012 |
# ? Jun 22, 2012 15:49 |
|
Golbez posted:Web development. Currently rocking PHP/MySQL, and have been wondering about finding a better alternative to MySQL as well. Postgres for relational, Mongo for document.
|
# ? Jun 22, 2012 16:11 |
|
pokeyman posted:Postgres for relational, Mongo for document. I have experience only in relational DBs. Is there a link that explains the second half of your sentence to me like I'm a 5 year old?
|
# ? Jun 22, 2012 16:19 |
|
Do not pick Python for web development. It is a pretty great language, but Django is a enormous piece of poo poo that breaks if you cough on it too hard. Pick Ruby, which is a great language with great support for all sorts of expressive new ways to write code, and gives you Rails, which makes web development so much nicer. Edit: Golbez posted:I have experience only in relational DBs. Is there a link that explains the second half of your sentence to me like I'm a 5 year old? http://en.wikipedia.org/wiki/MongoDB#Data_manipulation:_collections_and_documents seems pretty good at explaining things.
|
# ? Jun 22, 2012 16:20 |
|
Sinestro posted:Do not pick Python for web development. It is a pretty great language, but Django is a enormous piece of poo poo that breaks if you cough on it too hard. Pick Ruby, which is a great language with great support for all sorts of expressive new ways to write code, and gives you Rails, which makes web development so much nicer. I've been using Django and it didn't seem like a piece of poo poo at all.
|
# ? Jun 22, 2012 16:23 |
|
And Redis for key-value.Golbez posted:I have experience only in relational DBs. Is there a link that explains the second half of your sentence to me like I'm a 5 year old? Basically instead of a schema describing tables you have no schema and documents containing whatever you want. I've never found a page that does what you ask, but here's a recent blog post that does an ok job. Seems relevant too.
|
# ? Jun 22, 2012 16:27 |
|
Golbez posted:I have experience only in relational DBs. Is there a link that explains the second half of your sentence to me like I'm a 5 year old? http://klewel.com/conferences/djangocon-2012/index.php?talkID=9 Skip to slide 18.
|
# ? Jun 22, 2012 16:41 |
|
"Document" and "key-value" databases are the real horror.
|
# ? Jun 22, 2012 16:50 |
|
KaneTW posted:I've been using Django and it didn't seem like a piece of poo poo at all. Eevee posted:Django is a massive beast designed for CMS-likes and other content-rich sites. It has a large ecosystem of pluggable components, built-in everythings from templates to an ORM, and piles of documentation and community resources. Django is generally cited as the Python equivalent to Ruby on Rails. The downside is that convincing it to do things it doesn’t want to do can be… awkward. (Many of the more obtuse questions in #python are caused by attempts to tinker with Django.) This is pretty much the best description of Django I have read. (Source: here) He compares to Ruby on Rails, but Rails makes up for it's large size by actually making things easier than working with a barebones framework. To put it another way, Django has all of Rails' complexity, but lacks any of its helpers or most of its utility.
|
# ? Jun 22, 2012 16:53 |
|
You have other options besides Django, you know, like Flask and Pyramid. Read that post that Sinestro linked for more details. I'm not the biggest fan of Django for multiple reasons but it's not outstandingly bad. It's not PHP. I've never used Ruby on Rails, or Ruby, so I can't give a trip report about that, but it doesn't look that insane.
|
# ? Jun 22, 2012 16:59 |
|
So our testing framework is designed to be able test multiple versions of the same product. Today we're testing v5.0, but tomorrow we might be testing v5.1 or v4.0 (still supported with occasional fixes) using the same framework. But v5.0 has new functionality and needs to be treated a little differently. So:code:
|
# ? Jun 22, 2012 17:10 |
|
I really like how the one PHP developer seems to think that we should care more about Rasmus's opinion because he created PHP.
|
# ? Jun 22, 2012 17:29 |
|
qntm posted:So our testing framework is designed to be able test multiple versions of the same product. Today we're testing v5.0, but tomorrow we might be testing v5.1 or v4.0 (still supported with occasional fixes) using the same framework. But v5.0 has new functionality and needs to be treated a little differently. So: That's god-awful. Why aren't you unit testing with a real framework that runs as part of your CI process? Why don't you have a CI process? Why aren't you branching your code for each release so you can test each release in isolation? Why do you work there? Seriously, the more I think about this, the more it hurts my head. If you're supporting multiple versions of an application, you're being straight-up retarded by not branching your code and maintaining those different versions independently. New Yorp New Yorp fucked around with this message at 18:03 on Jun 22, 2012 |
# ? Jun 22, 2012 17:51 |
|
Zombywuf posted:"Document" and "key-value" databases are the real horror. Care to explain? memcached is a perfectly find KV store, as are Cassandra and Redis.
|
# ? Jun 22, 2012 18:00 |
|
Does anybody even use Cassandra anymore?
|
# ? Jun 22, 2012 18:08 |
|
Sinestro posted:Do not pick Python for web development. It is a pretty great language, but Django is a enormous piece of poo poo that breaks if you cough on it too hard. Pick Ruby, which is a great language with great support for all sorts of expressive new ways to write code, and gives you Rails, which makes web development so much nicer. I've done a ton of work with Django at my last job and found it to be a solid framework until you push it too hard. But I think this is a bit of an overstatement. Feel free to pick from one of the many other Python frameworks - I'm a big Flask fan, and even prefer it over Django. But saying "don't pick Python" because you don't like Django is tremendously stupid, please don't do that, thanks. Suspicious Dish posted:Does anybody even use Cassandra anymore? I think most people ran screaming from Cassandra a long time ago. And I'm not sure why Zombywuf dislikes document databases or KV stores, but I'm not a fan because I've worked on far too many projects built on a document database just to be built on a document database.
|
# ? Jun 22, 2012 18:20 |
|
Ithaqua posted:That's god-awful. Why aren't you unit testing with a real framework that runs as part of your CI process? Why don't you have a CI process? Why aren't you branching your code for each release so you can test each release in isolation? Why do you work there? I forgot a piece of information. We branch the test material for each major release, but this is for migration testing between versions. Oh, and also perhaps I was misleading: code:
|
# ? Jun 22, 2012 18:21 |
|
trex eaterofcadrs posted:Care to explain? memcached is a perfectly find KV store, as are Cassandra and Redis. Memcached is a HTML template cache node. Cassandra is, that thing, you know, I think it has something to do with Facebook, not sure if they still use it, it's for, something or other. The last time I checked there were some basic management features that required you shut down the whole cluster. Redis is memcached with some bells and whistles. Half these things sound like someone went through a database book picked some words at random and went "Yeah, we'll implement those." I rarely see any justification for using them beyond "We done hosed up our architecture and we need something to patch over the holes with."
|
# ? Jun 22, 2012 18:41 |
|
Kim Jong III posted:And I'm not sure why Zombywuf dislikes document databases or KV stores, but I'm not a fan because I've worked on far too many projects built on a document database just to be built on a document database. This is pretty much the whole reason. Plus I've found document databases to be slow in any stress test I've put them under.
|
# ? Jun 22, 2012 18:43 |
Zombywuf posted:Memcached is a HTML template cache node. Cassandra is, that thing, you know, I think it has something to do with Facebook, not sure if they still use it, it's for, something or other. The last time I checked there were some basic management features that required you shut down the whole cluster. Redis is memcached with some bells and whistles. Half these things sound like someone went through a database book picked some words at random and went "Yeah, we'll implement those." Wait, what? What do you mean by HTML template cache node? I've only seen memcached used as a cache for something held in memory that needs to be flushed from multiple (read: distributed) sources.
|
|
# ? Jun 22, 2012 18:47 |
|
Zombywuf posted:Memcached is a HTML template cache node. Cassandra is, that thing, you know, I think it has something to do with Facebook, not sure if they still use it, it's for, something or other. The last time I checked there were some basic management features that required you shut down the whole cluster. Redis is memcached with some bells and whistles. Half these things sound like someone went through a database book picked some words at random and went "Yeah, we'll implement those." Seems like you're glossing over a whole class of databases with some hand-wavy "well, I think they do this". Sometimes you just need to put stuff into a database with a simple key. Building that on a relational database is using the wrong tool for the job.
|
# ? Jun 22, 2012 18:49 |
|
Zombywuf posted:Memcached is a HTML template cache node. Cassandra is, that thing, you know, I think it has something to do with Facebook, not sure if they still use it, it's for, something or other. The last time I checked there were some basic management features that required you shut down the whole cluster. Redis is memcached with some bells and whistles. Half these things sound like someone went through a database book picked some words at random and went "Yeah, we'll implement those." You dislike them because you don't know what they are?
|
# ? Jun 22, 2012 18:55 |
|
Golbez posted:Web development. Currently rocking PHP/MySQL, and have been wondering about finding a better alternative to MySQL as well. You pretty much can't go wrong with Ruby or Python. They both have large frameworks that they're known for (Rails for Ruby, Django for Python) and lighter frameworks for more flexible development (Sinatra for Ruby, Flask and Pyramid for Python). As for the differences between the languages... Ruby is very good at writing DSLs and gives you a lot of opportunity for "natural" looking language extensions. It's big on giving you a lot of ways to do things (which is a key part of its philosophy, taken from Perl). It's mostly constrained to web development though; I can't really think of many non-web libraries for it. Python on the other hand values a standard syntax and a standard way of doing things. In their opinion there should be one "best" way to do things, which should be clean, easy and obvious; you'll hear this referred to as the "Pythonic" way of doing something. Python has branched out beyond web development though; SciPy (with NumPy) are a great option for scientific computing and there are (were?) game development libraries, but I don't remember which are defunct. One more thing about Python: there's two main versions, Python 2 and Python 3. Python 2 is still the most commonly used version as python 3 introduced some backwards incompatible changes and not all libraries have updated to py3 yet.
|
# ? Jun 22, 2012 19:02 |
|
trex eaterofcadrs posted:Seems like you're glossing over a whole class of databases with some hand-wavy "well, I think they do this". Sometimes you just need to put stuff into a database with a simple key. Building that on a relational database is using the wrong tool for the job. Personally, I've yet to convince myself that most programmers know when it's actually a good idea to use a non-relational database, and how to use one without introducing far more problems into their system. An illustrative horror in two parts: One place I worked at wanted to use CouchDB but didn't like the whole "views, not queries" thing so they were going to funnel everything through elasticsearch as well. That way "searches could be done against elasticsearch, and we don't have to make a ton of CouchDB views"
|
# ? Jun 22, 2012 19:06 |
|
Look Around You posted:As for the differences between the languages... Ruby is very good at writing DSLs and gives you a lot of opportunity for "natural" looking language extensions. It's big on giving you a lot of ways to do things (which is a key part of its philosophy, taken from Perl). It's mostly constrained to web development though; I can't really think of many non-web libraries for it.
|
# ? Jun 22, 2012 19:20 |
|
Zombywuf posted:Memcached is a HTML template cache node. Actually memcache was written because mysql couldn't cache queries well.
|
# ? Jun 22, 2012 19:22 |
|
Zombywuf posted:Memcached is a HTML template cache node. Yeah...no. I would expect nothing less from the Coding horrors thread. If this is really how you use memcached then I hope you have a good alternative answer for data caching. Zombywuf posted:Cassandra is, that thing, you know, I think it has something to do with Facebook, not sure if they still use it, it's for, something or other. The last time I checked there were some basic management features that required you shut down the whole cluster. Redis is memcached with some bells and whistles. Half these things sound like someone went through a database book picked some words at random and went "Yeah, we'll implement those."
|
# ? Jun 22, 2012 19:26 |
|
Ruby will turn you into an expert on package management. I set out to learn rails on my own and after exploring super basic out of the box tutorials I tried to add in some common resources I saw on github and so on. Quickly I was in Aptitude/RVM/Git/Gem hell for a while where random .rb files would error out whenever I tried to Rake. It was probably mostly due to being an impatient noob at it but it definitely soured the experience. By the time I got it all working I just wanted to move on to something else entirely. That being said I think the big culprit was me putting too much faith into aptitude. All the mini package managers within the Ruby domain seemed to stay in-step and once I completely uninstalled everything out of aptitude and learned to let RVM do all the driving things started to work themselves out.
|
# ? Jun 22, 2012 19:38 |
|
Look Around You posted:You pretty much can't go wrong with Ruby or Python. They both have large frameworks that they're known for (Rails for Ruby, Django for Python) and lighter frameworks for more flexible development (Sinatra for Ruby, Flask and Pyramid for Python). I'd wager that ruby is easier to pick up for php developers than python, or perhaps, ruby is easier to write php in than python is - python has immutable strings, explicit self, an explicit unicode type, and semantic whitespace. quote:As for the differences between the languages... Ruby is very good at writing DSLs and gives you a lot of opportunity for "natural" looking language extensions. It's big on giving you a lot of ways to do things (which is a key part of its philosophy, taken from Perl). To be obsequious, ruby reminds me of a lisp-2 with a smalltalk semantics and perl syntax quote:One more thing about Python: there's two main versions, Python 2 and Python 3. Python 2 is still the most commonly used version as python 3 introduced some backwards incompatible changes and not all libraries have updated to py3 yet. Ruby similarly has some issues between 1.8 and 1.9 with the introduction of unicode handling.
|
# ? Jun 22, 2012 19:39 |
|
tef posted:To be obsequious, ruby reminds me of a lisp-2 with a smalltalk semantics and perl syntax perl + ada syntax After spending a year or so learning programming with mostly Python and some Java, I've found Ruby to be a really nice language. I think I prefer it to Python at this point, although I haven't spent as much time with it.
|
# ? Jun 22, 2012 20:06 |
|
I really, really like Ruby and use it a lot; it's clear, it does a really good job of sticking to its paradigm, and the warts it has haven't really blown my face off PHP-style. But I think Clojure has won over my blackened heart. Holy poo poo do I love 'seq
|
# ? Jun 22, 2012 20:24 |
|
Doctor w-rw-rw- posted:Yeah...no. I would expect nothing less from the Coding horrors thread. If this is really how you use memcached then I hope you have a good alternative answer for data caching. quote:Facebook switched to HBase. Cassandra is used more outside than inside. The fact that you rarely see any justification makes you sound like a narrow-minded engineer with little in the way of imagination. Job queues, transient activity feeds, optimization for data analysis - when dealing with large amounts of data, the data storage *does* make a difference. Please don't claim you don't need to do these things unless you can provide me with a stack of benchmarks. ps. have you considered using a message queue for queuing? Just a thought. Zombywuf fucked around with this message at 20:46 on Jun 22, 2012 |
# ? Jun 22, 2012 20:40 |
|
Oh man, I don't even know what to say herecode:
|
# ? Jun 22, 2012 20:44 |
|
|
# ? May 20, 2024 23:40 |
|
Golbez posted:Web development. Currently rocking PHP/MySQL, and have been wondering about finding a better alternative to MySQL as well. You guys are going to laugh, but I've been pleasantly surprised by .NET's evolution over the last few years. Just throwin that out there.
|
# ? Jun 22, 2012 20:45 |