The Big Programming Thread - Page 551
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
icystorage
Jollibee19343 Posts
| ||
Ben...
Canada3485 Posts
On November 27 2014 07:15 Xyik wrote: I've tried Play! before and the documentation not only sucked back when I used it, it's impossible to google for help because Play! is not SEO friendly. Most of the tutorials you'll find will be for development in Scala. There's a place here looking to hire CS grads in spring and they specialize in Scala and Play and do what sounds like some interesting stuff with both. I've looked at Play a bit. It seems really neat. I was teaching myself scala but that got sidelined by school. My goal is to learn some of both over the break and apply there in a couple months. | ||
CatNzHat
United States1599 Posts
| ||
Blisse
Canada3710 Posts
On November 27 2014 04:35 nunez wrote: rofl. curse the lonely life of the template metaprogrammer... :3 doing concurrency in c++ stuff, so want to use more c11 stuff ;-; i wish there was a run time constant sized array in c++ that could be initialized in the constructor. std::array is close, but it's compile time, and i dont want vector because its mutable :/ | ||
Manit0u
Poland17046 Posts
Kinda sad... | ||
Biolunar
Germany224 Posts
On November 27 2014 16:48 Blisse wrote: i wish there was a run time constant sized array in c++ that could be initialized in the constructor. std::array is close, but it's compile time, and i dont want vector because its mutable :/ Use std::unique_ptr. (Hint: unique_ptr is specialized for array types to call delete[] instead of delete) | ||
waffelz
Germany711 Posts
On November 27 2014 18:57 Manit0u wrote: http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ Kinda sad... ahahahaha... I so can relate to that, I am just at this point ... | ||
Deleted User 101379
4849 Posts
On November 27 2014 18:57 Manit0u wrote: http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ Kinda sad... I wouldn't give too much on that article. Apart from being fairly biased it's also extremely outdated with it's C# examples - which isn't surprising considering it's 8 years old and languages have developed a lot in that time. The feeling of wanting feature X of language Y when you are developing Z is normal, no matter which language you use. All languages have a lot of features that other languages miss, because all languages specialize in different areas. While a specific feature might be useful, usually using the full language isn't, often due to missing libraries or other missing language features. I do wish PHP had C# style lambda expressions and properties though
| ||
ZenithM
France15952 Posts
On November 27 2014 18:57 Manit0u wrote: http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ Kinda sad... Worth noting that it's a very old post (2006). His comparison with C# doesn't hold anymore, C#'s handling of lambdas is elegant since C# 3.0, and Python is really not that much more powerful than C# imho. There are even constructs that are obviously more expressive in C# than in Python, like concurrency or asynchronous stuff. I get the "demotivation" bit though. I can't fucking bear Java anymore (which is a way more stagnant language than C# ;D) now that I've tasted Scala. Edit: Haha Morfildur sniped me baaad. | ||
nunez
Norway4003 Posts
On November 27 2014 16:48 Blisse wrote: :3 doing concurrency in c++ stuff, so want to use more c11 stuff ;-; i wish there was a run time constant sized array in c++ that could be initialized in the constructor. std::array is close, but it's compile time, and i dont want vector because its mutable :/ dynarray is in the pipe, and hopefull will make it into the standard. in the mean time maybe valarray can help. or write a small wrapper around vector (it has a constructor that allows you to specify how many elements). or (as i would have done) just use vector and be disciplined. | ||
Manit0u
Poland17046 Posts
On November 27 2014 20:44 Morfildur wrote: I wouldn't give too much on that article. Apart from being fairly biased it's also extremely outdated with it's C# examples - which isn't surprising considering it's 8 years old and languages have developed a lot in that time. The feeling of wanting feature X of language Y when you are developing Z is normal, no matter which language you use. All languages have a lot of features that other languages miss, because all languages specialize in different areas. While a specific feature might be useful, usually using the full language isn't, often due to missing libraries or other missing language features. I do wish PHP had C# style lambda expressions and properties though
In PHP you can do this:
And in case of an array of objects:
You can also do it with just one function and one lambda:
| ||
sabas123
Netherlands3121 Posts
On November 27 2014 20:49 ZenithM wrote: I get the "demotivation" bit though. I can't fucking bear Java anymore (which is a way more stagnant language than C# ;D) java feels like your explaining programming to a child, you have to say everything about 3 times for it to do the simpelist things | ||
Ben...
Canada3485 Posts
On November 27 2014 23:56 sabas123 wrote: java feels like your explaining programming to a child, you have to say everything about 3 times for it to do the simpelist things That's an apt way of describing it. It's so tedious. I haven't had to write any since spring and just the thought of having to write it again gives me a bit of a headache. The verboseness of java is something I really do dislike. | ||
mostevil
United Kingdom611 Posts
On November 27 2014 20:44 Morfildur wrote: I wouldn't give too much on that article. Apart from being fairly biased it's also extremely outdated with it's C# examples - which isn't surprising considering it's 8 years old and languages have developed a lot in that time. The feeling of wanting feature X of language Y when you are developing Z is normal, no matter which language you use. All languages have a lot of features that other languages miss, because all languages specialize in different areas. While a specific feature might be useful, usually using the full language isn't, often due to missing libraries or other missing language features. I do wish PHP had C# style lambda expressions and properties though
I really need to start using lambdas at some point. Legacy OS' of my customers have me trapped at older versions of .NET. They still don't look natural to me yet, it's a weird ass syntax in a world that mostly looks like c. | ||
berated-
United States1134 Posts
On November 28 2014 01:06 Ben... wrote: That's an apt way of describing it. It's so tedious. I haven't had to write any since spring and just the thought of having to write it again gives me a bit of a headache. The verboseness of java is something I really do dislike. In an enterprise environment it's something that I've come to love. Sure, if I'm trying to script or do something quick and dirty or only for myself, I agree that it's a bit overkill. However, when you have to maintain a project for many years and developers come in and out like a revolving door the verbosity of java is quite nice. | ||
ZenithM
France15952 Posts
The downside is, it forces good programmers to code like bad programmers. It's not really something that can be changed too. There are nicer "mainstream" "for the masses" languages, like Python, which is both easy and expressive, but every programmer won't be able to code in Haskell, for example. | ||
Blisse
Canada3710 Posts
On November 27 2014 21:58 nunez wrote: dynarray is in the pipe, and hopefull will make it into the standard. in the mean time maybe valarray can help. or write a small wrapper around vector (it has a constructor that allows you to specify how many elements). or (as i would have done) just use vector and be disciplined. dynarray sounds like it! i'm finding it's less about discipline and more about i shouldnt have to tell my brain how to interpret arrays as resizable or not, the compiler should do it for me | ||
nunez
Norway4003 Posts
i think making your assumptions explicit in code (f.ex that this container is not resizeable) is ~always a bonus. dynarray also hopefully will have the added bonus of using stack allocation if the size is small enough. but if that's not a concern, then vector is a safe bet: it's everyones favorite container. dynarray will be a nice addition when the holy binary, GCC, selects it for ascension. | ||
Blisse
Canada3710 Posts
vectors are nasty deques master race | ||
Manit0u
Poland17046 Posts
On November 28 2014 01:25 mostevil wrote: I really need to start using lambdas at some point. Legacy OS' of my customers have me trapped at older versions of .NET. They still don't look natural to me yet, it's a weird ass syntax in a world that mostly looks like c. I must say that I'm not a big fan of lambdas. Just like I'm not a big fan of chaining in PHP. It seems like trying to cram as much code as possible into one line which can make it less readable. Don't get me wrong, I'm all for using anonymous functions and recursion when declaring "variables" but apart from that I think you start introducing too much clutter in imperative languages. | ||
| ||