He doesn't give examples, so it's hard to say why he posted this or what he's talking about. I assume it's constructs like break, continue, throwing an exception, and (as you said), returning before the end? He seems pretty upset.Goto Is Not A Horror - iRi
jerf.org
One related issue maybe using multiple return statements in a function. I sometimes do that (especially from nestedc ifs), but some will say it's not entirely kosher (and of course it is to some degree risky).
tl;dr: pibbuR has a joke about this, in the PS section down below.
PS. The joke:
A programmer and his family for some reason spent some time in the US. His little daughter was playing outside with a neighbour boy. They started a quarrel, and the neighbour, not very diplomatically, suggested she ought to visit hell. In tears she ran home. "Mommy, he said the bad word. He said goto."
DS
If Cheap Logic then
Do Easy Stuff
Else
If Expensive Logic Then
Do hard stuff
Else
Do Easy Stuff
Sure C has a goto; and of course even fortran has a goto. I used a goto in C once for an interpreter - it was an exception case around a longjump when the entire interpreter had to reset it self.Heh. Do some languages still have a goto?
I know, but I mean in modern languages, it has all but disappeared. The only related concepts are break, continue, and exceptions.Sure C has a goto; and of course even fortran has a goto. I used a goto in C once for an interpreter - it was an exception case around a longjump when the entire interpreter had to reset it self.
It seems to work, in its awkward way. It's good for interfacing with C/C++.Finally they come to their senses:
Rust adds support for C-string literals
Support for C-string literals makes it easier to write code that interoperates with foreign language interfaces requiring null-terminated strings.www.infoworld.com
Rust, the C-way ("Crust"?) - pibbuR likes that.
const CSTRING: &CStr = c"Hello, world!";
let rst = CSTRING.to_str().expect("conversion failed");
println!("'{}'", rstr);
let rstring = "Hi, world!\x00";
let bytes = rstring.as_bytes();
let cstr = CStr::from_bytes_until_nul(&bytes).expect("conversion failed");
println!("{:?}", cstr);
str.chars().nth(n).unwrap()
, so by converting the string into an iterable, counting until the nth character, and checking that it exists. You can't have a direct access with an offset like str[n]
, unless you're sure it's only ascii, and even then, you must enclose the code in 'unsafe' tags and so on.Out of curiosity, what don't you like in the Python language?I need to explore machine learning. Or rather, I want to. But there's one problem: It's (nearly) all about Python. I don't like Python. I think it's a good language and there's a ton of useful libraries for it. I would also without doubt recommend anyone wanting to learn programming to go for it. And I've learned it. But I don't like it. C++ is much more funny, and since I do all my programming for fun, C++ is my language of choice, simple as that.
I'm not @pibbuR but i was forced to use Python for some scripting purposes and i had two hates for the language:Out of curiosity, what don't you like in the Python language?
For our usage (system utility); strong types wasn't an issue. While the language has gain a lot of attention over the years due to ease of use; i think for its original designed application the typing is a non-issue. If you want strong types and an interpreter there is always Java; of course for system programming Java sucks rotten egg so there is that aspect.It's very convenient that it can be used with an interpreter and it's very flexible, but the main reproach I have is the lack of static typing. Because of that, I don't think it's fit for large or safety-sensitive projects.
I'm using it a lot to test things or when I quickly need to process data and performances aren't an issue.