[QUOTE=SteveUK;18464279]I suppose being a Mac user really does adversely affect your perception of good syntax (Ruby on Rails, Objective-C)[/QUOTE]
Entirely subjective. I don't really use my Mac often and I still love Ruby syntax (and, more importantly, duck typing) - fine with C-like syntax though.
[QUOTE=Jallen;18467028]Any language with no C style for loop should be shot (range(), do not want). C style for loops are so versatile, you can do a complex looping pattern in that one for statement. With python you would have to use a while loop and put some stuff in the loop body.[/quote]
Baww you have to add 2 lines or so per for loop.
[quote]Also, I love semi-colons. They make code so much more readable. [/quote]
Only if you're too used to semicolons.
[quote]I also don't like that python doesn't use curly braces, which also make code more readable.[/quote]
Proper indentation can entirely replace curly braces in terms of readability.
[quote]I very much dislike pythons lack of type being included in the variable declaration.[/QUOTE]
I very much like not limiting my methods to one class/type to process.
[quote]Baww you have to add 2 lines or so per for loop.[/quote]
So basically what you are saying is that nothing is better about it and you still have to do those extra lines. Great wow I'm switching to python.
[quote]Only if you're too used to semicolons.[/quote]
[quote=ME]They make code so much more readable. For anyone who isn't used to them I'm sure it's a pain, but [B]they make it so much clearer in time.[/B][/quote]
Semi-colons win.
[quote]Proper indentation can entirely replace curly braces in terms of readability.[/quote]
All of the most popular languages uses braces. Indentation for syntax is shit.
[quote]I very much like not limiting my methods to one class/type to process.[/quote]
It's called templating.
[QUOTE=Jallen;18469254]So basically what you are saying is that nothing is better about it and you still have to do those extra lines. Great wow I'm switching to python.
[/quote]
I didn't say it was a good thing, I just said that it doesn't really matter.
[quote]
Semi-colons win.
[/quote]
In my opinion they just make code more clear if you have used them for some time.
For me, omitting semicolons makes code look better (even though I still code in languages that require them)
[quote]
All of the most popular languages uses braces. Indentation for syntax is shit.
[/QUOTE]
While I do agree that using forced indentation for syntax sucks, I think if you indent properly it doesn't matter whether you use curly braces or words like do - end (for readability).
[QUOTE=Jallen;18469254]So basically what you are saying is that nothing is better about it and you still have to do those extra lines. Great wow I'm switching to python.[/QUOTE]
C style for loop is mostly like it is because it lets you use both integer and pointer iterators. Python doesn't have pointers. It's hardly intuitive either, try reading it out loud... it's also a lot more typing than more specialized loops.
[QUOTE=Jallen;18469254]
Semi-colons win.
[/QUOTE]
Semi-colons are used as statement separators in C-style languages. Python uses whitespace as part of the syntax, and thus you can't put several statements on one line. Then it's only natural that the newline is used as a statement separator instead.
[QUOTE=Jallen;18469254]
All of the most popular languages uses braces. Indentation for syntax is shit.
[/QUOTE]
It forces good practices and leaves no ambiguity as to how to style your code. That doesn't mean it's "shit", it's different.
And Python [I]is[/I] one of the "most popular languages", by far.
[QUOTE=Jallen;18469254]
It's called templating.[/QUOTE]
You obviously don't understand much about dynamic languages. Dynamic typing is so much more powerful than templates, and a lot more productive. There's a reason practically every scripting language is dynamically typed.
Really, I think you're just allergic to anything that isn't C syntax. When trying out a new language, you have to do it on its own terms. You can't keep comparing it to whatever language you were using before - if you do that, you won't have fun, you won't be productive, and you won't be making good code.
The heck are you talking about? Semicolons? Curly Braces? Indentation?
Binary, people! Binary!
[QUOTE='-[ Fizzadar ]-;18467210']haha, never used either :P
I just see no need to use same lines for stuff, hence there's not much point. I'd rather not have to stick ; everywhere for that, what other advantage do they give?
I assume you mean [b]for[/b][/QUOTE]
...Shit.
Messing with C#.NET in school >_> It's messin' with me a bit.
[QUOTE=jA_cOp;18469488]You obviously don't understand much about dynamic languages. Dynamic typing is so much more powerful than templates, and a lot more productive. There's a reason practically every scripting language is dynamically typed.[/QUOTE]
O GOD. This is what I hate most about scripting languages.
[quote=jallen;18467028]with python you would have to use a while loop and put some stuff in the loop body.
[/quote]
NO!! Not the sacred loop body!!
I'm generating a CSV file with umlauts and a € symbol, but I'm having trouble with the encoding. First I tried UTF-8. That works in Notepad++ (it automatically selects UTF-8 without BOM), but looks like that in Excel:
[IMG]http://i48.tinypic.com/16a8vaw.png[/IMG]
With UTF-16 it looks like that:
[IMG]http://i48.tinypic.com/2vnkxet.png[/IMG]
It looks normal in Notepad++ and even in notepad.exe
You guys are dorks for arguing over curly brackets and white-spacing and the like.
:colbert:
hey guys, i have just got back into trying to learn how to use C++ and dont know where is hould go now?
I want to make a small pac man game but dont have a clue where or how to start, any ideas?
[url]http://www.facepunch.com/showthread.php?t=700269[/url]
And apart from cplusplus.com I highly recommend [url]www.learncpp.com[/url].
[QUOTE=Archive;18470641]You guys are dorks for arguing over curly brackets and white-spacing and the like.
:colbert:[/QUOTE]
[IMG]http://i47.tinypic.com/11bot9v.png[/IMG] ; and {} forever in my heart
[QUOTE=fille87;18471260][IMG]http://i47.tinypic.com/11bot9v.png[/IMG] ; and {} forever in my heart[/QUOTE]
I see what you did there. :P
I love my curly brackets and my ;s.
What are you working on?
[QUOTE=efeX;18471687]What are you working on?[/QUOTE]
A social project, in school, right now. But that's failing because the Chromium source is calling to me.
you can use semicolons in python
print('Hello'); print('World!')
I like the for loops in python, since it allows you to iterate through anything but an integer or float, without having to know its length.
Got a dictionary?, a list of tuples? for x in blah: pass
even better are some of python's list comprehensions
for z in [ x * 2 for x in normal_list]:
Also
[code]
function_list = []
b = 2
def x(a):
print(a)
def y(a):
print(a * 2)
def z(a):
print(a / 2)
function_list.append(x)
function_list.append(y)
function_list.append(z)
for function in function_list:
function(b)
[/code]
A bad example but if you treat call several functions and then perform the same actions over and over it helps.
And jallen, you're just nitpicking about the curly braces.
Work continues on the next version of my build system dubbed "Fly By Night". I'm currently working on getting the sqlite3 database to write, and read the proper file dependencies, as well as the file hashes. Hopefully everything will start to come together in the next week or so. This release is going to be much more refined this time around.
I hate how you can't do this in PHP:
[php]
ArrayReturningFunction()[1]
[/php]
Rejected as too obfuscated for the intent of PHP my ass.
I'm [b]trying[/b] to build chromium OS, I don't really know what I'm doing and it's not quite working but it's giving me some good linux experience.
I just downloaded the vmdk and converted it to a VHD so I didn't have to download VMware on my development machine.
[QUOTE=Robber;18470446]I'm generating a CSV file with umlauts and a € symbol, but I'm having trouble with the encoding. First I tried UTF-8. That works in Notepad++ (it automatically selects UTF-8 without BOM), but looks like that in Excel:
[IMG]http://i48.tinypic.com/16a8vaw.png[/IMG]
With UTF-16 it looks like that:
[IMG]http://i48.tinypic.com/2vnkxet.png[/IMG]
It looks normal in Notepad++ and even in notepad.exe[/QUOTE]
Does anyone have any advice on this? I don't really want to make a thread for such a small issue.
[QUOTE=Sippeangelo;18472723]I hate how you can't do this in PHP:
[php]
ArrayReturningFunction()[1]
[/php]
Rejected as too obfuscated for the intent of PHP my ass.[/QUOTE]
Completely agree, stumbled across it a few days ago, very stupid, very annoying.
...like semicolons!
[QUOTE=Sippeangelo;18472723]I hate how you can't do this in PHP:
[php]
ArrayReturningFunction()[1]
[/php]
Rejected as too obfuscated for the intent of PHP my ass.[/QUOTE]
Optional index parameter? You should only get information you need from your "ArrayReturningFunction"
[QUOTE=SteveUK;18475403]Optional index parameter? You should only get information you need from your "ArrayReturningFunction"[/QUOTE]
I need all the indexes but one.
You need everything except 1? What, that's not what you're going to get with that code in any language.
[QUOTE=blankthemuffin;18477174]You need everything except 1? What, that's not what you're going to get with that code in any language.[/QUOTE]
It's stupid anyways, even though I can't find a real use for it.
Sometimes I want the whole array, sometimes I want just one. I don't want to fuck around with three different functions or make it return the whole array if the index is not specified.
[QUOTE=Sippeangelo;18477061]I need all the indexes but one.[/QUOTE]
Which func()[index] does not represent. Nice troll.
In what situation would you need every index BUT one. And if it's database related why don't you make it select everything BUT that one?
[QUOTE=SteveUK;18477302]Which func()[index] does not represent. Nice troll.
In what situation would you need every index BUT one. And if it's database related why don't you make it select everything BUT that one?[/QUOTE]
It does not matter. I want to be able to access any index returned by this function without making an extra ugly variable holding the returned array.
People, go back to discussing interesting stuff please.
Sorry, you need to Log In to post a reply to this thread.